From 852f1d7881245ecb2a053df03125083623b159a5 Mon Sep 17 00:00:00 2001 From: Kevin Brotcke Date: Tue, 9 May 2023 14:52:48 -0700 Subject: [PATCH] docs: add examples to run intersection or combination of tags (#22913) --- docs/src/test-annotations-js.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/docs/src/test-annotations-js.md b/docs/src/test-annotations-js.md index 3d9c21640d..8e5c6056d8 100644 --- a/docs/src/test-annotations-js.md +++ b/docs/src/test-annotations-js.md @@ -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.