Viewing Reports
When to Use
Opening a generated report to triage failures.
Pattern: Open Latest Report
npx playwright show-report
Defaults to http://localhost:9323.
Pattern: Open Specific Report
npx playwright show-report ./playwright-report
npx playwright show-report ./reports/run-2026-05-08
Pattern: Change Port / Host
npx playwright show-report --port 8080
npx playwright show-report --host 0.0.0.0 # bind on all interfaces (LAN sharing)
Why a Real HTTP Server?
show-report starts a small static server. This is required because traces and some XHR-loaded attachments need correct MIME types and same-origin fetches. Opening index.html via file:// breaks the trace viewer iframe.
Auto-Open Behavior
| Context | Default |
|---|---|
| Local, run failed | Auto-opens browser to the report |
| Local, run passed | Doesn't open |
CI (CI=true) |
Doesn't open |
Environment Variables (override config without editing)
| Var | Purpose |
|---|---|
PLAYWRIGHT_HTML_REPORT |
Override outputFolder |
PLAYWRIGHT_HTML_OPEN |
always | never | on-failure |
PLAYWRIGHT_HTML_HOST |
Bind host |
PLAYWRIGHT_HTML_PORT |
Bind port |
Common Mistakes
- Opening
index.htmlviafile://— trace viewer breaks; always useshow-reportor another HTTP server - Port
9323collision — error message is explicit; use--portorPLAYWRIGHT_HTML_PORT show-reportfrom wrong cwd — opens an old report from elsewhere; always pass an explicit path