Applies to TM4J Cloud, last modified on April 21, 2020.
Annotating Cucumber tests in a TM4J development project enables results from Cucumber to be sent directly to Jira. All it takes is a simple annotation.
Workflow: TM4J and Cucumber
Here's how the components work together:
Annotating Cucumber Tests
- Configure Cucumber's output format to JSON on the TestRunner class.
- Open the feature file that includes your project's Cucumber tests.
- Add an annotation for the test case key or name.
Example: The @TestCase(key = "JQA-T1") annotation maps the test method to an existing test case in TM4J by matching its key.
Example: The @TestCase(name = "Sum Two Numbers") annotation adds a name to the test case. This maps this test method to an existing test case in TM4J by matching its name. If the test case doesn’t exist in TM4J, a new one can be created automatically using the name when the results are uploaded.
Finally, if you want to see an example of the TM4J integration with Cucumber in action, we've got you covered.