mirror of
https://github.com/microsoft/playwright.git
synced 2025-06-26 21:40:17 +00:00
docs: add tabs for shell scripts (#9289)
This commit is contained in:
parent
92c1aa20a7
commit
a280a17157
@ -225,109 +225,122 @@ du -hs ~/Library/Caches/ms-playwright/*
|
|||||||
|
|
||||||
You can override default behavior using environment variables. When installing Playwright, ask it to download browsers into a specific location:
|
You can override default behavior using environment variables. When installing Playwright, ask it to download browsers into a specific location:
|
||||||
|
|
||||||
```bash js
|
```bash bash-flavor=bash lang=js
|
||||||
# Linux/macOS
|
|
||||||
PLAYWRIGHT_BROWSERS_PATH=$HOME/pw-browsers npx playwright install
|
PLAYWRIGHT_BROWSERS_PATH=$HOME/pw-browsers npx playwright install
|
||||||
|
```
|
||||||
|
|
||||||
# Windows with cmd.exe
|
```bash bash-flavor=batch lang=js
|
||||||
set PLAYWRIGHT_BROWSERS_PATH=%USERPROFILE%\pw-browsers
|
set PLAYWRIGHT_BROWSERS_PATH=%USERPROFILE%\pw-browsers
|
||||||
npx playwright install
|
npx playwright install
|
||||||
|
```
|
||||||
|
|
||||||
# Windows with PowerShell
|
```bash bash-flavor=powershell lang=js
|
||||||
$env:PLAYWRIGHT_BROWSERS_PATH="$env:USERPROFILE\pw-browsers"
|
$env:PLAYWRIGHT_BROWSERS_PATH="$env:USERPROFILE\pw-browsers"
|
||||||
npx playwright install
|
npx playwright install
|
||||||
```
|
```
|
||||||
|
|
||||||
```bash python
|
```bash bash-flavor=bash lang=python
|
||||||
# Linux/macOS
|
|
||||||
pip install playwright
|
pip install playwright
|
||||||
PLAYWRIGHT_BROWSERS_PATH=$HOME/pw-browsers python -m playwright install
|
PLAYWRIGHT_BROWSERS_PATH=$HOME/pw-browsers python -m playwright install
|
||||||
|
```
|
||||||
|
|
||||||
# Windows with cmd.exe
|
```bash bash-flavor=batch lang=python
|
||||||
set PLAYWRIGHT_BROWSERS_PATH=%USERPROFILE%\pw-browsers
|
set PLAYWRIGHT_BROWSERS_PATH=%USERPROFILE%\pw-browsers
|
||||||
pip install playwright
|
pip install playwright
|
||||||
playwright install
|
playwright install
|
||||||
|
```
|
||||||
|
|
||||||
# Windows with PowerShell
|
```bash bash-flavor=powershell lang=python
|
||||||
$env:PLAYWRIGHT_BROWSERS_PATH="$env:USERPROFILE\pw-browsers"
|
$env:PLAYWRIGHT_BROWSERS_PATH="$env:USERPROFILE\pw-browsers"
|
||||||
pip install playwright
|
pip install playwright
|
||||||
playwright install
|
playwright install
|
||||||
```
|
```
|
||||||
|
|
||||||
```bash java
|
```bash bash-flavor=bash lang=java
|
||||||
# Linux/macOS
|
|
||||||
PLAYWRIGHT_BROWSERS_PATH=$HOME/pw-browsers mvn test
|
PLAYWRIGHT_BROWSERS_PATH=$HOME/pw-browsers mvn test
|
||||||
|
```
|
||||||
|
|
||||||
# Windows with cmd.exe
|
```bash bash-flavor=batch lang=java
|
||||||
set PLAYWRIGHT_BROWSERS_PATH=%USERPROFILE%\pw-browsers
|
set PLAYWRIGHT_BROWSERS_PATH=%USERPROFILE%\pw-browsers
|
||||||
mvn test
|
mvn test
|
||||||
|
```
|
||||||
|
|
||||||
# Windows with PowerShell
|
```bash bash-flavor=powershell lang=java
|
||||||
$env:PLAYWRIGHT_BROWSERS_PATH="$env:USERPROFILE\pw-browsers"
|
$env:PLAYWRIGHT_BROWSERS_PATH="$env:USERPROFILE\pw-browsers"
|
||||||
mvn test
|
mvn test
|
||||||
```
|
```
|
||||||
|
|
||||||
```bash csharp
|
```bash bash-flavor=bash lang=csharp
|
||||||
# Linux/macOS
|
|
||||||
PLAYWRIGHT_BROWSERS_PATH=$HOME/pw-browsers
|
PLAYWRIGHT_BROWSERS_PATH=$HOME/pw-browsers
|
||||||
playwright install
|
playwright install
|
||||||
|
```
|
||||||
|
|
||||||
# Windows with cmd.exe
|
```bash bash-flavor=batch lang=csharp
|
||||||
set PLAYWRIGHT_BROWSERS_PATH=%USERPROFILE%\pw-browsers
|
set PLAYWRIGHT_BROWSERS_PATH=%USERPROFILE%\pw-browsers
|
||||||
playwright install
|
playwright install
|
||||||
|
```
|
||||||
|
|
||||||
# Windows with PowerShell
|
```bash bash-flavor=powershell lang=csharp
|
||||||
$env:PLAYWRIGHT_BROWSERS_PATH="$env:USERPROFILE\pw-browsers"
|
$env:PLAYWRIGHT_BROWSERS_PATH="$env:USERPROFILE\pw-browsers"
|
||||||
playwright install
|
playwright install
|
||||||
```
|
```
|
||||||
|
|
||||||
When running Playwright scripts, ask it to search for browsers in a shared location.
|
When running Playwright scripts, ask it to search for browsers in a shared location.
|
||||||
|
|
||||||
```bash js
|
```bash bash-flavor=bash lang=js
|
||||||
# Linux/macOS
|
|
||||||
PLAYWRIGHT_BROWSERS_PATH=$HOME/pw-browsers npx playwright test
|
PLAYWRIGHT_BROWSERS_PATH=$HOME/pw-browsers npx playwright test
|
||||||
|
```
|
||||||
|
|
||||||
# Windows with cmd.exe
|
```bash bash-flavor=batch lang=js
|
||||||
set PLAYWRIGHT_BROWSERS_PATH=%USERPROFILE%\pw-browsers
|
set PLAYWRIGHT_BROWSERS_PATH=%USERPROFILE%\pw-browsers
|
||||||
npx playwright test
|
npx playwright test
|
||||||
|
```
|
||||||
|
|
||||||
# Windows with PowerShell
|
```bash bash-flavor=powershell lang=js
|
||||||
$env:PLAYWRIGHT_BROWSERS_PATH="$env:USERPROFILE\pw-browsers"
|
$env:PLAYWRIGHT_BROWSERS_PATH="$env:USERPROFILE\pw-browsers"
|
||||||
npx playwright test
|
npx playwright test
|
||||||
```
|
```
|
||||||
|
|
||||||
```bash python
|
```bash bash-flavor=bash lang=python
|
||||||
# Linux/macOS
|
# Linux/macOS
|
||||||
PLAYWRIGHT_BROWSERS_PATH=$HOME/pw-browsers python playwright_script.py
|
PLAYWRIGHT_BROWSERS_PATH=$HOME/pw-browsers python playwright_script.py
|
||||||
|
```
|
||||||
|
|
||||||
# Windows with cmd.exe
|
```bash bash-flavor=batch lang=python
|
||||||
set PLAYWRIGHT_BROWSERS_PATH=%USERPROFILE%\pw-browsers
|
set PLAYWRIGHT_BROWSERS_PATH=%USERPROFILE%\pw-browsers
|
||||||
python playwright_script.py
|
python playwright_script.py
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash bash-flavor=powershell lang=python
|
||||||
|
|
||||||
# Windows with PowerShell
|
|
||||||
$env:PLAYWRIGHT_BROWSERS_PATH="$env:USERPROFILE\pw-browsers"
|
$env:PLAYWRIGHT_BROWSERS_PATH="$env:USERPROFILE\pw-browsers"
|
||||||
python playwright_script.py
|
python playwright_script.py
|
||||||
```
|
```
|
||||||
|
|
||||||
```bash java
|
```bash bash-flavor=bash lang=java
|
||||||
# Windows with cmd.exe
|
PLAYWRIGHT_BROWSERS_PATH=$HOME/pw-browsers mvn test
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash bash-flavor=batch lang=java
|
||||||
set PLAYWRIGHT_BROWSERS_PATH=%USERPROFILE%\pw-browsers
|
set PLAYWRIGHT_BROWSERS_PATH=%USERPROFILE%\pw-browsers
|
||||||
mvn test
|
mvn test
|
||||||
|
```
|
||||||
|
|
||||||
# Windows with PowerShell
|
```bash bash-flavor=powershell lang=java
|
||||||
$env:PLAYWRIGHT_BROWSERS_PATH="$env:USERPROFILE\pw-browsers"
|
$env:PLAYWRIGHT_BROWSERS_PATH="$env:USERPROFILE\pw-browsers"
|
||||||
mvn test
|
mvn test
|
||||||
```
|
```
|
||||||
|
|
||||||
```bash csharp
|
```bash bash-flavor=bash lang=csharp
|
||||||
# Linux/macOS
|
|
||||||
PLAYWRIGHT_BROWSERS_PATH=$HOME/pw-browsers dotnet test
|
PLAYWRIGHT_BROWSERS_PATH=$HOME/pw-browsers dotnet test
|
||||||
|
```
|
||||||
|
|
||||||
# Windows with cmd.exe
|
```bash bash-flavor=batch lang=csharp
|
||||||
set PLAYWRIGHT_BROWSERS_PATH=%USERPROFILE%\pw-browsers
|
set PLAYWRIGHT_BROWSERS_PATH=%USERPROFILE%\pw-browsers
|
||||||
dotnet test
|
dotnet test
|
||||||
|
```
|
||||||
|
|
||||||
# Windows with PowerShell
|
```bash bash-flavor=powershell lang=csharp
|
||||||
$env:PLAYWRIGHT_BROWSERS_PATH="$env:USERPROFILE\pw-browsers"
|
$env:PLAYWRIGHT_BROWSERS_PATH="$env:USERPROFILE\pw-browsers"
|
||||||
dotnet test
|
dotnet test
|
||||||
```
|
```
|
||||||
@ -343,17 +356,18 @@ Developers can opt-in in this mode via exporting `PLAYWRIGHT_BROWSERS_PATH=$HOME
|
|||||||
|
|
||||||
You can opt into the hermetic install and place binaries in the local folder:
|
You can opt into the hermetic install and place binaries in the local folder:
|
||||||
|
|
||||||
```bash
|
```bash bash-flavor=bash
|
||||||
# Linux/macOS
|
|
||||||
# Places binaries to node_modules/@playwright/test
|
# Places binaries to node_modules/@playwright/test
|
||||||
PLAYWRIGHT_BROWSERS_PATH=0 npx playwright install
|
PLAYWRIGHT_BROWSERS_PATH=0 npx playwright install
|
||||||
|
```
|
||||||
|
|
||||||
# Windows with cmd.exe
|
```bash bash-flavor=batch
|
||||||
# Places binaries to node_modules\@playwright\test
|
# Places binaries to node_modules\@playwright\test
|
||||||
set PLAYWRIGHT_BROWSERS_PATH=0
|
set PLAYWRIGHT_BROWSERS_PATH=0
|
||||||
npx playwright install
|
npx playwright install
|
||||||
|
```
|
||||||
|
|
||||||
# Windows with PowerShell
|
```bash bash-flavor=powershell
|
||||||
# Places binaries to node_modules\@playwright\test
|
# Places binaries to node_modules\@playwright\test
|
||||||
$env:PLAYWRIGHT_BROWSERS_PATH=0
|
$env:PLAYWRIGHT_BROWSERS_PATH=0
|
||||||
npx playwright install
|
npx playwright install
|
||||||
@ -366,44 +380,47 @@ By default, Playwright downloads browsers from Microsoft CDN.
|
|||||||
Sometimes companies maintain an internal proxy that blocks direct access to the public
|
Sometimes companies maintain an internal proxy that blocks direct access to the public
|
||||||
resources. In this case, Playwright can be configured to download browsers via a proxy server.
|
resources. In this case, Playwright can be configured to download browsers via a proxy server.
|
||||||
|
|
||||||
```bash python
|
```bash bash-flavor=bash lang=python
|
||||||
# Linux/macOS
|
|
||||||
pip install playwright
|
pip install playwright
|
||||||
HTTPS_PROXY=https://192.0.2.1 playwright install
|
HTTPS_PROXY=https://192.0.2.1 playwright install
|
||||||
|
```
|
||||||
|
|
||||||
# Windows with cmd.exe
|
```bash bash-flavor=batch lang=python
|
||||||
set HTTPS_PROXY=https://192.0.2.1
|
set HTTPS_PROXY=https://192.0.2.1
|
||||||
pip install playwright
|
pip install playwright
|
||||||
playwright install
|
playwright install
|
||||||
|
```
|
||||||
|
|
||||||
# Windows with PowerShell
|
```bash bash-flavor=powershell lang=python
|
||||||
$env:HTTPS_PROXY="https://192.0.2.1"
|
$env:HTTPS_PROXY="https://192.0.2.1"
|
||||||
pip install playwright
|
pip install playwright
|
||||||
playwright install
|
playwright install
|
||||||
```
|
```
|
||||||
|
|
||||||
```bash java
|
```bash bash-flavor=bash lang=java
|
||||||
# Linux/macOS
|
|
||||||
HTTPS_PROXY=https://192.0.2.1 mvn test
|
HTTPS_PROXY=https://192.0.2.1 mvn test
|
||||||
|
```
|
||||||
|
|
||||||
# Windows with cmd.exe
|
```bash bash-flavor=batch lang=java
|
||||||
set HTTPS_PROXY=https://192.0.2.1
|
set HTTPS_PROXY=https://192.0.2.1
|
||||||
mvn test
|
mvn test
|
||||||
|
```
|
||||||
|
|
||||||
# Windows with PowerShell
|
```bash bash-flavor=powershell lang=java
|
||||||
$env:HTTPS_PROXY="https://192.0.2.1"
|
$env:HTTPS_PROXY="https://192.0.2.1"
|
||||||
mvn test
|
mvn test
|
||||||
```
|
```
|
||||||
|
|
||||||
```bash csharp
|
```bash bash-flavor=bash lang=csharp
|
||||||
# Linux/macOS
|
|
||||||
HTTPS_PROXY=https://192.0.2.1 playwright install
|
HTTPS_PROXY=https://192.0.2.1 playwright install
|
||||||
|
```
|
||||||
|
|
||||||
# Windows with cmd.exe
|
```bash bash-flavor=batch lang=csharp
|
||||||
set HTTPS_PROXY=https://192.0.2.1
|
set HTTPS_PROXY=https://192.0.2.1
|
||||||
playwright install
|
playwright install
|
||||||
|
```
|
||||||
|
|
||||||
# Windows with PowerShell
|
```bash bash-flavor=powershell lang=csharp
|
||||||
$env:HTTPS_PROXY="https://192.0.2.1"
|
$env:HTTPS_PROXY="https://192.0.2.1"
|
||||||
playwright install
|
playwright install
|
||||||
```
|
```
|
||||||
@ -416,44 +433,48 @@ Sometimes companies maintain an internal artifact repository to host browser
|
|||||||
binaries. In this case, Playwright can be configured to download from a custom
|
binaries. In this case, Playwright can be configured to download from a custom
|
||||||
location using the `PLAYWRIGHT_DOWNLOAD_HOST` env variable.
|
location using the `PLAYWRIGHT_DOWNLOAD_HOST` env variable.
|
||||||
|
|
||||||
```bash python
|
```bash bash-flavor=bash lang=python
|
||||||
# Linux/macOS
|
|
||||||
pip install playwright
|
pip install playwright
|
||||||
PLAYWRIGHT_DOWNLOAD_HOST=192.0.2.1 playwright install
|
PLAYWRIGHT_DOWNLOAD_HOST=192.0.2.1 playwright install
|
||||||
|
|
||||||
# Windows with cmd.exe
|
```
|
||||||
|
|
||||||
|
```bash bash-flavor=batch lang=python
|
||||||
set PLAYWRIGHT_DOWNLOAD_HOST=192.0.2.1
|
set PLAYWRIGHT_DOWNLOAD_HOST=192.0.2.1
|
||||||
pip install playwright
|
pip install playwright
|
||||||
playwright install
|
playwright install
|
||||||
|
```
|
||||||
|
|
||||||
# Windows with PowerShell
|
```bash bash-flavor=powershell lang=python
|
||||||
$env:PLAYWRIGHT_DOWNLOAD_HOST="192.0.2.1"
|
$env:PLAYWRIGHT_DOWNLOAD_HOST="192.0.2.1"
|
||||||
pip install playwright
|
pip install playwright
|
||||||
playwright install
|
playwright install
|
||||||
```
|
```
|
||||||
|
|
||||||
```bash java
|
```bash bash-flavor=bash lang=java
|
||||||
# Linux/macOS
|
|
||||||
PLAYWRIGHT_DOWNLOAD_HOST=192.0.2.1 mvn test
|
PLAYWRIGHT_DOWNLOAD_HOST=192.0.2.1 mvn test
|
||||||
|
```
|
||||||
|
|
||||||
# Windows with cmd.exe
|
```bash bash-flavor=batch lang=java
|
||||||
set PLAYWRIGHT_DOWNLOAD_HOST=192.0.2.1
|
set PLAYWRIGHT_DOWNLOAD_HOST=192.0.2.1
|
||||||
mvn test
|
mvn test
|
||||||
|
```
|
||||||
|
|
||||||
# Windows with PowerShell
|
```bash bash-flavor=powershell lang=java
|
||||||
$env:PLAYWRIGHT_DOWNLOAD_HOST="192.0.2.1"
|
$env:PLAYWRIGHT_DOWNLOAD_HOST="192.0.2.1"
|
||||||
mvn test
|
mvn test
|
||||||
```
|
```
|
||||||
|
|
||||||
```bash csharp
|
```bash bash-flavor=bash lang=csharp
|
||||||
# Linux/macOS
|
|
||||||
PLAYWRIGHT_DOWNLOAD_HOST=192.0.2.1 playwright install
|
PLAYWRIGHT_DOWNLOAD_HOST=192.0.2.1 playwright install
|
||||||
|
```
|
||||||
|
|
||||||
# Windows with cmd.exe
|
```bash bash-flavor=batch lang=csharp
|
||||||
set PLAYWRIGHT_DOWNLOAD_HOST=192.0.2.1
|
set PLAYWRIGHT_DOWNLOAD_HOST=192.0.2.1
|
||||||
playwright install
|
playwright install
|
||||||
|
```
|
||||||
|
|
||||||
# Windows with PowerShell
|
```bash bash-flavor=powershell lang=csharp
|
||||||
$env:PLAYWRIGHT_DOWNLOAD_HOST="192.0.2.1"
|
$env:PLAYWRIGHT_DOWNLOAD_HOST="192.0.2.1"
|
||||||
playwright install
|
playwright install
|
||||||
```
|
```
|
||||||
@ -484,44 +505,47 @@ browser binaries are managed separately.
|
|||||||
|
|
||||||
This can be done by setting `PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD` variable before installation.
|
This can be done by setting `PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD` variable before installation.
|
||||||
|
|
||||||
```bash python
|
```bash bash-flavor=bash lang=python
|
||||||
# Linux/macOS
|
|
||||||
pip install playwright
|
pip install playwright
|
||||||
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1 python -m playwright install
|
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1 python -m playwright install
|
||||||
|
```
|
||||||
|
|
||||||
# Windows with cmd.exe
|
```bash bash-flavor=batch lang=python
|
||||||
set PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1
|
set PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1
|
||||||
pip install playwright
|
pip install playwright
|
||||||
playwright install
|
playwright install
|
||||||
|
```
|
||||||
|
|
||||||
# Windows with PowerShell
|
```bash bash-flavor=powershell lang=python
|
||||||
$env:PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1
|
$env:PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1
|
||||||
pip install playwright
|
pip install playwright
|
||||||
playwright install
|
playwright install
|
||||||
```
|
```
|
||||||
|
|
||||||
```bash java
|
```bash bash-flavor=bash lang=java
|
||||||
# Linux/macOS
|
|
||||||
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1 mvn test
|
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1 mvn test
|
||||||
|
```
|
||||||
|
|
||||||
# Windows with cmd.exe
|
```bash bash-flavor=batch lang=java
|
||||||
set PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1
|
set PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1
|
||||||
mvn test
|
mvn test
|
||||||
|
```
|
||||||
|
|
||||||
# Windows with PowerShell
|
```bash bash-flavor=powershell lang=java
|
||||||
$env:PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1
|
$env:PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1
|
||||||
mvn test
|
mvn test
|
||||||
```
|
```
|
||||||
|
|
||||||
```bash csharp
|
```bash bash-flavor=bash lang=csharp
|
||||||
# Linux/macOS
|
|
||||||
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1 playwright install
|
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1 playwright install
|
||||||
|
```
|
||||||
|
|
||||||
# Windows with cmd.exe
|
```bash bash-flavor=batch lang=csharp
|
||||||
set PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1
|
set PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1
|
||||||
playwright install
|
playwright install
|
||||||
|
```
|
||||||
|
|
||||||
# Windows with PowerShell
|
```bash bash-flavor=powershell lang=csharp
|
||||||
$env:PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1
|
$env:PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1
|
||||||
playwright install
|
playwright install
|
||||||
```
|
```
|
||||||
|
|||||||
@ -111,41 +111,44 @@ Using `PWDEBUG=console` will configure the browser for debugging in Developer to
|
|||||||
[Playwright selectors](./selectors.md). This can be used to verify text or
|
[Playwright selectors](./selectors.md). This can be used to verify text or
|
||||||
composite selectors.
|
composite selectors.
|
||||||
|
|
||||||
```bash js
|
```bash bash-flavor=bash lang=js
|
||||||
# Linux/macOS
|
|
||||||
PWDEBUG=console npm run test
|
PWDEBUG=console npm run test
|
||||||
|
```
|
||||||
|
|
||||||
# Windows with cmd.exe
|
```bash bash-flavor=batch lang=js
|
||||||
set PWDEBUG=console
|
set PWDEBUG=console
|
||||||
npm run test
|
npm run test
|
||||||
|
|
||||||
# Windows with PowerShell
|
|
||||||
$env:PWDEBUG="console"
|
|
||||||
npm run test
|
|
||||||
```
|
```
|
||||||
|
|
||||||
```bash java
|
```bash bash-flavor=powershell lang=js
|
||||||
# Linux/macOS
|
env:PWDEBUG="console"
|
||||||
|
npm run test
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash bash-flavor=bash lang=java
|
||||||
PWDEBUG=console mvn test
|
PWDEBUG=console mvn test
|
||||||
|
```
|
||||||
|
|
||||||
# Windows with cmd.exe
|
```bash bash-flavor=batch lang=java
|
||||||
set PWDEBUG=console
|
set PWDEBUG=console
|
||||||
mvn test
|
mvn test
|
||||||
|
```
|
||||||
|
|
||||||
# Windows with PowerShell
|
```bash bash-flavor=powershell lang=java
|
||||||
$env:PWDEBUG="console"
|
$env:PWDEBUG="console"
|
||||||
mvn test
|
mvn test
|
||||||
```
|
```
|
||||||
|
|
||||||
```bash python
|
```bash bash-flavor=bash lang=python
|
||||||
# Linux/macOS
|
|
||||||
PWDEBUG=console pytest -s
|
PWDEBUG=console pytest -s
|
||||||
|
```
|
||||||
|
|
||||||
# Windows with cmd.exe
|
```bash bash-flavor=batch lang=python
|
||||||
set PWDEBUG=console
|
set PWDEBUG=console
|
||||||
pytest -s
|
pytest -s
|
||||||
|
```
|
||||||
|
|
||||||
# Windows with PowerShell
|
```bash bash-flavor=powershell lang=python
|
||||||
$env:PWDEBUG="console"
|
$env:PWDEBUG="console"
|
||||||
pytest -s
|
pytest -s
|
||||||
```
|
```
|
||||||
@ -190,54 +193,58 @@ breakpoints.
|
|||||||
|
|
||||||
Playwright supports verbose logging with the `DEBUG` environment variable.
|
Playwright supports verbose logging with the `DEBUG` environment variable.
|
||||||
|
|
||||||
```bash js
|
```bash bash-flavor=bash lang=js
|
||||||
# Linux/macOS
|
|
||||||
DEBUG=pw:api npm run test
|
DEBUG=pw:api npm run test
|
||||||
|
```
|
||||||
|
|
||||||
# Windows with cmd.exe
|
```bash bash-flavor=batch lang=js
|
||||||
set DEBUG=pw:api
|
set DEBUG=pw:api
|
||||||
npm run test
|
npm run test
|
||||||
|
```
|
||||||
|
|
||||||
# Windows with PowerShell
|
```bash bash-flavor=powershell lang=js
|
||||||
$env:DEBUG="pw:api"
|
$env:DEBUG="pw:api"
|
||||||
npm run test
|
npm run test
|
||||||
```
|
```
|
||||||
|
|
||||||
```bash java
|
```bash bash-flavor=bash lang=java
|
||||||
# Linux/macOS
|
|
||||||
DEBUG=pw:api mvn test
|
DEBUG=pw:api mvn test
|
||||||
|
```
|
||||||
|
|
||||||
# Windows with cmd.exe
|
```bash bash-flavor=batch lang=java
|
||||||
set DEBUG=pw:api
|
set DEBUG=pw:api
|
||||||
mvn test
|
mvn test
|
||||||
|
```
|
||||||
|
|
||||||
# Windows with PowerShell
|
```bash bash-flavor=powershell lang=java
|
||||||
$env:DEBUG="pw:api"
|
$env:DEBUG="pw:api"
|
||||||
mvn test
|
mvn test
|
||||||
```
|
```
|
||||||
|
|
||||||
```bash python
|
```bash bash-flavor=bash lang=python
|
||||||
# Linux/macOS
|
|
||||||
DEBUG=pw:api pytest -s
|
DEBUG=pw:api pytest -s
|
||||||
|
```
|
||||||
|
|
||||||
# Windows with cmd.exe
|
```bash bash-flavor=batch lang=python
|
||||||
set DEBUG=pw:api
|
set DEBUG=pw:api
|
||||||
pytest -s
|
pytest -s
|
||||||
|
```
|
||||||
|
|
||||||
# Windows with PowerShell
|
```bash bash-flavor=powershell lang=python
|
||||||
$env:DEBUG="pw:api"
|
$env:DEBUG="pw:api"
|
||||||
pytest -s
|
pytest -s
|
||||||
```
|
```
|
||||||
|
|
||||||
```bash csharp
|
```bash bash-flavor=bash lang=csharp
|
||||||
# Linux/macOS
|
|
||||||
DEBUG=pw:api dotnet run
|
DEBUG=pw:api dotnet run
|
||||||
|
```
|
||||||
|
|
||||||
# Windows with cmd.exe
|
```bash bash-flavor=batch lang=csharp
|
||||||
set DEBUG=pw:api
|
set DEBUG=pw:api
|
||||||
dotnet run
|
dotnet run
|
||||||
|
```
|
||||||
|
|
||||||
# Windows with PowerShell
|
```bash bash-flavor=powershell lang=csharp
|
||||||
$env:DEBUG="pw:api"
|
$env:DEBUG="pw:api"
|
||||||
dotnet run
|
dotnet run
|
||||||
```
|
```
|
||||||
@ -15,43 +15,47 @@ There are several ways of opening Playwright Inspector:
|
|||||||
|
|
||||||
- Set the `PWDEBUG` environment variable to run your scripts in debug mode. This
|
- Set the `PWDEBUG` environment variable to run your scripts in debug mode. This
|
||||||
configures Playwright for debugging and opens the inspector.
|
configures Playwright for debugging and opens the inspector.
|
||||||
```bash js
|
|
||||||
# Linux/macOS
|
|
||||||
PWDEBUG=1 npm run test
|
|
||||||
|
|
||||||
# Windows with cmd.exe
|
```bash bash-flavor=bash lang=js
|
||||||
|
PWDEBUG=1 npm run test
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash bash-flavor=batch lang=js
|
||||||
set PWDEBUG=1
|
set PWDEBUG=1
|
||||||
npm run test
|
npm run test
|
||||||
|
```
|
||||||
|
|
||||||
# Windows with PowerShell
|
```bash bash-flavor=powershell lang=js
|
||||||
$env:PWDEBUG=1
|
$env:PWDEBUG=1
|
||||||
npm run test
|
npm run test
|
||||||
```
|
```
|
||||||
|
|
||||||
```bash java
|
```bash bash-flavor=bash lang=java
|
||||||
# Linux/macOS
|
|
||||||
PWDEBUG=1 PLAYWRIGHT_JAVA_SRC=<java src root> mvn test
|
PWDEBUG=1 PLAYWRIGHT_JAVA_SRC=<java src root> mvn test
|
||||||
|
```
|
||||||
|
|
||||||
# Windows with cmd.exe
|
```bash bash-flavor=batch lang=java
|
||||||
set PLAYWRIGHT_JAVA_SRC=<java src root>
|
set PLAYWRIGHT_JAVA_SRC=<java src root>
|
||||||
set PWDEBUG=1
|
set PWDEBUG=1
|
||||||
mvn test
|
mvn test
|
||||||
|
```
|
||||||
|
|
||||||
# Windows with PowerShell
|
```bash bash-flavor=powershell lang=java
|
||||||
$env:PLAYWRIGHT_JAVA_SRC="<java src root>"
|
$env:PLAYWRIGHT_JAVA_SRC="<java src root>"
|
||||||
$env:PWDEBUG=1
|
$env:PWDEBUG=1
|
||||||
mvn test
|
mvn test
|
||||||
```
|
```
|
||||||
|
|
||||||
```bash python
|
```bash bash-flavor=bash lang=python
|
||||||
# Linux/macOS
|
|
||||||
PWDEBUG=1 pytest -s
|
PWDEBUG=1 pytest -s
|
||||||
|
```
|
||||||
|
|
||||||
# Windows with cmd.exe
|
```bash bash-flavor=batch lang=python
|
||||||
set PWDEBUG=1
|
set PWDEBUG=1
|
||||||
pytest -s
|
pytest -s
|
||||||
|
```
|
||||||
|
|
||||||
# Windows with PowerShell
|
```bash bash-flavor=powershell lang=python
|
||||||
$env:PWDEBUG=1
|
$env:PWDEBUG=1
|
||||||
pytest -s
|
pytest -s
|
||||||
```
|
```
|
||||||
|
|||||||
@ -155,17 +155,18 @@ with sync_playwright() as p:
|
|||||||
|
|
||||||
If you want to bundle browsers with the executables:
|
If you want to bundle browsers with the executables:
|
||||||
|
|
||||||
```bash
|
```bash bash-flavor=bash
|
||||||
# Linux/macOS
|
|
||||||
PLAYWRIGHT_BROWSERS_PATH=0 playwright install chromium
|
PLAYWRIGHT_BROWSERS_PATH=0 playwright install chromium
|
||||||
pyinstaller -F main.py
|
pyinstaller -F main.py
|
||||||
|
```
|
||||||
|
|
||||||
# Windows with cmd.exe
|
```bash bash-flavor=batch
|
||||||
set PLAYWRIGHT_BROWSERS_PATH=0
|
set PLAYWRIGHT_BROWSERS_PATH=0
|
||||||
playwright install chromium
|
playwright install chromium
|
||||||
pyinstaller -F main.py
|
pyinstaller -F main.py
|
||||||
|
```
|
||||||
|
|
||||||
# Windows with PowerShell
|
```bash bash-flavor=powershell
|
||||||
$env:PLAYWRIGHT_BROWSERS_PATH="0"
|
$env:PLAYWRIGHT_BROWSERS_PATH="0"
|
||||||
playwright install chromium
|
playwright install chromium
|
||||||
pyinstaller -F main.py
|
pyinstaller -F main.py
|
||||||
|
|||||||
@ -263,15 +263,17 @@ Running 124 tests using 6 workers
|
|||||||
JSON reporter produces an object with all information about the test run. It is usually used together with some terminal reporter like `dot` or `line`.
|
JSON reporter produces an object with all information about the test run. It is usually used together with some terminal reporter like `dot` or `line`.
|
||||||
|
|
||||||
Most likely you want to write the JSON to a file. When running with `--reporter=json`, use `PLAYWRIGHT_JSON_OUTPUT_NAME` environment variable:
|
Most likely you want to write the JSON to a file. When running with `--reporter=json`, use `PLAYWRIGHT_JSON_OUTPUT_NAME` environment variable:
|
||||||
```bash
|
|
||||||
# Linux/macOS
|
|
||||||
PLAYWRIGHT_JSON_OUTPUT_NAME=results.json npx playwright test --reporter=json,dot
|
|
||||||
|
|
||||||
# Windows with cmd.exe
|
```bash bash-flavor=bash
|
||||||
|
PLAYWRIGHT_JSON_OUTPUT_NAME=results.json npx playwright test --reporter=json,dot
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash bash-flavor=batch
|
||||||
set PLAYWRIGHT_JSON_OUTPUT_NAME=results.json
|
set PLAYWRIGHT_JSON_OUTPUT_NAME=results.json
|
||||||
npx playwright test --reporter=json,dot
|
npx playwright test --reporter=json,dot
|
||||||
|
```
|
||||||
|
|
||||||
# Windows with PowerShell
|
```bash bash-flavor=powershell
|
||||||
$env:PLAYWRIGHT_JSON_OUTPUT_NAME="results.json"
|
$env:PLAYWRIGHT_JSON_OUTPUT_NAME="results.json"
|
||||||
npx playwright test --reporter=json,dot
|
npx playwright test --reporter=json,dot
|
||||||
```
|
```
|
||||||
@ -304,15 +306,17 @@ export default config;
|
|||||||
JUnit reporter produces a JUnit-style xml report. It is usually used together with some terminal reporter like `dot` or `line`.
|
JUnit reporter produces a JUnit-style xml report. It is usually used together with some terminal reporter like `dot` or `line`.
|
||||||
|
|
||||||
Most likely you want to write the report to an xml file. When running with `--reporter=junit`, use `PLAYWRIGHT_JUNIT_OUTPUT_NAME` environment variable:
|
Most likely you want to write the report to an xml file. When running with `--reporter=junit`, use `PLAYWRIGHT_JUNIT_OUTPUT_NAME` environment variable:
|
||||||
```bash
|
|
||||||
# Linux/macOS
|
|
||||||
PLAYWRIGHT_JUNIT_OUTPUT_NAME=results.xml npx playwright test --reporter=junit,line
|
|
||||||
|
|
||||||
# Windows with cmd.exe
|
```bash bash-flavor=bash
|
||||||
|
PLAYWRIGHT_JUNIT_OUTPUT_NAME=results.xml npx playwright test --reporter=junit,line
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash bash-flavor=batch
|
||||||
set PLAYWRIGHT_JUNIT_OUTPUT_NAME=results.xml
|
set PLAYWRIGHT_JUNIT_OUTPUT_NAME=results.xml
|
||||||
npx playwright test --reporter=junit,line
|
npx playwright test --reporter=junit,line
|
||||||
|
```
|
||||||
|
|
||||||
# Windows with PowerShell
|
```bash bash-flavor=powershell
|
||||||
$env:PLAYWRIGHT_JUNIT_OUTPUT_NAME="results.xml"
|
$env:PLAYWRIGHT_JUNIT_OUTPUT_NAME="results.xml"
|
||||||
npx playwright test --reporter=junit,line
|
npx playwright test --reporter=junit,line
|
||||||
```
|
```
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user