Test automation typically requires a significant investment. But even with the best intentions and talented engineers on board, things can sometimes go sideways. When you set up an automated test suite without integrating it with Jira, you create a silo. Project managers often lose sight of the status of regression tests or the development of automated tests. That's why it's essential to integrate your automated tests with the tools that manage work. Additionally, if you cannot utilize the results from your automated tests for traceability reporting, it can lead to unnecessary manual testing and a significant amount of wasted effort.
I've been working with teams to manage requirements and tests using Jira and Xray for many years. In this article, I will discuss this aspect of achieving seamless integration with your test automation suite: how to connect your Xray tests to their corresponding automated test implementations. Specifically, I will explore the question of which comes first: the Xray test or the automated test code?
To create an integrated automated testing solution, you need two key components:
By default, the Test Key is the element that links any imported test execution with an Xray test. If the key is not part of the import, there is a fallback:
Reference: Xray documentation
Here is an example of a Pytest test, annotated to link with the Xray test key:
import pytest
@pytest.mark.xray("DXJ-2")
def test_plus_2():
assert True
Alternatively, here is how Xray can link to the coded test via the class name:
The pairing can be established via two flows:
The optimal flow depends on your use case.
Starting with Xray is a great way to easily integrate test implementation work into your work planning in Jira. If your Scrum team has both developers and QA engineers, you'll usually spot the need for new tests during your refinement meetings. Those tests get created as test work items in Jira/Xray. Once the SQA team starts working on the implementation, they'll shift them to 'in progress.' Plus, they'll annotate the test code to connect it with the Xray test.
The status of the Test implementation appears on the Sprint board, just as it does for any other story.
Another situation where it's better to start with creating the Xray test is when you're switching from manual tests to automated ones. In these cases, it helps to have the automated test case in Jira from the moment you decide to automate it. This way, everyone on the team sees what's coming down the pipeline.
The other approach, where you implement the tests first and then create them in Jira afterward, is helpful for migration or onboarding situations. For example, if you have a set of automated tests developed by teams that are onboarding to Jira or Xray. It's good that the import to Xray can automatically generate the Xray tests.
Another situation that works well for the 'first code, then Xray' approach is when the development of the test is part of the story work, like when developers code unit tests.
Many teams are utilizing both approaches. As long as everyone on the team knows which approach to use in each specific instance, there is no problem.
Integrating your automated tests with Xray eliminates silos and reduces unnecessary manual work. It also lays the groundwork for streamlined release documentation.
Rina Nir
CEO at RadBee
RadBee
United Kingdom
7 accepted answers
0 comments