docs: add examples to run intersection or combination of tags (#22913)

This commit is contained in:
Kevin Brotcke 2023-05-09 14:52:48 -07:00 committed by GitHub
parent 75e106745f
commit 852f1d7881
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -87,6 +87,18 @@ Or if you want the opposite, you can skip the tests with a certain tag:
npx playwright test --grep-invert @slow
```
To run tests containing either tag (logical `OR` operator):
```bash
npx playwright test --grep "@fast|@slow"
```
Or run tests containing both tags (logical `AND` operator) using regex lookaheads:
```bash
npx playwright test --grep "(?=.*@fast)(?=.*@slow)"
```
## Conditionally skip a group of tests
For example, you can run a group of tests just in Chromium by passing a callback.