This is the slack-errors-only reporter plugin for TestCafe.
npm install testcafe-reporter-slack-errors-only
When you run tests from the command line, specify the reporter name by using the --reporter
option:
testcafe chrome 'path/to/test/file.js' --reporter slack-errors-only
When you use API, pass the reporter name to the reporter()
method:
testCafe
.createRunner()
.src('path/to/test/file.js')
.browsers('chrome')
.reporter('slack-errors-only') // <-
.run();
If you are looping over your test fixtures, each test fixture must have a unique name (otherwise error reports will be all grouped together under the same name, making it difficult to attribute the source of the error for each test)
For example:
//test.js
function testFlow(config) {
fixture(`${config.testName}`)
.page `http://example.com`
test('Example', async t => {
await config.testing();
});
}
const testSuite = getTestSuite();
for (const config of testSuite) {
testFlow(config);
}
Eden Adler