Improve this doc
WDIO Mochawesome Reporter
Generates test results in the json formated needed to create Mochawesome reports.
Installation
1
| npm install --save wdio-mochawesome-reporter
|
A dependency will be added to your package.json
1 2 3 4 5
| { "dependencies": { "wdio-mochawesome-reporter": "^1.0.0" } }
|
Using
Add to the list of reporters.
1 2 3 4 5 6 7 8 9 10 11
| module.exports = { reporters: ['dot', 'mochawesome'], reporterOptions: { outputDir: './', mochawesome_filename: 'myfile.json' },
};
|
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
1
| npm install --save mochawesome-report-generator@2.3.2
|
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
1 2 3
| "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