Back to QMetry All Products Help Page
How to integrate Cypress results with QTM4J?
This article is intended for users who want to integrate Cypress results with QTM4J. QMetry supports import for the following framework files that are JUnit, TestNG, QAF, Cucumber, and Specflow out of the box. Cypress can generate the test results file in JUnit format after the automation project execution which can be further imported to QTM4J. Using the mocha-junit-reporter package of Cypress the test result files are generated in JUnit/XML format.
Note: Any inquiries/issues related to the mentioned documentation are out of QMetry Support’s scope, users can directly reach out to Cypress support for such queries.
For Cypress versions above v9.x:
You can follow the below steps to generate the result files in JUnit/XML:
Download the required
npm
packages.npm install cypress-mochawesome-reporter junit-report-merger mocha-junit-reporter cypress-multi-reporters mocha
Configure Reporters in the
cypress.config.js
fileNavigate to Project Root Folder > open
cypress.config.js
Append the below code within the module.exports object:
reporter: 'junit', reporterOptions: { mochaFile: 'results/my-test-output-[hash].xml', },
Run your test
Run your test with
cypress run --reporter junit \--reporter-options "mochaFile=results/my-test-output-[hash].xml"
This will execute all the spec.js files and generate the test results inside Project Root Folder/results.
For Cypress v9.x and below:
Below are the helpful resources used to generate test result files in JUNIT/XML:
Resources:
Test Result Import:
Once the test result files are generated in JUnit/XML format refer to the below links to import them into QMetry for Jira.
For any queries regarding the import of JUnit test results to QTM4J, reach out to QMetry support.
Back to QMetry All Products Help Page