Make grepFilterSpecs work when specPattern has been set in the config
See original GitHub issueThe grepFilterSpecs only appears to work correctly if the specPattern value is the default value. If the value is changed, by setting it within the config, the grepFilterSpecs no longer works.
example of config:
const { defineConfig } = require('cypress');
module.exports = defineConfig({
e2e: {
setupNodeEvents(on, config) {
require('cypress-grep/src/plugin')(config);
return config;
},
baseUrl: 'http://localhost:802/',
specPattern: 'tests/cypress/e2e/**',
supportFile: 'tests/cypress/support/e2e.js',
env: {
grepFilterSpecs: true,
grepOmitFiltered: true,
},
},
});
With specPattern in config: Specs: 54 found
Without specPattern in config: Specs: 17 found
Issue Analytics
- State:
- Created a year ago
- Reactions:3
- Comments:19 (1 by maintainers)
Top Results From Across the Web
Configuration - Cypress Documentation
This helps you to understand and see where different values came from. Each set value is highlighted to show where the value has...
Read more >@cypress/grep - npm
Cypress tests can have their own test config object, and when using this plugin you can put the test tags there, either as...
Read more >Cucumber tags are not working after Cypress ... - Stack Overflow
Specs containing no matching scenarios are automatically filtered, provided that filterSpecs is set to true. So, if I run npx cypress run --env ......
Read more >Cypress v10 - What's new?
In v10, the default spec folder has been changed from: ... The specPattern option is a new testing-type specific configuration option that ...
Read more >AUTOMATE your TESTS NOW with CYPRESS 10+ ... - YouTube
What's new with Cypress 10+ & Cucumber? Repo: https://github.com/JoanEsquivel/cypress-cucumber-boilerplate#cypress #testing #automation ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
To speed up solving this issue a small repo showing the problem is 200x useful
Yeah good point @s4ms00n9,
grepIntegrationFolder
is a bit of an artefact from when I was doing the upgrade to work with10.0.0
, I initially wrote it to be backward compatible with9.0.0
, but I was persuaded to make it a breaking change to gently push people to upgrade. I think that’s why I forgot to add any info to the README about it 🤦♂️For this issue going forward, I think
grepIntegrationFolder
should probably be renamed to something likerelativeConfigFileToIntegrationFolderPath
(or usepath
to resolve two paths for us), and I should add something to the docs for it. @jablesyeah does setting it to be the relative path for your setup work? (not as a solution, but to validate that we’re on the right track)In addition, I’ve just seen this: cypress-io/cypress-grep#153, so we should probably move this issue to the main Cypress repo, as
cypress-grep
excitingly now lives here: https://github.com/cypress-io/cypress/tree/develop/npm/grep