Annotating JUnit tests in a Zephyr Scale development project enables results to be sent from JUnit directly to Jira. All it takes is a pre-made script within a task.
This topic illustrates the workflow, explains how to configure the Zephyr Scale library for JUnit tests, and walks you through how to properly annotate JUnit tests.
Workflow: Zephyr Scale and JUnit
Here's how the components work together:
Configure the Zephyr Scale Library to Receive JUnit Test Results
- Download the Zephyr Scale/Junit integration repository from our Bitbucket.
- Add the automation library to your project by following the instructions in the README section.
This enables you to annotate your JUnit tests with a Zephyr Scale key or name and generate a custom report when you run tests.
To send the test results to Jira, you'll need to include a pre-made script (see the task below).
Annotating JUnit Tests
- Add the dependency to your .pom file for the Zephyr Scale JUnit library:
- Register the Zephyr Scale JUnit listener:
This will generate the results file with test case keys.
- Add annotations to your JUnit tests for the test case key or name:
Run the tests with this command:
mvn test
The Zephyr Scale test-execution-result file generates in the same execution folder.
Finally, if you want to see an example of the Zephyr Scale integration with JUnit in action, we've got you covered.