From 9a1e0a8ff7c2a34380d15fb8fa2d0001b1adc000 Mon Sep 17 00:00:00 2001 From: Yury Semikhatsky Date: Tue, 20 Feb 2024 13:32:53 -0800 Subject: [PATCH] docs: custom reporter path in --reporter option (#29585) Fixes https://github.com/microsoft/playwright/issues/29525 --- docs/src/test-cli-js.md | 2 +- docs/src/test-reporters-js.md | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/docs/src/test-cli-js.md b/docs/src/test-cli-js.md index ebdc814d25a3b..9a178d23080c3 100644 --- a/docs/src/test-cli-js.md +++ b/docs/src/test-cli-js.md @@ -95,7 +95,7 @@ Complete set of Playwright Test options is available in the [configuration file] | `--project ` | Only run tests from the specified [projects](./test-projects.md), supports '*' wildcard. Defaults to running all projects defined in the configuration file.| | `--quiet` | Whether to suppress stdout and stderr from the tests. | | `--repeat-each ` | Run each test `N` times, defaults to one. | -| `--reporter ` | Choose a reporter: minimalist `dot`, concise `line` or detailed `list`. See [reporters](./test-reporters.md) for more information. | +| `--reporter ` | Choose a reporter: minimalist `dot`, concise `line` or detailed `list`. See [reporters](./test-reporters.md) for more information. You can also pass a path to a [custom reporter](./test-reporters.md#custom-reporters) file. | | `--retries ` | The maximum number of [retries](./test-retries.md#retries) for flaky tests, defaults to zero (no retries). | | `--shard ` | [Shard](./test-parallel.md#shard-tests-between-multiple-machines) tests and execute only selected shard, specified in the form `current/all`, 1-based, for example `3/5`.| | `--tag ` | Only run tests with a tag matching this tag expression. Learn more about [tagging](./test-annotations.md#tag-tests). | diff --git a/docs/src/test-reporters-js.md b/docs/src/test-reporters-js.md index 24e346d84931a..2673739c9ceca 100644 --- a/docs/src/test-reporters-js.md +++ b/docs/src/test-reporters-js.md @@ -342,6 +342,13 @@ export default defineConfig({ reporter: './my-awesome-reporter.ts', }); ``` + +Or just pass the reporter file path as `--reporter` command line option: + +```bash +npx playwright test --reporter="./myreporter/my-awesome-reporter.ts" +``` + ## Third party reporter showcase * [Allure](https://www.npmjs.com/package/allure-playwright)