Is it possible to run some tests in quarantine mode and run others without the mode? For example, we have some lightweight tests and we don't need 3 tries for them, but for others it can be necessary
Asked
Active
Viewed 559 times
3
1 Answers
4
You can run two testcafe runners in series with different filters. One of them may be with the quarantine mode.
For example:
const createTestCafe = require('testcafe');
let testcafe = null;
const runTests = (testFiles, quarantineMode, testPrefix) => {
const runner = testcafe.createRunner();
return runner
.src(testFiles)
.filter((testName) => testName.startsWith(testPrefix))
.browsers(['chrome'])
.run({ quarantineMode });
};
createTestCafe('localhost', 1337, 1338)
.then(tc => {
testcafe = tc;
return runTests(['test.js'], false, 'Simple')
.then(() => runTests(['test.js'], true, 'Complex'));
})
.then(() => testcafe.close());
tests:
test('Simple Test', async t => {
//...
});
test('Complex Test', async t => {
//...
});

Dmitry Ostashev
- 2,305
- 1
- 5
- 21