cypress
cypress copied to clipboard
@cypress/grep runs every test
Current behavior
@cypress/grep runs every test
Desired behavior
@cypress/grep runs specific test
Test code to reproduce
All configuration in commit - https://github.com/andreynav/conduit-cypress/commit/640bb80b28ae27d6c6bc49432db631169f233759
...
setupNodeEvents(on, config) {
require('@cypress/grep/src/plugin')(on, config)
return config
},
...
Note 1: official documentation
setupNodeEvents(on, config) {
require('@cypress/grep/src/plugin')(config);
return config;
},
has an error - require('@cypress/grep/src/plugin')(config);
- need pass 2 params (on, config) instead of 1. Only 1 param lead to error.
// package.json
"cy-smoke-chrome": "npx cypress run --headed --browser chrome --env grepTags=@smoke,grepFilterSpecs=true",
// cypress/e2e/tests/ui/signup.js
it('should register a new user', { tags: '@smoke' },() => {
signup.openSignupPage()
signup.registerUser(name, email, password)
})
Actual result: When run the command all tests are fired
Note 2: there is nothing tell in official documentation, but in some issue discussion tell that need added the next rows in /support/e2e.js file
import cypressGrep from '@cypress/grep'
cypressGrep()
I added these rows as well but it doesn't help
Cypress Version
12.16.0
Node version
18.16.1
Operating System
macOS Monterey 12.4
Debug Logs
No response
Other
No response
I have the same problem. I use "grepFilterSpecs: true" but it finds all tests instead of one
I am having same issue, Cypress-grep does not filter tests before run
Has anyone come up with any solutions ?
This was working fine with the previous version (cypress-grep). Does someone have a fix or a workaround for this issue?
Same issue here!
any update or fix on this issue?
Adding the following in the config, env field did the trick for me.
grepIntegrationFolder: "../"
Generally I pointed the grepIntegrationFolder to the level that points to the cypress
folder.
| - cypress
| - ...
| - ...
Did anyone find solution or any workaround for this?
I am also still searching for solution on this
In your scenario @andreynav that line is definitely incorrect:
require('@cypress/grep/src/plugin')(on, config)
It should be require('@cypress/grep/src/plugin')(on, config)
instead.
I have a problem where it filters spec file but not single tests within the spec file, so it ends up running all test cases in the file that has at least one tag that I filter for :( I was playing around with the config and passing on
and config
at once breaks everything.