Viewing Reports
When to Use
Use
npx playwright show-reportwhen opening a generated report to triage failures. Never openindex.htmldirectly viafile://.
Decision
| Context | Default behavior |
|---|---|
| Local, run failed | Auto-opens browser to the report |
| Local, run passed | Does not auto-open |
CI (CI=true) |
Does not auto-open |
Pattern
Open latest report:
npx playwright show-report
Open specific report:
npx playwright show-report ./playwright-report
npx playwright show-report ./reports/run-2026-05-08
Change port or bind interface:
npx playwright show-report --port 8080
npx playwright show-report --host 0.0.0.0 # bind on all interfaces (LAN sharing)
Environment Variables
| 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
- Wrong: opening
index.htmlviafile://→ Right: trace viewer breaks; always useshow-reportor another HTTP server - Wrong: port
9323collision with no error handling → Right: use--portorPLAYWRIGHT_HTML_PORTto override - Wrong: running
show-reportfrom the wrong cwd and getting an old report → Right: always pass an explicit path