Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.
TypeScript automationchromechromiume2e-testingelectronend-to-end-testingfirefoxjavascriptplaywrighttesttest-automationtestingtesting-toolswebwebkit
docs: provide examples for PowerShell when settings env vars (#6718)
Max Schmittf629cbe053b7
diff --git a/docs/src/debug.md b/docs/src/debug.mdindex e9253b6449..2e81e1c9ca 100644--- a/docs/src/debug.md+++ b/docs/src/debug.md@@ -109,27 +109,39 @@ composite selectors.# Linux/macOSPWDEBUG=console npm run test-# Windows+# Windows with cmd.exeset PWDEBUG=consolenpm run test++# Windows with PowerShell+$env:PWDEBUG="console"+npm run test``````sh java# Linux/macOSPWDEBUG=console mvn test-# Windows+# Windows with cmd.exeset PWDEBUG=consolemvn test++# Windows with PowerShell+$env:PWDEBUG="console"+mvn test``````sh python# Linux/macOSPWDEBUG=console pytest -s-# Windows+# Windows with cmd.exeset PWDEBUG=consolepytest -s++# Windows with PowerShell+$env:PWDEBUG="console"+pytest -s```## Selectors in Developer Tools Console@@ -176,31 +188,50 @@ Playwright supports verbose logging with the `DEBUG` environment variable.# Linux/macOSDEBUG=pw:api npm run test-# Windows+# Windows with cmd.exeset DEBUG=pw:apinpm run test++# Windows with PowerShell+$env:DEBUG="pw:api"+npm run test``````sh java# Linux/macOSDEBUG=pw:api mvn test-# Windows+# Windows with cmd.exeset DEBUG=pw:apimvn test++# Windows with PowerShell+$env:DEBUG="pw:api"+mvn test``````sh python# Linux/macOSDEBUG=pw:api pytest -s-# Windows+# Windows with cmd.exeset DEBUG=pw:apipytest -s++# Windows with PowerShell+$env:DEBUG="pw:api"+pytest -s``````sh csharp-# Powershell (Win/macOS)+# Linux/macOS+DEBUG=pw:api dotnet run++# Windows with cmd.exe+set DEBUG=pw:api+dotnet run++# Windows with PowerShell$env:DEBUG="pw:api"dotnet run```\ No newline at end of filediff --git a/docs/src/inspector.md b/docs/src/inspector.mdindex 15c8c90190..4c260ff3f1 100644--- a/docs/src/inspector.md+++ b/docs/src/inspector.md@@ -19,28 +19,41 @@ configures Playwright for debugging and opens the inspector.# Linux/macOSPWDEBUG=1 npm run test- # Windows+ # Windows with cmd.exeset PWDEBUG=1npm run test++ # Windows with PowerShell+ $env:PWDEBUG=1+ npm run test``````sh java# Linux/macOSPWDEBUG=1 PLAYWRIGHT_JAVA_SRC=<java src root> mvn test- # Windows+ # Windows with cmd.exeset PLAYWRIGHT_JAVA_SRC=<java src root>set PWDEBUG=1mvn test++ # Windows with PowerShell+ $env:PLAYWRIGHT_JAVA_SRC="<java src root>"+ $env:PWDEBUG=1+ mvn test``````sh python# Linux/macOSPWDEBUG=1 pytest -s- # Windows+ # Windows with cmd.exeset PWDEBUG=1pytest -s++ # Windows with PowerShell+ $env:PWDEBUG=1+ pytest -s```Additional useful defaults are configured when `PWDEBUG=1` is set:diff --git a/docs/src/installation.md b/docs/src/installation.mdindex 3c49a5ea8b..7cc27aaf84 100644--- a/docs/src/installation.md+++ b/docs/src/installation.md@@ -37,9 +37,13 @@ You can override default behavior using environment variables. When installing P# Linux/macOSPLAYWRIGHT_BROWSERS_PATH=$HOME/pw-browsers npm i -D playwright-# Windows+# Windows with cmd.exeset PLAYWRIGHT_BROWSERS_PATH=%USERPROFILE%\pw-browsersnpm i -D playwright++# Windows with PowerShell+$env:PLAYWRIGHT_BROWSERS_PATH="$env:USERPROFILE\pw-browsers"+npm i -D playwright``````sh python@@ -47,10 +51,15 @@ npm i -D playwrightpip install playwrightPLAYWRIGHT_BROWSERS_PATH=$HOME/pw-browsers python -m playwright install-# Windows+# Windows with cmd.exeset PLAYWRIGHT_BROWSERS_PATH=%USERPROFILE%\pw-browserspip install playwrightplaywright install++# Windows with PowerShell+$env:PLAYWRIGHT_BROWSERS_PATH="$env:USERPROFILE\pw-browsers"+pip install playwright+playwright install``````sh java@@ -64,24 +73,36 @@ When running Playwright scripts, ask it to search for browsers in a shared locat# Linux/macOSPLAYWRIGHT_BROWSERS_PATH=$HOME/pw-browsers node playwright-script.js-# Windows+# Windows with cmd.exeset PLAYWRIGHT_BROWSERS_PATH=%USERPROFILE%\pw-browsersnode playwright-script.js++# Windows with PowerShell+$env:PLAYWRIGHT_BROWSERS_PATH="$env:USERPROFILE\pw-browsers"+node playwright-script.js``````sh python# Linux/macOSPLAYWRIGHT_BROWSERS_PATH=$HOME/pw-browsers python playwright_script.js-# Windows+# Windows with cmd.exeset PLAYWRIGHT_BROWSERS_PATH=%USERPROFILE%\pw-browserspython playwright_script.py++# Windows with PowerShell+$env:PLAYWRIGHT_BROWSERS_PATH="$env:USERPROFILE\pw-browsers"+python playwright_script.py``````sh java-# Windows+# Windows with cmd.exeset PLAYWRIGHT_BROWSERS_PATH=%USERPROFILE%\pw-browsersmvn test++# Windows with PowerShell+$env:PLAYWRIGHT_BROWSERS_PATH="$env:USERPROFILE\pw-browsers"+mvn test```Or you can opt into the hermetic install and place binaries in the local folder:@@ -91,10 +112,15 @@ Or you can opt into the hermetic install and place binaries in the local folder:# Places binaries to node_modules/playwrightPLAYWRIGHT_BROWSERS_PATH=0 npm i -D playwright-# Windows+# Windows with cmd.exe# Places binaries to node_modules\playwrightset PLAYWRIGHT_BROWSERS_PATH=0npm i -D playwright++# Windows with PowerShell+# Places binaries to node_modules\playwright+$env:PLAYWRIGHT_BROWSERS_PATH=0+npm i -D playwright``````sh python@@ -102,10 +128,15 @@ npm i -D playwrightpip install playwrightPLAYWRIGHT_BROWSERS_PATH=0 playwright install-# Windows+# Windows with cmd.exeset PLAYWRIGHT_BROWSERS_PATH=0pip install playwrightplaywright install++# Windows with PowerShell+$env:PLAYWRIGHT_BROWSERS_PATH=0+pip install playwright+playwright install```Playwright keeps track of packages that need those browsers and will garbage collect them as you update Playwright to the newer versions.@@ -125,9 +156,13 @@ resources. In this case, Playwright can be configured to download browsers via a# Linux/macOSHTTPS_PROXY=https://192.168.1.78 npm i -D playwright-# Windows+# Windows with cmd.exeset HTTPS_PROXY=https://192.168.1.78npm i -D playwright++# Windows with PowerShell+$env:HTTPS_PROXY="https://192.168.1.78"+npm i -D playwright``````sh python@@ -135,19 +170,28 @@ npm i -D playwrightpip install playwrightHTTPS_PROXY=https://192.168.1.78 playwright install-# Windows+# Windows with cmd.exeset HTTPS_PROXY=https://192.168.1.78pip install playwrightplaywright install++# Windows with PowerShell+$env:HTTPS_PROXY="https://192.168.1.78"+pip install playwright+playwright install``````sh java# Linux/macOSHTTPS_PROXY=https://192.168.1.78 mvn test-# Windows+# Windows with cmd.exeset HTTPS_PROXY=https://192.168.1.78mvn test++# Windows with PowerShell+$env:HTTPS_PROXY="https://192.168.1.78"+mvn test```## Download from artifact repository@@ -162,9 +206,13 @@ location using the `PLAYWRIGHT_DOWNLOAD_HOST` env variable.# Linux/macOSPLAYWRIGHT_DOWNLOAD_HOST=192.168.1.78 npm i -D playwright-# Windows+# Windows with cmd.exeset PLAYWRIGHT_DOWNLOAD_HOST=192.168.1.78npm i -D playwright++# Windows with PowerShell+$env:PLAYWRIGHT_DOWNLOAD_HOST="192.168.1.78"+npm i -D playwright``````sh python@@ -172,19 +220,28 @@ npm i -D playwrightpip install playwrightPLAYWRIGHT_DOWNLOAD_HOST=192.168.1.78 playwright install-# Windows+# Windows with cmd.exeset PLAYWRIGHT_DOWNLOAD_HOST=192.168.1.78pip install playwrightplaywright install++# Windows with PowerShell+$env:PLAYWRIGHT_DOWNLOAD_HOST="192.168.1.78"+pip install playwright+playwright install``````sh java# Linux/macOSPLAYWRIGHT_DOWNLOAD_HOST=192.168.1.78 mvn test-# Windows+# Windows with cmd.exeset PLAYWRIGHT_DOWNLOAD_HOST=192.168.1.78mvn test++# Windows with PowerShell+$env:PLAYWRIGHT_DOWNLOAD_HOST="192.168.1.78"+mvn test```It is also possible to use a per-browser download hosts using `PLAYWRIGHT_CHROMIUM_DOWNLOAD_HOST`, `PLAYWRIGHT_FIREFOX_DOWNLOAD_HOST` and `PLAYWRIGHT_WEBKIT_DOWNLOAD_HOST` env variables that@@ -219,9 +276,13 @@ This can be done by setting `PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD` variable before i# Linux/macOSPLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1 npm i -D playwright-# Windows+# Windows with cmd.exeset PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1npm i -D playwright++# Windows with PowerShell+$env:PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1+npm i -D playwright``````sh python@@ -229,19 +290,28 @@ npm i -D playwrightpip install playwrightPLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1 python -m playwright install-# Windows+# Windows with cmd.exeset PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1pip install playwrightplaywright install++# Windows with PowerShell+$env:PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1+pip install playwright+playwright install``````sh java# Linux/macOSPLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1 mvn test-# Windows+# Windows with cmd.exeset PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1mvn test++# Windows with PowerShell+$env:PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1+mvn test```## Download single browser binary