Page History
...
Creating new Test Step statuses may be done in the Manage Test Step Statuses configuration section of Xray.
Whenever creating/editing a Test Step status, we have to identify the Test status we want this step status to map to.
Note that native Test Step statuses can’t be modified nor deleted.
...
- OK – requirement has been successfully and fully validated; all the Tests associated with the Requirement are PASSED
- NOK – requirement is unsuccessfully validated; at least one Test associated with the Requirement is FAILED
- NOTRUN – requirement has not been validated completely; at least one Test associated with the Requirement is TODO or ABORTED and there are no Tests with status FAILED
- UNKNOWN – requirement is in an unknown state; at least one Test associated with the Requirement is UNKNOWN and there are no Tests with status FAILED
- UNCOVERED – requirement is not covered with tests; the Requirement has no Tests associated to it
...
The status of a given Test Run is an attribute that most of the times is often calculated automatically on automatically based on the respective recorded step statuses. User You can also enforce a specific status for a Test Run, which in turn may implicitly enforce specific step statuses (e.g., setting a Test Run as "FAIL" can set all steps as "FAIL").
This calculation is made by comparing steps together, following these rules:
- if a step status is mapped to a non-final then Test Run status will be "EXECUTING"
- compare all the step statuses, by their order (steps at the bottom of the list will have higher ranking)
- the step status "PASS" has lowest ranking
The order of the steps is indifferent for the purpose of the overall Test Run status value.
Examples
The following table provides some examples given the Test Step Statuses configuration shown above.
- Obtain the test status mapped to each reported test step status; this is important as the actual test step statuses are not directly compared
- Compare all the the previously mapped test statuses together
- if any of these statuses (e.g., "PASS") is in turn mapped to the coverage status "OK", then the other status wins; if both are mapped to "OK" then the highest ranked wins
- if any of these statuses is "FAIL", then the Test Run status will be "FAIL"
- if any of these statuses is in turn mapped to the coverage status "NOK", then the Test Run status will be that one
- if any of theses statuses is final, then wins over non-final ones
- of these statuses, the status with the highest ranking wins
The order of the steps is irrelevant for the purpose of the overall Test Run status value.
Consequences:
- if any test step status is "FAIL" then the calculated status for the Test Run will be "FAIL"
- if any of the test steps "contributes negatively" (i.e., is mapped to a Test status associated with the NOK coverage), then the status of Test Run will correspond to the mapped Test status of that step
- the Test Run will have status "PASS" if all the steps are marked as "PASS"
- the calculated status for the Test Run will only be "EXECUTING" if there is at least one step in "EXECUTING" or "TODO" (or a similar custom test step status) and all other steps are in "PASS" or equivalent (i.e., associated to the "OK" coverage status)
Configuration Example 1
The following table provides some examples given the Test Step Statuses configuration shown above.
Example # | Statuses of the steps/contexts (the order of the steps/contexts is irrelevant) | Calculated value for the status of the Test Run | Why? |
---|---|---|---|
1 |
| PASS | All steps are PASS, thus the joint value is PASS |
2 |
| EXECUTING | At least one step status (i.e. TODO) is mapped to a non-final Test status |
3 |
| FAIL | One of the step statuses (i.e. FAIL) has higher ranking than the other ones |
4 |
| FAIL | Since one of the steps is FAIL, then the run will be marked as FAIL. |
5 |
| FAIL | Since one of the steps is FAIL, then the run will be marked as FAIL. |
6 |
| FAIL | All mapped statuses map to a test status that in turn is associated to "NOK". Since one of them is FAIL, then the run will be marked as FAIL. |
Configuration Example 2
Let's consider the following configuration.
Example # | Statuses of the steps/contexts (the order of the steps/contexts is irrelevant) | Calculated value for the status of the Test Run | Why? |
---|---|---|---|
1 |
| CUSTOM_PASS2 | We can see that both steps contribute in a "positive way" (i.e., they were successful as ultimately they are linked to successful coverage impact). Both statuses mapped to these test step statuses are associated with the "OK" coverage; as CUSTOM_PASS2 has higher ranking than CUSTOM_PASS, the run will be marked as "CUSTOM_PASS2". |
2 |
| CUSTOM_PASS2 | Similary to the previous example. Any status wins the "PASS" status. |
3 |
| CUSTOM_FAIL2 | We can see that both steps contribute in a "negative way" (i.e., they were not successful as ultimately they are linked to unsucessful coverage impact). Both statuses mapped to these test step statuses are associated with the "NOK" coverage; as CUSTOM_FAIL2 has higher ranking than CUSTOM_FAIL, the run will be marked as "CUSTOM_FAIL2" |
Statuses of the steps/contexts
(the order of the steps/contexts is irrelevant)
- PASS
- PASS
- PASS
- PASS
- TODO
- PASS
- PASS
- FAIL
- PASS
- XPASS
- FAIL
- PASS
XPASS has higher ranking than the other ones, thus the overall calculated value is based on the mapping for that Test Step status.
- FAIL
- XPASS
- FAIL
. |
Calculation of the status for a given Test
...
- This takes into account Test Runs in version V (as a result of Test Executions in version V) or Test Runs in Test Plan TP (within Test Executions associated with Test Plan TP)
- If Test Environment is chosen, then only Tests Runs on that Environment (e.g. TE) will be considered
- If "Final statuses have precedence over non-final statuses" is true, then:
- final Test Run statuses will have higher ranking than non-final ones
- only the latest Test Run is taken into account based on its "finished on" date
- If "Final statuses have precedence over non-final statuses" is false, then:
- only the latest Test Run is taken into account based on its "created" date (i.e. the creation date of the related Test ExecutionTest Run entity - this happens when a Test Run is first executed, or when the user navigates into the execution screen)
Calculate the status of some Test, in version V or Test Plan TP, for "All Environments"
- calculate the Test status for each Test Environment, based on all the implicit Test Environments from the relevant Test Executions (i.e. Test Executions in version V or Test Executions associated with Test Plan TP)
- calculate the joint value for the Test status
- PASS has lowest ranking (i.e. for the calculated to be PASS, all calculated statuses must be PASS in the different Test Environments)
- if one is FAIL, then the calculated value will be FAIL
- otherwise, use the ranking of Test statuses
Examples
The following table provides some examples given the Test Statuses configuration shown above in the Managing Test Statuses section.
...
Example # | Statuses of the Test Runs (ordered by time of execution/creation, ascending) | Final statuses have precedence over non-final statuses | Calculated value for the status of the Test | Why? |
---|---|---|---|---|
1a |
| true | PASS | Latest executed Test Run (2) having a final status was PASS. |
1b |
| false | TODO | Latest created Test Run (3) was TODO. |
2a |
| true | XPASSMYPASS2 | Latest executed final Test Runs on each environment were PASS, MYPASS2, and PASS respectively. Since MYPASS2 (32) has a higher ranking then the calculated status will be MYPASS2. |
2b |
| false | XPASSTODO | Latest created Test Runs on each environment were PASS, TODO, and PASS respectively. Since PASS has the lowest ranking, then TODO (3) will "win" and then the calculated status will be TODO |
3 |
| true | TODO | Latest created Test Runs on each environment were PASS, TODO, and PASS respectively. Although Test Environment "env2" has only a non-final Test Run, since there is no other Run for that environment, then it will be considered as the calculated status for that environment. Since PASS has the lowest ranking, then TODO (32) will "win" and then the calculated status will be TODO. |
4 |
| true (or false) | FAIL | Latest executed (or created) final Test Runs on each environment were PASS, FAIL, and PASS respectively. Since the calculated status for one of the environments is FAIL, then the calculated status will be FAIL. |
5 |
| true | MYPASS2 | Latest executed final Test Runs on each environment were PASS, MYPASS2, and MYFAIL respectively. MYPASS2 has a higher ranking than the other ones, thus the overall calculated value will be MYPASS2. |
6 |
| false | MYFAIL | Latest created Test Runs on each environment were PASS, TODO, and MYFAIL respectively. MYFAIL has a higher ranking than the other ones, thus the overall calculated value will be MYFAIL. |
...
- the parent requirement is OK if it is NOK OK per -si se and the sub-requirements are either UNCOVERED or also OK
- the parent requirement is NOK if it is NOK per -si se or if any of the sub-requirements is NOK
- the parent requirement is only UNCOVERED if neither the parent requirement is covered per -si se nor the sub-requirements are covered
...
Info | ||
---|---|---|
| ||
Even if you have sub-requirements, when you have tests that are directly linked to the parent requirement, Xray assumes that you are validating the requirement directly. Thus, it's irrelevant if the sub-requirements are uncovered by tests. |
Examples
The following table provides some examples given the Test Statuses configuration shown above in the Managing Test Statuses section.
...