QA Touch Cypress reporter connects with Cypress, an open-source test automation tool. Fast, easy and reliable testing for anything that runs in a browser. Cypress has been made specifically for developers and QA engineers, to help them get more done.
You can sync your cypress.io automation test results to QA Touch with our handy QA Touch reporter. The steps are below:
cd /your/project/path/
$ npm install cypress --save-dev
$ npx cypress open
$ npm install @kanidjar/cypress-qatouch-reporter
In the resulting popup, copy the API key and the details and update the value in cypress.config.js file.
cypress.config.js
//cypress.config.js
const { defineConfig } = require('cypress')
module.exports = defineConfig({
e2e: {
setupNodeEvents(on, config) {
// implement node event listeners here
},
},
reporter: "./node_modules/@kanidjar/cypress-qatouch-reporter",
reporterOptions: {
"domain" : "your-domain",
"apiToken": "your-token",
"projectKey": "project-key",
"testRunKey": "test-run-key"
},
})
Navigate to cypress/e2e/spec.cy.js and write you test here.
Sample code 1 - with Test Result key
QATouch-YOUR_TESTRESULT_KEY
describe('Sample QATouch Test', () => {
it('[QATouch-YOUR_TESTRESULT_KEY] Verify the logo is clickable', () => {
console.log("Sample code 1 - with Test Result key");
});
});
Note: TESTRESULT_KEY can be found in QA Touch -> Test Result page->Details Tab (refer screenshot)
Example
describe('Sample QATouch Test', () => {
it('[QATouch-MeX9NX] Verify the logo is clickable', () => {
console.log("hello world");
});
});
Sample code 2 - with Test Case key
QATouch-CASEYOUR_CASE_KEY
describe('Sample QATouch Test', () => {
it('[QATouch-CASEYOUR_CASE_KEY] Verify the logo is clickable', () => {
console.log("Sample code 2 - with Test Case key");
});
});
Note: CASE_KEY can be found in QA Touch -> Test Result page->Details Tab (refer screenshot)
Example
describe('Sample QATouch Test', () => {
it('[QATouch-CASEMeX9NX] Verify the logo is clickable', () => {
console.log("Sample code 2 - with Test Case key");
});
});
Execute the Cypress scripts.
Cypress Command
$ npx cypress run
The test result will be synced in the QA Touch’s test run and test case status will be updated.
Command to run a specific test script in Cypress:
$ npx cypress run --spec path/to/file.spec.js
When you wanted to run the tests in your local browser for example in Chrome, you can use the below command:
$ npx cypress run --headed --browser chrome
Firefox
$ npx cypress run --headed --browser firefox