docs(test-runner): make reporter env snippets cross-os compatible (#7947)

This commit is contained in:
Max Schmitt 2021-08-02 16:21:30 +02:00 committed by GitHub
parent deddf50c95
commit 5e0a60fca1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -236,7 +236,16 @@ JSON reporter produces an object with all information about the test run. It is
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
set PLAYWRIGHT_JSON_OUTPUT_NAME=results.json
npx playwright test --reporter=json,dot
# Windows with PowerShell
$env:PLAYWRIGHT_JSON_OUTPUT_NAME="results.json"
npx playwright test --reporter=json,dot
```
In configuration file, pass options directly:
@ -268,7 +277,16 @@ JUnit reporter produces a JUnit-style xml report. It is usually used together wi
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
set PLAYWRIGHT_JUNIT_OUTPUT_NAME=results.xml
npx playwright test --reporter=junit,line
# Windows with PowerShell
$env:PLAYWRIGHT_JUNIT_OUTPUT_NAME="results.xml"
npx playwright test --reporter=junit,line
```
In configuration file, pass options directly: