Plugin to generate wct reporters
$ npm install wct-test-reporter
//wct.conf.js
module.exports = {
plugins: {
...
"test-reporter": {
reporter: "json",
output: "test_result.json"
}
...
}
};
-
JSON Reporter (
reporter: 'json'
) options types:output: console
Write results to console in json formatoutput: '<filename>'
Write results to in json format -
Customized Reporter (
reporter: '<filename>'
) use a customized reporter defined at
Defining a custom reporter
let TestReporter = require('wct-test-reporter').TestReporter;
class CustomReporter extends TestReporter {
constructor(options) {
super(options);
}
onStart(context) {
}
onEnd(error) {
}
onBrowserStart(browser, sharedState, stats) {
}
onBrowserEnd(browser, sharedState, stats) {
}
onSuiteStart(browser, sharedState, stats) {
}
onSuiteEnd(browser, sharedState, stats) {
}
onTestStart(browser, testInfo, stats) {
}
onTestEnd(browser, testInfo, stats) {
}
}
module.exports = CustomReporter;