- Notifications
You must be signed in to change notification settings - Fork3
Ebazhanov/cypress-mochawesome-html-report-example
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
This is the simple example for integrating Cypress with Mochawesome library to generate HTML and JSON report.
Install
$ yarn add mochawesome --dev
$ yarn add mochawesome-merge@2.1.0 --dev
$ yarn add mochawesome-report-generator --dev
Add the following code inside yourcypress.json
{"reporter":"mochawesome","reporterOptions": {"reportDir":"cypress/results","overwrite":false,"html":false,"json":true } }
$ yarn start & cypress run --headless --browser chrome
$ npx mochawesome-merge --reportDir cypress/results > cypress/merged-report.json
$ npx marge cypress/merged-report.json -o cypress/mochawesome-html-report
Find your HTML report in the.../cypress/mochawesome-html-report/merged-report.html
Add this configuration into yourconfig.yml file
version:2.1orbs:cypress:cypress-io/cypress@1.26.0workflows:build:jobs: -cypress/run:install-command:yarn install --frozen-lockfilestart:yarn startwait-on:'http://localhost:3000'post-steps: -run:name:Create merged-report Directorycommand:mkdir cypress/merged-report/ -run:name:Merge mochawesome jsons in one filewhen:alwayscommand:npx mochawesome-merge --reportDir cypress/results > cypress/merged-report/merged-report.json -run:name:Generate mochawesome html reportwhen:alwayscommand:npx marge cypress/merged-report/merged-report.json -o cypress/mochawesome-html-report -store_artifacts:name:Uploading mochawesome-merged-report.jsonpath:cypress/merged-report -store_artifacts:name:Uploading mochawesome-html-reportpath:cypress/mochawesome-html-report
- find the way to attach screenshots & video on failure
P.S. if you want to try something else look atAllure 2
reporthere
About
A simple example of the integration Cypress with Mochawesome library to generate HTML and JSON report after tests run.
Topics
Resources
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Releases
No releases published
Packages0
No packages published