Bamboo Integration
Bamboo is a continuous-integration, deployment, and delivery tool from Atlassian that integrates incredibly well with Jira.
Zephyr Scale’s Bamboo integration enables you to automate tests outside Jira, run them in Bamboo during the CI/CD pipeline and have results sent back to Zephyr Scale for reporting and tracking.
Note
Windows users must download and install cURL and 7-Zip and add both system paths to their machines.
Read more about how to update system path variables.
Here’s what’s covered in this topic:
Send test results from Bamboo to Zephyr Scale
Before you test
Set global variables
To initiate the Zephyr Scale integration with Bamboo, an admin must navigate to Bamboo’s Global Variables and set variable names and values for both jira_user and jira_password.
Click the image to enlarge it.
Download feature files
Prior to executing tests, Cucumber users with gherkin definitions in Zephyr Scale should create a script task and add the following code to enable feature files to be downloaded from Zephyr Scale. When you add the code, replace the PROJECT_KEY and JIRA_URL variables with your actual information. Optionally, you can replace the TARGET_PATH, ZIP_FILE, and AUTO_CREATE_TEST_CASES variables with your information, as well.
Send test results from Bamboo to Zephyr Scale
To transfer your test-execution results from Bamboo back to Zephyr Scale, you need to create a final script task in the job where you want to report the test results.
Depending on if you use Cucumber or JUnit, add one of the following code sets, and remember to replace the PROJECT_KEY and JIRA_URL variables with your actual information. Optionally, you can replace the PATH_FILE, ZIP_FILE, and AUTO_CREATE_TEST_CASES variables with your information, as well.
When executed properly, the script runs after the testing concludes. Regardless of whether the tests pass or fail, the build completes, and the test results are published to Zephyr Scale.
If you need help applying the scripts, check out Applying Scripts in Bamboo.
Add Zephyr Scale annotations
If you are using Cucumber, setup could not be more simple. Add Zephyr Scale annotations to your Cucumber tests, and use our pre-made script to send the results to Jira. The integration is based on the JSON output files generated by Cucumber, so this output option needs to be configured properly, as follows.
Configure the JSON output format for your automated tests on the TestRunner class.
Here we’ve added JUnit and Cucumber output formats:
Annotate your automated tests with the @TestCaseKey tag.
The @TestCase(key = "JQA-T1") annotation maps the test method to an existing test case in Zephyr Scale by matching its key. 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 Zephyr Scale by matching its name. If the test case doesn’t exist in Zephyr Scale, then a new one can be automatically created using this name when the results are uploaded.
Scenarios can be mapped to test cases in Zephyr Scale by using the test-case key or name as a scenario tag. For example:
Cucumber test annotations
JUnit test annotations
Now you can run the tests with Maven test, and the Zephyr Scale test execution results file will generate in the same execution folder.