I'm actually trying to use a test-runner file to figure out all my configs from this file. I'm using tests for Smoke and Regression scripts. So, i want my tests to run based on Smoke or Functional test metadata that i choose from the tet runner file. The filter works when i give in package.json file. But it is not working in test runner file using runner.filter
Kindly, help if someone knows the reason.
Below is the snippet from Test.js file,
test.meta('smokeTest','true)('Testing application as admin', async t=> {
await t.click(elements.submitButton);
})
Whereas the test-runner file is,
const createTestCafe = require('testcafe');
try {
const runner = testcafe.createRunner();
const failedCount = await runner
.src('./tests/fixture1.js')
.filter(testMeta => {return testMeta.smokeTest === 'true';})
.browsers('chrome')
.run();
console.log('Tests failed: ' + failedCount);
}
finally {
await testcafe.close();
}
The filter works when we run it from command line like,
testcafe chrome ./tests/fixture1.js --test-meta smokeTest=true
When I used the test-runner file, it says the filter settings has excluded all the tests, try to modify the settings