Tried to execute the Smoke/Regression tests using the runner method. But need to pass the Smoke and Regression in "node testrunner.ts" command line. Refer the below code:
const createTestCafe = require('testcafe');
var argv = require('minimist')(process.argv.slice(2));
let suite = argv.suite;
const browser = argv.browser;
let testcafe = null;
let runner = null;
createTestCafe('localhost', 1337, 1338)
.then(tc => {
testcafe = tc;
runner = testcafe.createRunner();
return runner
.browsers(['chrome --window-size=1440,900'])
.filter((testName, fixtureName, fixturePath, testMeta, fixtureMeta) => {
suite = {
smoke: fixtureMeta.Smoke === 'true',
regression: fixtureMeta.Regression === 'true',
};
return suite;
})
.reporter('list')
.run();
})
.then(failedCount => {
console.log('Tests failed: ' + failedCount);
testcafe.close();
})
Executed the above code using node testrunner.ts --suite=regression
But it executes all the test from the package including the smoke testcases. Please let me know how to execute the testcases with respective suite name when pass from the command line.