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

grepFilterSpecs not working with multiple tags #98

Closed
Olavarry opened this issue Dec 21, 2021 · 5 comments · Fixed by #99
Closed

grepFilterSpecs not working with multiple tags #98

Olavarry opened this issue Dec 21, 2021 · 5 comments · Fixed by #99
Labels

Comments

@Olavarry
Copy link

Olavarry commented Dec 21, 2021

I have two specs with different tags:

cypress.env.json file:
{
"skipAccessChecks": false,
"test_env": "prod",
"grepOmitFiltered": true,
"grepFilterSpecs": true
}

test1.spec.js:

describe('Test 1', { tags: '#tag1'}, () => {
expect(true).to.be.true
})

test2.spec.js:

describe('Test2', { tags: '#tag2'}, () => {
expect(true).to.be.true
})

Then I'm trying to run with this command:
npm run cy:test -- --env grepTags='#tag1+#tag2'

This is being printed out when execution starts:

cypress-grep: filtering using tag "#tag1+#tag2"
cypress-grep: will omit filtered tests
cypress-grep: filtering specs using tag "#tag1+#tag2"
Grep "undefined" has eliminated all specs
Will leave all specs to run to filter at run-time

If I remove one of the tags it works fine:

npm run cy:test -- --env grepTags='#tag1'

cypress-grep: filtering using tag "#tag1"
cypress-grep: will omit filtered tests
cypress-grep: filtering specs using tag "#tag1"
@bahmutov
Copy link
Collaborator

bahmutov commented Dec 21, 2021 via email

@Olavarry
Copy link
Author

I have tried both AND and OR and getting the same result

@Olavarry
Copy link
Author

Olavarry commented Dec 21, 2021

I should have given the OR example, as AND will not find any test with both tags, I just wanted to give the 'example',
but OR should filter and run only these 2 specs, right? looks it is not and it throws the message:

cypress-grep: filtering using tag "#tag1 #tag2"
cypress-grep: will omit filtered tests
cypress-grep: filtering specs using tag "#tag1 #tag2"
Grep "undefined" has eliminated all specs
Will leave all specs to run to filter at run-time

@github-actions
Copy link

🎉 This issue has been resolved in version 2.12.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

@Olavarry
Copy link
Author

Thanks for the quick fix, this is a great plugin thanks a lot for your work!

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

Successfully merging a pull request may close this issue.

2 participants