Skip to content
This repository has been archived by the owner on Mar 29, 2023. It is now read-only.

Filter out to run only 1 test from the rest of the loop #125

Closed
quad5 opened this issue May 2, 2022 · 7 comments
Closed

Filter out to run only 1 test from the rest of the loop #125

quad5 opened this issue May 2, 2022 · 7 comments

Comments

@quad5
Copy link

quad5 commented May 2, 2022

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?

@bahmutov
Copy link
Collaborator

bahmutov commented May 2, 2022 via email

@quad5
Copy link
Author

quad5 commented May 2, 2022

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() {
        ...
    })

})
}

@bahmutov
Copy link
Collaborator

bahmutov commented May 2, 2022 via email

@quad5
Copy link
Author

quad5 commented May 2, 2022

it('test 3', {tags: [SMOKE_TEST]}, function() {}

@mfrma-moura
Copy link

@nthypes

@DPC15038
Copy link

cypress-io/cypress#24451

I also submitted an issue for this. This feels like such a useful case, but it is not supported.

@jordanpowell88
Copy link
Contributor

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants