Closed darioprinc closed 2 years ago
Can you paste the full plugins file? Do you return the config file? https://github.com/cypress-io/cypress-grep#plugin-file
// cypress/plugins/index.js
module.exports = (on, config) => {
// optional: register cypress-grep plugin code
// https://github.com/cypress-io/cypress-grep
require('cypress-grep/src/plugin')(config)
// make sure to return the config object
// as it might have been modified by the plugin
return config
}
Sure:
import { prepareTags } from '../support/grepTags/prepareTags';
module.exports = async (on, config) => {
require('cypress-grep/src/plugin')(config);
const location = config.env.location || 'develop';
config.env = require(`../config/${location}.json`);
config.retries = config.env.retries;
config.baseUrl = config.env.baseUrl;
// runs only in CI
if (process.env.CI_MERGE_REQUEST_DIFF_BASE_SHA && process.env.CI_COMMIT_SHA) {
config.env.grepTags = await prepareTags(); // this returns a string, e.g. '@react @smoke'
config.env.grepFilterSpecs = true;
config.env.grepOmitFiltered = true;
}
return config;
};
Facing same issue , filtering using tag “smoke” filtering specs using tag “smoke” Couldn’t determine file
cypress run grepTags=smoke is working fine runs only smoke test but moves other tests to Pending
cypress run grepTags=smoke,grepFilterSpecs=true - this is not working. Couldn’t determine test names in file
not sure what am missing here
Please look at the debugging section of the readme
Sent from my iPhone
On Nov 11, 2021, at 07:29, Gayathri-Kesavakannan @.***> wrote:
Facing same issue , filtering using tag “smoke” filtering specs using tag “smoke” Couldn’t determine file
cypress run grepTags=smoke is working fine runs only smoke test but moves other tests to Pending
cypress run grepTags=smoke,grepFilterSpecs=true - this is not working. Couldn’t determine test names in file
not sure what am missing here
— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.
Yep, everything in place:
The tests run by tag but the rest is still skipped:
Can you. show the debug output in the browser? https://github.com/cypress-io/cypress-grep#debugging-in-the-browser
Can't see the options there:
Can you check the plugin version you are using? https://github.com/cypress-io/cypress-grep#debugging
well, version upgrade solved it. thanks a lot!
I'm having a similar issue where it IS running my tagged tests, but the omitFiltered=true flag isn't being picked up for some reason.
did you follow the steps above? register in plugins, upgrade package to the latest version etc? you got the flag name right - grepOmitFiltered ?
Yep, I think I got it working after a day of trial and error.
grepOmitFiltered doesn't work. I've checked all possible solutions above: registered in plugins, installed the latest version (2.13.1), checked the flag names.
Hi, I am struggling to run the grepFilterSpecs and grepOmitFiltered options.
Can't get it to work, not in CI, but mainly not even locally.
or
or
What is interesting - the configurations above will correctly run only tests with a @smoke tag, but the grepFilterSpecs and grepOmitFiltered are not taken into account. The output still shows pending tests both in run mode and in GUI:
Expected: Tests without the @smoke tag should not be skipped (pending) but ommited.
The plugin is registered in plugins/index.js
require('cypress-grep/src/plugin')(config);
Cypress v. 8.7.0Any hint will be appreciated.
Cheers, Dario