Custom Reporter
You can write your own custom reporter for the WDIO test runner that is tailored to your needs. And it’s easy!
All you need to do is to create a node module that inherits from the @wdio/reporter
package, so it can receive messages from the test.
The basic setup should look like:
import WDIOReporter from '@wdio/reporter'
export default class CustomReporter extends WDIOReporter {
constructor(options) {
/*
* make reporter to write to the output stream by default
*/
options = Object.assign(options, { stdout: true })
super(options)
}
onTestPass(test) {
this.write(`Congratulations! Your test "${test.title}" passed 👏`)
}
}