Featured Partner
Need help with your Playwright automation? - Howdy QA offers expert consultancy for migrations, CI/CD setup, training, and accessibility testing. Led by Playwright Ambassador Butch Mayhew.

How can I run multiple groups of tags with Playwright Test Runner?

If you are using Playwright Test there is this sweet sweet option to tag the tests you are writing with a single or multiple tags. The challenge may come with you have multiple tags you would like to run together.

Let's say you have @tag1, @tag2, and @tag3 and you want to run all the @tag1 and @tag2 tests grouped together.

# This will run @tag1
$ npx playwright test --grep @tag1

# This will run @tag2
$ npx playwright test --grep @tag2

# This will run @tag1 and @tag2
$ npx playwright test --grep @tag1 --grep @tag2

# This can also be shortend to
$ npx playwright test -g tag1|tag2