Skip to content

superwesker1988/cypress-mochawesome-reporter

 
 

Repository files navigation

cypress-mochawesome-reporter

npm node

Zero config Mochawesome reporter for Cypress with screenshots

Example report

Mochawesome report with fail test screenshot

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

  "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 your package.json scripts
"cypress:report": "generate-mochawesome-report"
  1. run cypress and then npm run cypress:report

CLI (generate-mochawesome-report) flags

Flag Type Default Description
--jsonDir string [cwd]/cypress/results/json Cypress results json folder, should be the same as reportDir in cypress.json
--reportDir string [cwd]/cypress/screenshots Cypress screenshots directory
-o, --output string [cwd]/cypress/reports/html Path to save report

Exmaples

  1. Simple use of cypress-mochawesome-reporter
  2. Using cypress-multi-reporters
cd examples/<example-project>

npm i
npm run serve
npm run cypress:run
npm run cypress:report

About

Zero config Mochawesome reporter for Cypress with screenshots

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%