🚀 Feature Request
Add a built-in way to suppress passing tests from terminal output entirely, so only failures (plus the final summary) are printed.
Today the closest options are:
None of them get to "print nothing unless something failed."
Could equally be a quiet/failuresOnly option on the existing list reporter rather than a new reporter name.
Example
npx playwright test --reporter=only-failures
1) [chromium] › tests/checkout.spec.ts:42:3 › applies discount code
Error: expect(received).toBe(expected)
Expected: 1
Received: 0
44 | await page.getByRole('button', { name: 'Apply' }).click();
> 45 | expect(await rows.count()).toBe(1);
1 failed, 217 passed (1.2m)
Compared to today's line reporter on the same run, which prints 217 lines before the one that matters.
Motivation
On a large suite most runs are green, and the per-test lines are pure noise. They push the thing you actually care about off the top of the scrollback, and in CI they inflate log size for no benefit. Scanning hundreds of lines to find the one ✘ is a worse experience than being shown only the failure.
This has become sharper with coding agents. A tool call that runs the test suite returns its entire stdout into the model's context window, so a green run of 500 tests spends thousands of tokens saying "everything is fine." That context is finite and shared with the actual source files the agent needs to hold onto. Piping through grep is lossy and fragile, since it drops the stack trace and code frame that make a failure diagnosable. An official failures-only mode means the run costs near-zero context when it passes and full detail when it doesn't, which is exactly the shape you want.
Prior art: Bun added --only-failures for exactly this, alongside its dots reporter. Jest has jest-quiet-reporter in userland for the same reason.
Bun also ships an isAIAgent() check that reads AGENT=1 along with tool-specific variables, and Laravel Pint switches to --format agent when it detects CLAUDECODE, so tools adapting their output to agent context is an established pattern (see agentsmd/agents.md#136 for the push to standardize AGENT=1 as the agent equivalent of CI=true). Playwright could eventually default to failures-only under that signal, though an explicit flag is the useful first step and is valuable on its own.
A custom reporter works, but this seems common enough to be worth having out of the box.
🚀 Feature Request
Add a built-in way to suppress passing tests from terminal output entirely, so only failures (plus the final summary) are printed.
Today the closest options are:
--reporter=line, which still prints a status line per test--reporter=dot, which still prints a character per testlistwithprintFailuresInline(feat(list-reporter): add printFailuresInline option #40875), which prints failures as they happen but still prints one line per passing testNone of them get to "print nothing unless something failed."
Could equally be a
quiet/failuresOnlyoption on the existinglistreporter rather than a new reporter name.Example
npx playwright test --reporter=only-failuresCompared to today's
linereporter on the same run, which prints 217 lines before the one that matters.Motivation
On a large suite most runs are green, and the per-test lines are pure noise. They push the thing you actually care about off the top of the scrollback, and in CI they inflate log size for no benefit. Scanning hundreds of lines to find the one
✘is a worse experience than being shown only the failure.This has become sharper with coding agents. A tool call that runs the test suite returns its entire stdout into the model's context window, so a green run of 500 tests spends thousands of tokens saying "everything is fine." That context is finite and shared with the actual source files the agent needs to hold onto. Piping through
grepis lossy and fragile, since it drops the stack trace and code frame that make a failure diagnosable. An official failures-only mode means the run costs near-zero context when it passes and full detail when it doesn't, which is exactly the shape you want.Prior art: Bun added
--only-failuresfor exactly this, alongside its dots reporter. Jest hasjest-quiet-reporterin userland for the same reason.Bun also ships an
isAIAgent()check that readsAGENT=1along with tool-specific variables, and Laravel Pint switches to--format agentwhen it detectsCLAUDECODE, so tools adapting their output to agent context is an established pattern (see agentsmd/agents.md#136 for the push to standardizeAGENT=1as the agent equivalent ofCI=true). Playwright could eventually default to failures-only under that signal, though an explicit flag is the useful first step and is valuable on its own.A custom reporter works, but this seems common enough to be worth having out of the box.