question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Make grepFilterSpecs work when specPattern has been set in the config

See original GitHub issue

The 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:open
  • Created a year ago
  • Reactions:3
  • Comments:19 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
bahmutovcommented, Jul 11, 2022

To speed up solving this issue a small repo showing the problem is 200x useful

0reactions
joshuajtwardcommented, Oct 5, 2022

Yeah good point @s4ms00n9, grepIntegrationFolder is a bit of an artefact from when I was doing the upgrade to work with 10.0.0, I initially wrote it to be backward compatible with 9.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 like relativeConfigFileToIntegrationFolderPath (or use path 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

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found