Generate Cypress MochAwesome Reporter

   

Cypress compatibility:

node >= 14
Cypress >= 6.7.0

Setup:

  1. install cypress-mochawesome-reporter:
npm i --save-dev cypress-mochawesome-reporter

or

yarn add -D cypress-mochawesome-reporter
  1. Change cypress reporter:

config file (cypress.json by default)

  "reporter": "cypress-mochawesome-reporter"

or command line

--reporter cypress-mochawesome-reporter
  1. Add to cypress/support/index.js:
import 'cypress-mochawesome-reporter/register';
  1. Add to cypress/plugins/index.js:
module.exports = (on, config) => {
  require('cypress-mochawesome-reporter/plugin')(on);
};

5. Run test cases or project: 

npx cypress run --browser chrome


Source: https://github.com/LironEr/cypress-mochawesome-reporter

Share the Knowledge

You May Also Like

About the Author: codenbox

Leave a Reply

Your email address will not be published. Required fields are marked *