All Projects → LironEr → cypress-mochawesome-reporter

LironEr / cypress-mochawesome-reporter

Licence: MIT License
Zero config Mochawesome reporter for Cypress with screenshots

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to cypress-mochawesome-reporter

cypress-slack-reporter
A home for various Cypress Plugins
Stars: ✭ 126 (+162.5%)
Mutual labels:  mocha, cypress, mochawesome
cypress-upload-file-post-form
Solution for two Cypress testing use-cases I came across with: perform a direct http FORM request to the server containing a file and other parameters and upload a file into a form before submission
Stars: ✭ 59 (+22.92%)
Mutual labels:  cypress, cypress-io
cypress-example-docker-compose
Example running Cypress tests against Apache server via docker-compose
Stars: ✭ 106 (+120.83%)
Mutual labels:  cypress, cypress-io
cypress-test-tiny
Tiny Cypress E2E test case
Stars: ✭ 48 (+0%)
Mutual labels:  cypress, cypress-io
cypress-example-docker-circle-workflows
Cypress + Docker + CircleCI Workflows = ❤️
Stars: ✭ 29 (-39.58%)
Mutual labels:  cypress, cypress-io
TLE5012-Magnetic-Angle-Sensor
This repository includes an library for Arduino for the TLE5012 Magnetic Angle Sensor with SSC interface.
Stars: ✭ 37 (-22.92%)
Mutual labels:  cypress, cypress-io
eslint-config-adjunct
A reasonable collection of plugins to use alongside your main esLint configuration
Stars: ✭ 39 (-18.75%)
Mutual labels:  mocha, cypress
cypress-xpath
Adds XPath command to Cypress test runner
Stars: ✭ 145 (+202.08%)
Mutual labels:  cypress, cypress-io
instrument-cra
Little module for CRA applications to instrument code without ejecting react-scripts
Stars: ✭ 61 (+27.08%)
Mutual labels:  cypress, cypress-io
cypress-watch-and-reload
Reloads Cypress when one of the watched files changes
Stars: ✭ 46 (-4.17%)
Mutual labels:  cypress, cypress-io
cypress-example-circleci-orb
Demo of using the Cypress CircleCI Orb
Stars: ✭ 26 (-45.83%)
Mutual labels:  cypress, cypress-io
cypress-retry
Retry just the failed Cypress.io tests using Cypress module API and AST rewriting
Stars: ✭ 16 (-66.67%)
Mutual labels:  cypress, cypress-io
snapshot
Adds value / object / DOM element snapshot testing support to Cypress test runner
Stars: ✭ 114 (+137.5%)
Mutual labels:  cypress, cypress-io
cypress-circleci-reporter
Cypress test reporter for CircleCI
Stars: ✭ 37 (-22.92%)
Mutual labels:  reporter, cypress
cypress-hyperapp-unit-test
Unit test Hyperapp components using Cypress
Stars: ✭ 26 (-45.83%)
Mutual labels:  cypress, cypress-io
cypress-browserify-preprocessor
Cypress preprocessor for bundling JavaScript via browserify
Stars: ✭ 23 (-52.08%)
Mutual labels:  cypress, cypress-io
cypress-angular-unit-test
Trying to load and bootstrap Angular component dynamically inside Cypress
Stars: ✭ 146 (+204.17%)
Mutual labels:  cypress, cypress-io
svelte-pwa-now
A PWA ready Svelte v3.0 starter template with Tailwind, Now integration and optional Typescript suppot
Stars: ✭ 138 (+187.5%)
Mutual labels:  cypress, cypress-io
cypress-get-it
Get elements by data attribute by creating a Cy command on the fly
Stars: ✭ 23 (-52.08%)
Mutual labels:  cypress, cypress-io
cypress-angularjs-unit-test
Unit test Angularjs code using Cypress.io test runner
Stars: ✭ 23 (-52.08%)
Mutual labels:  cypress, cypress-io

cypress-mochawesome-reporter

npm node npm npm

Zero config Mochawesome reporter for Cypress with screenshots attached to tests.

Example report

Mochawesome report with fail test screenshot

Cypress compatibility

reporter version cypress version reporter branch
v2 >= 6.7.0
>= 6.2.0 with experimentalRunEvents: true
master
v1 >= 4.0.0 v1

migration guide from v1 to v2

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);
};

or (cypress-mochawesome-reporter >= 2.2.0)

const { beforeRunHook, afterRunHook } = require('cypress-mochawesome-reporter/lib');

module.exports = (on) => {
  on('before:run', async (details) => {
    console.log('override before:run');
    await beforeRunHook(details);
  });

  on('after:run', async () => {
    console.log('override after:run');
    await afterRunHook();
  });
};
  1. run cypress

Custom options

If you want to customize your HTML report with mochawesome-report-generator flags just add the flags you want to reporterOptions

{
  "reporter": "cypress-mochawesome-reporter",
  "reporterOptions": {
    "reportDir": "cypress/report",
    "charts": true,
    "reportPageTitle": "custom-title"
  }
}

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
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

Examples

  1. Simple use of cypress-mochawesome-reporter
  2. Using cypress-multi-reporters
  3. With mochawesome-report-generator flags
  4. Change default screenshots folder in cypress.json
cd examples/<example-project>

npm i
npm test
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].