Cypress Latest Version

What is Cypress Test Automation in QA Touch?

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:

Cypress Installation Latest Version Steps

How to Sync Cypress Test Automation Results to QA Touch?


cd /your/project/path/ 

Step 1 :

 $ npm install cypress --save-dev

Step 2 : Configure E2E Testing & Create New Empty Spec (refer below screenshot)

 $ npx cypress open

image image image image image image image

Step 3 : Install Cypress QA Touch Reporter

 $ npm install @kanidjar/cypress-qatouch-reporter

Step 4 :

In the resulting popup, copy the API key and the details and update the value in cypress.config.js file.

image



image

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");
  });
});

image image image

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");
  });
});

image image

image

Execute the Cypress scripts.

Cypress Command

 $ npx cypress run

image

The test result will be synced in the QA Touch’s test run and test case status will be updated. image

image

Command to run a specific test script in Cypress:

 $ npx cypress run --spec path/to/file.spec.js

Launching Browsers:

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