Gathering detailed insights and metrics for cypress-mochawesome-reporter
Gathering detailed insights and metrics for cypress-mochawesome-reporter
Gathering detailed insights and metrics for cypress-mochawesome-reporter
Gathering detailed insights and metrics for cypress-mochawesome-reporter
cypress-slack-reporter
A slack reporter for mochawesome reports generated by Cypress or other test frameworks using Mocha, for runs generated on CircleCI
mochawesome
A gorgeous reporter for Mocha.js
mochawesome-report-generator
Generates gorgeous HTML reports from mochawesome reporter.
mochawesome-screenshots
A Gorgeous HTML/CSS Reporter for Mocha.js
Zero config Mochawesome reporter for Cypress with screenshots and videos
npm install cypress-mochawesome-reporter
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
164 Stars
124 Commits
51 Forks
3 Watching
4 Branches
12 Contributors
Updated on 26 Nov 2024
JavaScript (100%)
Cumulative downloads
Total Downloads
Last day
-11.2%
57,955
Compared to previous day
Last week
-0.3%
321,980
Compared to previous week
Last month
2.4%
1,386,982
Compared to previous month
Last year
52.2%
14,196,891
Compared to previous year
1
3
Zero config Mochawesome reporter for Cypress with screenshots attached to tests.
reporter version | cypress version | reporter branch |
---|---|---|
v3 | node >= 14 >= 6.7.0 >= 6.2.0 with experimentalRunEvents: true | master |
v2 | >= 6.7.0 >= 6.2.0 with experimentalRunEvents: true | v2 |
v1 | >= 4.0.0 | v1 |
This setup tutorial works with Cypress >= v10, looking for older version setup? here
install cypress-mochawesome-reporter
npm i --save-dev cypress-mochawesome-reporter
or
yarn add -D cypress-mochawesome-reporter
Change cypress reporter & setup hooks
Edit config file (cypress.config.js
by default)
1const { defineConfig } = require('cypress'); 2 3module.exports = defineConfig({ 4 reporter: 'cypress-mochawesome-reporter', 5 e2e: { 6 setupNodeEvents(on, config) { 7 require('cypress-mochawesome-reporter/plugin')(on); 8 }, 9 }, 10});
If you are override before:run
or after:run
hooks, use this:
1const { defineConfig } = require('cypress'); 2const { beforeRunHook, afterRunHook } = require('cypress-mochawesome-reporter/lib'); 3 4module.exports = defineConfig({ 5 reporter: 'cypress-mochawesome-reporter', 6 e2e: { 7 setupNodeEvents(on, config) { 8 on('before:run', async (details) => { 9 console.log('override before:run'); 10 await beforeRunHook(details); 11 }); 12 13 on('after:run', async () => { 14 console.log('override after:run'); 15 await afterRunHook(); 16 }); 17 }, 18 }, 19});
Add to cypress/support/e2e.js
1import 'cypress-mochawesome-reporter/register';
(optional, if your are using cypress-cucumber-preprocessor
) Add to cypress/support/step_definitions/index.js
1import 'cypress-mochawesome-reporter/cucumberSupport';
⚠️
cypress-cucumber-preprocessor
uses the same hooks ascypress-mochawesome-reporter
, you also need to install cypress-on-fix. Full example of usingcypress-mochawesome-reporter
withcypress-cucumber-preprocessor
can be found here.
run cypress
If you want to customize your HTML report with mochawesome-report-generator flags just add the flags you want to reporterOptions
1const { defineConfig } = require('cypress');
2
3module.exports = defineConfig({
4 reporter: 'cypress-mochawesome-reporter',
5 reporterOptions: {
6 charts: true,
7 reportPageTitle: 'custom-title',
8 embeddedScreenshots: true,
9 inlineAssets: true,
10 saveAllAttempts: false,
11 },
12 e2e: {
13 setupNodeEvents(on, config) {
14 require('cypress-mochawesome-reporter/plugin')(on);
15 },
16 },
17});
Additional reporter options:
name | type | default | description |
---|---|---|---|
embeddedScreenshots | boolean | false | Embedded external screenshots into HTML using base64, use with inlineAssets option to produce a single HTML file |
ignoreVideos | boolean | false | Will not copy videos recorded by Cypress nor show them in the mochawesome report. Requires that Cypress config option video is set to true for the option to have any effectBecause mochawesome doesn't support context per spec file, each test will have the whole spec file video. More info can be found here |
videoOnFailOnly | boolean | false | If Videos are recorded and added to the report, setting this to true will add the videos only to tests with failures.Do note that this will NOT cause video's to only record failed tests, just they not be added to passed tests in the mochawesome report |
quiet | boolean | false | Silence console messages |
saveAllAttempts | boolean | true | Save screenshots of all test attempts, set to false to save only the last attempt |
debug | boolean | false | Creates log file with debug data |
saveJson | boolean | false | Keeps the json file used to create html report |
Add extra information to the report manually by using cy.addTestContext()
as seen in the simple-typescript example test 2
cypress-mochawesome-reporter
cypress-multi-reporters
mochawesome-report-generator
flagscypress.json
cypress-mochawesome-reporter
with typescriptcypress-mochawesome-reporter
with cypress-parallel
cypress-mochawesome-reporter
with cypress-cucumber-preprocessor
Run npm i
in root directory then:
cd examples/<example-project>
npm i
npm test
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
packaging workflow detected
Details
Reason
dependency not pinned by hash detected -- score normalized to 8
Details
Reason
SAST tool is not run on all commits -- score normalized to 6
Details
Reason
Found 8/24 approved changesets -- score normalized to 3
Reason
7 existing vulnerabilities detected
Details
Reason
0 commit(s) and 3 issue activity found in the last 90 days -- score normalized to 2
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Score
Last Scanned on 2024-11-25
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More