From 87ca45366b2cdfe686595e891be1e25375c8c47a Mon Sep 17 00:00:00 2001 From: Yury Semikhatsky Date: Wed, 20 Dec 2023 09:56:37 -0800 Subject: [PATCH] docs: quote to avoid variable expansion in powershell (#28728) Fixes https://github.com/microsoft/playwright/issues/28724 --- docs/src/test-annotations-js.md | 42 ++++++++++++++++++++------------- 1 file changed, 26 insertions(+), 16 deletions(-) diff --git a/docs/src/test-annotations-js.md b/docs/src/test-annotations-js.md index ba8ae9c681..f9e8c0678c 100644 --- a/docs/src/test-annotations-js.md +++ b/docs/src/test-annotations-js.md @@ -79,35 +79,45 @@ test('Test full report @slow', async ({ page }) => { You will then be able to run only that test: -```bash +```bash tab=bash-bash +npx playwright test --grep @fast +``` + +```powershell tab=bash-powershell +npx playwright test --grep "@fast" +``` + +```batch tab=bash-batch npx playwright test --grep @fast ``` Or if you want the opposite, you can skip the tests with a certain tag: -```bash -npx playwright test --grep-invert @slow +```bash tab=bash-bash +npx playwright test --grep-invert @fast +``` + +```powershell tab=bash-powershell +npx playwright test --grep-invert "@fast" +``` + +```batch tab=bash-batch +npx playwright test --grep-invert @fast ``` To run tests containing either tag (logical `OR` operator): -```bash +```bash tab=bash-bash npx playwright test --grep "@fast|@slow" ``` -On Windows shells: +```powershell tab=bash-powershell +npx playwright test --grep --% "@fast^|@slow" +``` -- PowerShell - - ```bash - npx playwright test --grep --% "@fast^|@slow" - ``` - -- Command Prompt(cmd.exe) / Git Bash: - - ```bash - npx playwright test --grep "@fast^|@slow" - ``` +```batch tab=bash-batch +npx playwright test --grep "@fast^|@slow" +``` Or run tests containing both tags (logical `AND` operator) using regex lookaheads: