You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit e57ce01
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: docs/src/test-cli-js.md
-2Lines changed: 0 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -103,7 +103,6 @@ npx playwright test --ui
103
103
|`--quiet`| Suppress stdio. |
104
104
|`--repeat-each <N>`| Run each test `N` times (default: 1). |
105
105
|`--reporter <reporter>`| Reporter to use, comma-separated, can be "dot", "line", "list", "failures", or others (default: "list" locally and "dot" on CI). You can also pass a path to a custom reporter file. |
106
-
|`--reporter-only-failures`| Include only failed, flaky, and interrupted tests in JSON, JUnit, and HTML reports. |
107
106
|`--retries <retries>`| Maximum retry count for flaky tests, zero for no retries (default: no retries). |
108
107
|`--run-agents <mode>`| Run agents to generate the code for `page.perform`. Possible values are "missing", "all" and "none" (default: "none"). See [test-agents](./test-agents.md). |
109
108
|`--shard <shard>`| Shard tests and execute only the selected shard, specified in the form "current/all", 1-based, e.g., "3/5". |
Copy file name to clipboardExpand all lines: docs/src/test-reporter-api/class-reporter.md
-2Lines changed: 0 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -74,8 +74,6 @@ export default defineConfig({
74
74
});
75
75
```
76
76
77
-
When `--reporter-only-failures` is set, custom reporters receive `onlyFailures: true` in their constructor options.
78
-
79
77
Here is a typical order of reporter calls:
80
78
*[`method: Reporter.onBegin`] is called once with a root suite that contains all other suites and tests. Learn more about [suites hierarchy][Suite].
81
79
*[`method: Reporter.onTestBegin`] is called for each test run. It is given a [TestCase] that is executed, and a [TestResult] that is almost empty. Test result will be populated while the test runs (for example, with steps and stdio) and will get final `status` once the test finishes.
Copy file name to clipboardExpand all lines: docs/src/test-reporters-js.md
+5-7Lines changed: 5 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -52,7 +52,7 @@ export default defineConfig({
52
52
53
53
### Report only failures
54
54
55
-
Use `onlyFailures` with the JSON, JUnit, or HTML reporter to include only failed, flaky, and interrupted tests. Every attempt of an included test is retained, including successful retries:
55
+
Use `onlyFailures` with the JSON, JUnit, or HTML reporter to include only tests with unexpected outcomes (including unexpected passes), flaky tests, and interrupted tests. Flaky tests are included even when they pass on retry. Every attempt of an included test is retained, including successful retries:
56
56
57
57
```js title="playwright.config.ts"
58
58
import { defineConfig } from'@playwright/test';
@@ -62,12 +62,7 @@ export default defineConfig({
62
62
});
63
63
```
64
64
65
-
The command line flag enables this option for all configured reporters that support it:
66
-
67
-
```bash
68
-
npx playwright test --reporter=failures,html --reporter-only-failures
Configure `onlyFailures` independently for each reporter. To use it when merging blob reports, pass the configuration file to `npx playwright merge-reports --config=playwright.config.ts ./blob-report`.
71
66
72
67
Use the `failures` reporter for live terminal diagnostics without progress output. For example, retain a complete HTML report alongside concise terminal output:
73
68
@@ -355,6 +350,7 @@ HTML report supports the following configuration options and environment variabl
| `PLAYWRIGHT_HTML_TITLE` | `title` | A title to display in the generated report. | No title is displayed by default
353
+
| `PLAYWRIGHT_HTML_ONLY_FAILURES` | `onlyFailures` | Include only tests with unexpected outcomes, flaky tests (including successful retries), and interrupted tests. See [Report only failures](#report-only-failures). | `false`
358
354
| `PLAYWRIGHT_HTML_OUTPUT_DIR` | `outputFolder` | Directory to save the report to. | `playwright-report`
359
355
| `PLAYWRIGHT_HTML_OPEN` | `open` | When to open the html report in the browser, one of `'always'`, `'never'` or `'on-failure'` | `'on-failure'`
360
356
| `PLAYWRIGHT_HTML_HOST` | `host` | When report opens in the browser, it will be served bound to this hostname. | `localhost`
@@ -460,6 +456,7 @@ JSON report supports following configuration options and environment variables:
| `PLAYWRIGHT_JSON_OUTPUT_DIR` | | Directory to save the output file. Ignored if output file is specified. | `cwd` or config directory.
459
+
| `PLAYWRIGHT_JSON_ONLY_FAILURES` | `onlyFailures` | Include only tests with unexpected outcomes, flaky tests (including successful retries), and interrupted tests. See [Report only failures](#report-only-failures). | `false`
463
460
| `PLAYWRIGHT_JSON_OUTPUT_NAME` | | Base file name for the output, relative to the output dir. | JSON report is printed to the stdout.
464
461
| `PLAYWRIGHT_JSON_OUTPUT_FILE` | `outputFile` | Full path to the output file. If defined, `PLAYWRIGHT_JSON_OUTPUT_DIR` and `PLAYWRIGHT_JSON_OUTPUT_NAME` will be ignored. | JSON report is printed to the stdout.
465
462
@@ -498,6 +495,7 @@ JUnit report supports following configuration options and environment variables:
| `PLAYWRIGHT_JUNIT_OUTPUT_DIR` | | Directory to save the output file. Ignored if output file is specified. | `cwd` or config directory.
498
+
| `PLAYWRIGHT_JUNIT_ONLY_FAILURES` | `onlyFailures` | Include only tests with unexpected outcomes, flaky tests (including successful retries), and interrupted tests. Retains every attempt regardless of `includeRetries`. See [Report only failures](#report-only-failures). | `false`
501
499
| `PLAYWRIGHT_JUNIT_OUTPUT_NAME` | | Base file name for the output, relative to the output dir. | JUnit report is printed to the stdout.
502
500
| `PLAYWRIGHT_JUNIT_OUTPUT_FILE` | `outputFile` | Full path to the output file. If defined, `PLAYWRIGHT_JUNIT_OUTPUT_DIR` and `PLAYWRIGHT_JUNIT_OUTPUT_NAME` will be ignored. | JUnit report is printed to the stdout.
503
501
| `PLAYWRIGHT_JUNIT_STRIP_ANSI` | `stripANSIControlSequences` | Whether to remove ANSI control sequences from the text before writing it in the report. | By default output text is added as is.
Copy file name to clipboardExpand all lines: packages/playwright/src/program.ts
-2Lines changed: 0 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -129,7 +129,6 @@ function addMergeReportsCommand(program: Command) {
129
129
});
130
130
command.option('-c, --config <file>',`Configuration file. Can be used to specify additional configuration for the output report.`);
131
131
command.option('--reporter <reporter>',`Reporter to use, comma-separated, can be ${builtInReporters.map(name=>`"${name}"`).join(', ')} (default: "${config.defaultReporter}")`);
132
-
command.option('--reporter-only-failures','Only include tests with failures in JSON, JUnit, and HTML reports');
['--repeat-each <N>',{description: `Run each test N times (default: 1)`}],
233
232
['--reporter <reporter>',{description: `Reporter to use, comma-separated, can be ${builtInReporters.map(name=>`"${name}"`).join(', ')} (default: "${config.defaultReporter}")`}],
234
-
['--reporter-only-failures',{description: `Only include tests with failures in JSON, JUnit, and HTML reports`}],
235
233
['--retries <retries>',{description: `Maximum retry count for flaky tests, zero for no retries (default: no retries)`}],
236
234
['--run-agents <mode>',{description: `Run agents to generate the code for page.perform`,choices: ['missing','all','none'],preset: 'none'}],
237
235
['--shard <shard>',{description: `Shard tests and execute only the selected shard, specify in the form "current/all", 1-based, for example "3/5"`}],
0 commit comments