I want to implement traceability for automated Cypress tests. This means that I need a reference to the tested requirement in an automated test and also in the test result.
Traceability in my case is: Requirement is linked to Test Case is linked to Test Result
For example I have the following requirement:
Requirement: 1234
Description: Implement functionality for sorting the table
Acceptance criteria:
- table can be sorted in ascending order
- table can be sorted in descending order
and the automated Cypress test like:
describe('Table sort', () => {
it('should be sorted in ascending order', () => { ... });
it('should be sorted in descending order', () => { ... });
});
Is there a way to provide the list of the requirement IDs to the automated tests? Something like the following:
describe('Table sort', () => {
it('should be sorted in ascending order', id[1234], () => { ... });
it('should be sorted in descending order', id[1234,3569], () => { ... });
});
where 1234 and 3569 are the ID of some requirements.
Suppose there is a way to pass the requirement IDs to the tests.
What must then be done to enrich the unit test result with this information? Like the following:
<?xml version="1.0" encoding="utf-8"?>
<testsuites>
<testsuite name="Table sort" errors="0" failures="0" skipped="0" tests="2">
<testcase name="Table sort should be sorted in ascending order" classname="should be sorted in ascending order">
<properties>
<requirementids>1234</requirementids>
</properties>
</testcase>
<testcase name="Table sort should be sorted in descending order" classname="should be sorted in descending order">
<properties>
<requirementids>1234,3569</requirementids>
</properties>
</testcase>
</testsuite>
</testsuites>
Google research was not successful for me and I expect a tip for the implementation of traceability for Cypress tests.
goga is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.