A WebdriverIO reporter plugin to generate test result with custom event in json format to display in html page as test coverage information.
Simply install npm or yarn:
npm install --save wdio-test-coverage-reporter
yarn add wdio-test-coverage-reporter
package.json
will be updated as:
{
"dependencies": {
"wdio-test-coverage-reporter": "^1.0.0"
}
}
It is recommended to install package as devDependencies.
Add 'test-coverage'
to the reporters array in your wdio config file.
// sample wdio.conf.js
module.exports = {
// ...
reporters: ['dot', 'test-coverage'],
// ...
};
To use test coverage reporter, please add following option the wdio.conf.js
// sample wdio.conf.js
module.exports = {
// ...
reporters: ['dot', 'test-coverage'],
reporterOptions: {
'test-coverage':{
outputDir: './reports'
}
},
// ...
};