Test cases' tags
Tags provide additional context to the test cases and allow you filtering the test cases based on this addition context.
Tags usage
Examples of tags usage could be belonging of a test case to certain group of tests like e.g. smoke, regress etc. Each test case can have many tags which allows you creation of different test plans with the same test case based on a tag.
Location of test case's tags in Allure TestOps UI
Test case's tags are living in the section of a test case description called Tags.
Managing tags
We have 2 different scenarios for manual and automated test cases.
Adding tags to a manual test case
- In the Test cases section, select a test case.
- On the Overview tab, go to the test case Tags section and click Edit.
- Enter a new tag or select tags from the drop-down list, and then click Submit.
- The list contains all tags created in the current project.
Adding tags to automated test cases
There are two options for automated test cases:
- You can keep and maintain your tags in your code (strongly recommended).
- You can keep and maintain your tags in Allure TestOps manually (we do not recommend this way).
Tags for automated test cases in the code
For different programming languages and test frameworks this will look a bit different, but the approach is the same: you need to provide a label with the key tag with tag's value to Allure TestOps in your test results. General concept of labels is described here.
Here is Java, JUnit5 example for providing the meta information (including tags) to test results.
@Test
@Microservice("Billing")
@Story("Create new issue")
@Tags({@Tag("web"), @Tag("critical")})
@DisplayName("Creating new issue by authorized user")
public void shouldCreateIssue() {
steps.openIssuesPage(OWNER, REPO);
steps.createIssueWithTitle(ISSUE_TITLE);
steps.shouldSeeIssueWithTitle(ISSUE_TITLE);
}
This code will result in following test result file (something-result.json
) of allure framework:
<SNIP>
"labels": [
{
"name": "tag",
"value": "web"
},
{
"name": "tag",
"value": "critical"
},
{
{
"name": "msrv",
"value": "Billing"
},
{
"name": "story",
"value": "Create new issue"
},
<SNIP>
],
Tags will be processed by Allure TestOps automatically without any additional settings.
Managing tags for automated test cases in Allure TestOps manually
Managing the tags for automated test cases by Allure TestOps means requires additional configuration to be made in the settings of a project.
- Open your project.
- Navigate to Upload section in the settings.
- Click +Create to create upload policy.
- Select parameters for tags:
- Field: tag
- Policy: from_test_case
- Click Submit