cypress-grep
cypress-grep copied to clipboard
Filter out to run only 1 test from the rest of the loop
We have a suite (describe) consists of a few tests (it). On top of that suite, we have a for loop to iterate through that suite.
We are using cypress-grep to filter out a handful of tests for smoke test or acceptance test run. Is it possible to filter out or run only 1 test in said loop?
Can you provide an example spec showing what you run and how you write your spec?
Sent from my iPhone
On May 2, 2022, at 17:46, quad5 @.***> wrote:
We have a suite (describe) consists of a few tests (it). On top of that suite, we have a for loop to iterate through that suite.
We are using cypress-grep to filter out a handful of tests for smoke test or acceptance test run. Is it possible to filter out or run only 1 test in said loop?
— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you are subscribed to this thread.
npx cypress run --config-file cypress/configs/desktopView.json --browser chrome --env grepTags=smoke,grepFilterSpecs=true,grepOmitFiltered=true
for (const [key, value] of Object.entries(allUserTypes)) { describe(
xyz, function() {
before(function() {
value().then(function(param) {
somefunction()
})
})
it('test 1', function() {
...
})
it('test 2', function() {
...
})
it('test 3', {tags: [SMOKE_TEST]}, function() {
...
})
it('test 4', function() {
...
})
it('test 5', function() {
...
})
}) }
And which test you want to run?
Sent from my iPhone
On May 2, 2022, at 17:59, quad5 @.***> wrote:
for (const [key, value] of Object.entries(allUserTypes)) { describe(xyz, function() {
before(function() { value().then(function(param) { somefunction() }) }) it('test 1', function() { ... }) it('test 2', function() { ... }) it('test 3', {tags: [SMOKE_TEST]}, function() { ... }) it('test 4', function() { ... }) it('test 5', function() { ... })}) }
— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.
it('test 3', {tags: [SMOKE_TEST]}, function() {}
@nthypes
https://github.com/cypress-io/cypress/issues/24451
I also submitted an issue for this. This feels like such a useful case, but it is not supported.
We are in the process of deprecating this repo as this package has been republished under @cypress/grep and has moved to https://github.com/cypress-io/cypress/tree/develop/npm/grep. I'm going to go ahead and close this issue as it appears stale. If this is still an issue, please open a new issue here