Defects or the way we implemented it is the one of the coolest things, and here is why.
Defect is an acknowledgement that a failed test is analysed, understood and is being processed. So, the users of the system can focus on analysis of the problems - if there is a defect linked to a failed test, this test becomes Resolved so only tests without resolution need to be analysed and processed by your team.
Let's find out how this is managed in Allure TestOps.
Work with Defects starts in the Launches section in a specific Launch that you've created.
Quick failures analysis
In a Launch you can quickly check the following:
Allure ID of a test with problems.
Affected package and class.
Analysis of a failing test
In Unresolved test results click a failing test to drop deeper into the analysis.
You can also manually locate the failing test.
Generally, the analysis goes as follows.
Jump to Launches.
Jump to the test results tree.
Select test result with a failure in the test results tree.
Check the error message from your test.
Check the full trace if needed.
Check the steps of the test if you implemented steps in your tests.
After the root cause is clear for you, you can Link defect.
Creating a defect
Creation of a defect goes as follows:
Name a defect.
create a name which will ensure everyone in your team understands what is the problem linked to the defect.
Click Create automation rule.
Decide what is the marker that 100% defines the error and create the automation rule using regexp.
either in message or in full trace.
Name the automation rule ensuring everyone will understand what is the marker you are using to create automation rule.
Click View matching results
Check if your regexp is working, i.e. if you see any test results in the modal dialogue, then it is working for you.
Click Back to form to finalise the creation of the defect - finally click on Link defect button.
In your test result you will see that there is defect linked to this test result.
Back to the Launches
Now, if you jump to the launches section you will see the following.
For the defect you've just created, Allure will show Defects: +1 for the launch you've been analysing.
Inside the launch you've been analysing, you will see that there is no more unresolved issues.
You can close the launch.
There are two states of a defect - Open or Closed.
Open means that an error, bug or an event (Selenium cluster is down is not a bug in your software or in your test but an unfortunate event on your infrastructure) still persists..
Closed means that an issue linked to a defect is resolved. If a defect is closed then the automation rule won't be processed and all failed tests with the same error message or trace will be considered as Unresolved again. So you need either to reopen the existing defect or create a new one.
Automatic update of the defect's status
You can link your defect to an issue in your favourite issue tracker and the lifecycle of the defect will be updated accordingly to the status of the linked issue.
Linking can be done when you create a defect or in the Defects section of your project by selecting a defect and clicking Defect actions button.
Go to Defects.
Select a Defect you want to manage.
You can see the list of Launches where this defect appears.
Click Defects actions button.
Select Create issue or Link issue.
Creating new issue from Allure TestOps
You need to have an Issue tracker integrated with Allure TestOps to be able to perform these actions.
Select one of your configured issue trackers with enabled issue creation option.
Fill all the needed fields suggested by Allure TestOps and then click Submit.
Issue will be created on an issue tracker side and link will be added to the defect. The status of the defect will be synced with the resolution status of the issue from an issue tracker.
Linking existing issue to a defect
You need to have at least one Issue tracker integrated with Allure TestOps to be able to perform these actions.
When linking an existing issue you need to specify the issue tracker you are going to use and select an issue from the list of available issues.
After the defect is successfully linked to an issue, its lifecycle will be managed as per the status of the issue you've just linked to the defect.