Test keys
Test cases can be linked to test cases in third-party test management tools like TestRail, Zephyr Scale, etc.
In order to be able to add these links, you first need to set up an integration with the required test management system. You can find instructions for supported systems in Integration with third-party TMSs.
Test case links can be added manually using the web interface or automatically from the test results you upload to Allure TestOps.
Adding links manually
To link an Allure TestOps test case to an external test case:
- Go to Test cases.
- Select a test case.
- On the right side of the page, next to Test keys, click the pencil icon.
- Click the Add button.
- Under Test case system, select the third-party test management system.
- Under Name, enter the identifier of the external test case you want to link to.
- Click Submit.
Setting links automatically from test results
Test case links can be added to test cases automatically when you upload test results to Allure TestOps. For this to work, you need to specify them in your integration code and create mappings for third-party test management systems in your project settings.
Specifying test case links in code
The exact implementation will depend on the testing framework you use, but as an example, here is what it might look like if you are using JUnit 5:
@Test
@TestRailCase("4076")
@DisplayName("Creating new issue by authorized user")
public void shouldCreateIssue() {
steps.openIssuesPage(OWNER, REPO);
steps.createIssueWithTitle(ISSUE_TITLE);
steps.shouldSeeIssueWithTitle(ISSUE_TITLE);
}
Notice the line starting with @TestRailCase. This line links the test case to the C4076 test case in TestRail.
The code above will generate a test result file with the field "labels". This field contains the properties that will be applied to the test case when the file is uploaded to Allure TestOps.
...
"labels": [
{
"name": "testrail",
"value": "4076"
},
...
You can read more about using labels in the corresponding article.
Creating mappings
- Go to the project page.
- In the menu on the left, click Settings → Test Key.
- Click the Create button.
- As the Key, specify the value you use in your code. For the example above, it is testrail.
- As the Test management system, select the required TMS integration you previously added to your project. For the example above, it is a TestRail integration.
- Click Submit.
Automatic creation for test cases sync
When you have configured an integration with a third-party TMS, and you are synchronising a test case, Test Key attribute will be filled automatically by Allure TestOps and will contain the ID of this test case in the third-party TMS. As soon as Allure TestOps created a test case in the third-party TMS, it'll use Test Key for further sync.