Skip to content

snoblenet/wdio-mochawesome-reporter

 
 

Repository files navigation

WDIO Mochawesome Reporter

Build Status NPM version npm

Generates test results in the json formated needed to create Mochawesome reports.

Installation

npm install --save wdio-mochawesome-reporter

A dependency will be added to your package.json

{
  "dependencies": {
    "wdio-mochawesome-reporter": "^1.0.0"
  }
}

Using

Add mochawesome to the reporters array in your wdio config file.

// sample wdio.conf.js
module.exports = {
  // ...
  reporters: ['dot', 'mochawesome'],
  // ...
};

Reporter Configurations

The following configuration options are supported:

option description
includeScreenshots All screenshots captured during test execution will be embedded in the report

To use a configuration option add a mochawesomeOpts section to your wdio config. Then add any options.

// sample wdio.conf.js
module.exports = {
  // ...
  reporters: ['dot', 'mochawesome'],
  mochawesomeOpts: {
      includeScreenshots:true
  },
  // ...
};

Mochawesome Report Generator

To convert the json generated by this package into a Mochawesome report you will need to use the Mochawesome Report Generator.

In summary...

  • Add the package to your project
npm install --save [email protected]

NOTE wdio-mochawesome-reporter is NOT compatible with the 3.x versions of the mochawesome-report-generator

  • Add a script to your package.json to generate the report
  "scripts": {
    "generateMochawesome":"marge path/to/results.json --reportTitle 'My Project Results'"
  },
  1. path/to/results.json = path and name of json file
  2. `--reportTitle 'My Project Results' = unique report title

About

A WebdriverIO plugin. Report in the Mochawesome format

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%