Integrating Robot Framework with Gherkin

Jun 22, 2024

Integrating Robot Framework with Gherkin

Introduction

  • Two heroes in the digital realm: Sir Robot Framework (Guardian of Automation) and Lady Gherkin (Storyteller of Behaviors).
  • Aim to transform the landscape of software testing.
  • Robot Framework (RF) uses keywords; Gherkin uses natural language for scenarios.
  • Question posed: Do robots dream of pickled cucumbers?

Understanding Gherkin and Robot Framework

  • Importance of understanding Gherkin (Cucumber) for behavior-driven testing.
  • RF known for its ease with libraries and running automated tests directly.
  • Need for integration: Clarity, Efficiency, Accessibility, Flexibility.
    • Given-When-Then style in Gherkin aligns with RF's keywords.
    • Simplified test cases that are human-readable and stakeholder friendly.

Scenario Definition and Efficiency

  • Scenario 1: Improve testing efficiency via direct automation with RF.
    • Test should run automatically without manual translation to a specific syntax.
    • RF has given-when-then prefixes and embedded variables.
    • RF requires importing libraries and technical setup.
  • Scenario 2: Natural human-readable format for all stakeholders.
    • Allows non-technical team members to review tests.

Large Ecosystem & Trainings

  • RF has extensive libraries (browser, database, embedded tests).
    • Gherkin implementations do not support all RF functionalities.
  • RF trainings can enable non-technical users to write & implement tests.

Practical Integration

  • Developed an extension tool for Visual Studio Code (VS Code) for better integration.
    • Syntax highlighting, running tests directly within the IDE.
    • Robot.TOAL file setup in VS Code with RF and Gherkin.
    • Demonstrated with a calculator feature example.

Current Status and Features

  • Full support for Gherkin language in RF within VS Code extension.
  • Supported via RF 6.1's external API for custom parsers (started mid-2020, actively developed through 2023).
  • Published first version, addressing challenges like balancing work, family, and open-source contributions.
  • Key features include syntax highlighting, running, debugging, simple analysis, and planned enhancements for documentation and coding support.

Future Directions & Community Involvement

  • Open-source project; community involvement is crucial.
    • Contributions welcome in the form of pull requests, feedback, and coding help.
    • Plans for more documentation, improved syntax features, and developer tools.
  • Questions and discussions on configuration, output formats, and native support.

Conclusion

  • Summary of the combined journey of RF and Gherkin.
  • Emphasized the shared adventure in blending automation and narratives in software testing.
  • Call to action for community support and contributions to further develop the integration.