Learn how to add labels to your tests
Labels are used to associate tests with one or more characteristic without the need to place them in a specific Suite or Test Plan. Tests can have multiple labels. For example, a "sanity" label to tag tests that will run on each code-change, "nightly" label to tag tests that will run in your integration/staging environment after each deploy, and "monitor" label to tag tests that will run each 15 minutes to make sure your production application is working properly.
Labels are great for two main purposes:
- Filter by label - organizing your tests list, and then easily finding them by filtering the list by label.
- Creating test suites by label – you can use the labels to quickly find relevant tests when creating a test suite.
- Creating test plans by label – when configuring a test plan, you can define certain labels will be included in the test plan.
Add/Remove a Label to a Test
You can easily add or remove labels to each test in the test list.
To add/remove labels from a test:
- On the Test List screen, click on the test name to select it.
- Click the Edit Labels button.
You can also right click the test and select the Edit Labels option.
- Select or deselect existing labels to apply to the test.
- To add a new label, type your new label, click the Create New link, and then click Apply.
Label names should not contain any spaces.
Filter Tests by Labels
You can use labels to filter tests in your test list that contain the selected label(s).
To filter the test list by label:
- Navigate to Test List > Tests.
- Click the Advanced Filters button in the action menu.
The Advanced Filters panel will display.
- In the Label section of the panel, select/deselect the labels for the filter and click Apply.
The test list will only display tests that contain the selected labels.
Using labels in CLI-based runs
When running the CLI, you can select which label to run using the --label parameter:
testim --label "<YOUR LABEL>" --token "<YOUR ACCESS TOKEN>" --project "<YOUR PROJECT ID>" --grid "<Your grid name>" --report-file test-results/testim-tests-report.xml
Updated 7 months ago