Defects
Defects is an Allure TestOps feature that allows you to mark test failures as known (Resolved), which can help you filter them and focus on test failures that you have not encountered yet.x
The basic flow of working with defects is this:
- You receive one or more test failures.
- You perform the triaging, i.e. you analyze the failures to understand the root cause of the problem.
- You create a defect describing the problem. That defect can include one or more automation rules to mark all current and future test failures that match them as resolved.
- After the problem is fixed, you close the defect.
Defects can also be linked to issues in an issue tracker such as Jira or YouTrack if the appropriate integration is enabled in your project.
Creating a defect
Defects can be created using the Defects section (Defects → New defect), but the more convenient and common approach is to create a defect right from a failed test result.
Go to the Launches section.
Click on a launch that has unresolved test failures.
- For end users' convenience all the failed test results without resolution are grouped in Unresolved test results area of a launch overview tab.
- In the test results tree, failed test results that haven't been triaged and processed (Resolved) can be filtered out by Without resolution filter.
Select one of the results under Unresolved test results.
Click the Link defect button in the bottom right corner.
In the resulting window, enter a name for the new defect and click Create. You can also select one of the existing defects instead if you have created them before.
After that, you can add an automation rule to link all similar test failures to this defect, marking them as resolved as well (see below). You can also link the defect to a new or existing issue (see Linking defects to issues).
Adding an automation rule
Automation rules allow you to mark all test failures related to the defect as resolved. Each automation rule is a set of one or two regular expressions that are used to match an error message, a stack trace, or both.
For example, if your Selenium cluster is down and you are getting a lot of error messages containing the string "Element not found" followed by "class='something'", you can use a regular expression like this to match them:
Element not found \{By.xpath: //a.+\}
You can click on View matched results to preview the test results that will be linked to the defect.
After creating the defect, you can check the list of test failures that are linked to it by going to the Defects section and selecting the created defect. To add new automation rules to the defect or change the current rules, click the icons under Automation rules.
Closing a defect
Defects can have two statuses: Open and Closed.
When you create a defect, its status is set to Open. This means that the automation rules of that defect are active and all test failures that match the rules will be automatically marked as resolved.
If the problem has been fixed and you no longer expect to receive test failures related to the defect, you can close the defect. If a defect is closed, its automation rules are disabled and will not be used to resolve test failures.
To close a defect:
- Go to the Defects section.
- Select the defect you want to close.
- Click
⋮
on the right and select Close.
After you have closed the defect, it can be reopened by clicking ⋮
and selecting Reopen.
Linking defects to issues
In order to be able to link defects to issues, you first need to set up an integration with the required issue tracker. You can find instructions for supported issue trackers in the table of contents on the left (under Integrations → Issue trackers).
Once you've enabled an issue tracker integration for your project, you can link a defect to an existing issue or create a new issue right from Allure TestOps. This can be done both when creating a defect and later on.
- Go to the Defects section.
- Select the defect you want to link to an issue.
- Click
⋮
on the right and select Link issue. - Select the issue tracker.
- Select the issue.
- Click Link issue.
- Go to the Defects section.
- Select the defect you want to link to an issue.
- Click
⋮
on the right and select Create issue. - Select the issue tracker.
- Fill in the required fields, depending on the selected issue tracker.
- Click Submit.
Some integrations, such as Jira, allow you to automatically close the defect when you close the linked issue in the issue tracker. You can read more about that here.
Defect's life cycle sync with linked issue
Allure TestOps implements web-hook feature that allows synchronisation defect's status with the status of an issue linked to this defect on issue tracker side, i.e. if an issue gets closed, then linked defect gets automatically closed as well.
This feature is available for Jira DC (server) and Jira Cloud integrations.