0.0.2 • Published 4 years ago
wdio-coverage-reporter v0.0.2
WDIO COVERAGE Reporter
A WebdriverIO plugin. Report results for coverage.
WDIO Version Compatibility
The chart below shows the versions of this reporter and their WDIO compatibility version.
WDIO Json Reporter | WDIO |
---|---|
^0.0.X | v6 |
WDIO v6 Compatibility
Installation
- NPM
npm install wdio-coverage-reporter --save-dev
reporters: [
'dot',
'coverage'
],
Configuration
This plugin is fetching the test coverage information after each test into .nyc_output
.
- The page under test must be instrumented. Check NYC.
- The report must be generated with NYC, after the WDIO run.
An example with instrumented code and static server can be found in test/integration
.
Usually, the framework of your choice has already middleware for serving and instrumenting on the fly.
Example(please add more with PR):
Example:
{
"scripts": {
"test": "npm run-script instrument && npm run-script wdio && nyc report",
"instrument": "nyc instrument ./webapp ./dist --complete-copy --delete",
"wdio": "npx wdio wdio.conf.js",
"cover-report": "nyc report"
},
"nyc": {
"all": true,
"check-coverage": false,
"exclude": [],
"extension": [
"*.js"
],
"reporter": [
"json",
"text",
"lcov"
]
}
}
For more information on WebdriverIO see the homepage.