Skip to content

Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.

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

Max Schmitt5e0a60fca11e
diff --git a/docs/src/test-reporters-js.md b/docs/src/test-reporters-js.md
index a459d70553..249afe9210 100644
--- a/docs/src/test-reporters-js.md
+++ b/docs/src/test-reporters-js.md
@@ -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: