Gherkin2MTM Tool
Context: The Philips Software Test Automation team is responsible for automating both test execution and test creation wherever possible to reduce the amount of manual effort needed to validate our product. Before the Gherkin2MTM tool was created, Philips Test Engineers were required to create test cases on Azure DevOps manually.
​
Question: How can automate or at a minimum reduce the effort required to create test cases on Azure?
​
Solution: Create a tool that parses the test metadata and Gherkin scenarios contained within our feature files, then uses the Azure DevOps REST API to automatically create or update the corresponding test cases.
Gherkin2MTM In Use
Reqnroll (our testing framework) requires two things in order to run tests.
1. A feature files containing Gherkin (english representation of a test scenario and steps)
2. Steps files containing the code implementation corresponding to each Gherkin step
​
For Philips, tests must be tied to a specific version of our product and classified using tags that describe the type of test being performed. The feature file above shows scenarios tagged as part of the @ApplicationHost test category, along with additional test category tags. These tests target the PIIC_iX product and are associated with Test Suite ID 1132491.
​
The image below shows the corresponding test case after it has been created in Azure DevOps. The test case title, scenario steps, and classification information are highlighted with red boxes.​​​​
Using the Azure DevOps API
Azure DevOps exposes REST APIs that allow us to interact with resources such as work items, test plans, test suites, and test cases.
​
Instead of requiring a Test Engineer to manually create or modify each test case through the Azure DevOps interface, Gherkin2MTM performs these operations programmatically.
When the tool is executed, it parses the supplied feature files and extracts information from their Gherkin scenarios and tags, including details such as the product version, test classification, and target test suite.
​
Using the Azure DevOps REST API, the tool then connects to the appropriate Philips Azure DevOps organization and project. For each scenario, it determines whether the corresponding test case already exists.
-
If the test case does not exist, the tool creates it.
-
If the test case already exists, the tool updates it to reflect changes to the Gherkin steps, scenario name, or test metadata.
How to Run The Tool
The command shown above executes Gherkin2MTM and provides the information required to process one or more feature files, including the Azure DevOps organization, project, test plan, product release, test suite information, and feature file location.