← Back to Discord Forum

How to avoid multiple test tags with --grep-invert

I use this command in the cli: npx run test --grep-invert '@first && @second' but I get an error message that no tests were found. How do I fix this error?

This thread is trying to answer question "How do I fix the error of no tests being found when using the --grep-invert command with '@first && @second'?"

12 replies

'@first|@second' probably

it's a regex pattern so && or || don't work as you expect them to work

@skorp32: "|" - it's OR

"|" - it's OR

so you want to skip tests that have both tags? but if test has only one of those tags then it should run?

@skorp32: tests with both tags should not be run

tests with both tags should not be run

dunno then, try chatgpt, this will be a bit complex rgex

my mistake is wrong command ) it's should be: npx playwright test --grep-invert @first && @second

hm, and that works?

interesting! good job then and sorry if I confused with my answers :/

@skorp32: thank you for your help

thank you for your help

answer: npx playwright test --grep-invert "@first|@second"

Related Discord Threads

AboutQuestionsDiscord ForumBrowser ExtensionTagsQA Jobs

Rayrun is a community for QA engineers. I am constantly looking for new ways to add value to people learning Playwright and other browser automation frameworks. If you have feedback, email luc@ray.run.