From 5e0a60fca11ece7ccfe00ba2b0fa506fed01fc11 Mon Sep 17 00:00:00 2001 From: Max Schmitt Date: Mon, 2 Aug 2021 16:21:30 +0200 Subject: [PATCH] docs(test-runner): make reporter env snippets cross-os compatible (#7947) --- docs/src/test-reporters-js.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) 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: