Zero config Mochawesome reporter for Cypress with screenshots
- install cypress-mochawesome-reporter
npm i --save-dev cypress-mochawesome-reporter
or
yarn add -D cypress-mochawesome-reporter
- Change cypress reporter
config file
"reporter": "cypress-mochawesome-reporter"
or command line
--reporter cypress-mochawesome-reporter
- Add to
cypress/support/index.js
import 'cypress-mochawesome-reporter/register';
- add to your package.json scripts
"cypress:report": "generate-mochawesome-report"
- run cypress and then
npm run cypress:report
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 |
cd examples/<example-project>
npm i
npm run serve
npm run cypress:run
npm run cypress:report