"The trace viewer is the single biggest reason to switch from Cypress."
UI Mode — the Local Test Dashboard
npx playwright test --ui opens a desktop-app-like dashboard inside a browser window. The left panel lists every test in your suite; click one to run it, watch it execute live in a small embedded browser, scrub through the timeline of actions, and inspect the DOM at any moment. It's the codification of the live debugging loop.
Features that earn the install:
- Watch mode — UI mode auto-reruns tests when their source files change. Edit a spec, save, see the new run instantly.
- Pick locator — hover any DOM element in the embedded preview, get the suggested Playwright selector.
- Time-travel scrubbing — slide through the test's action timeline; the preview shows the DOM at that moment, the network panel shows requests in flight, the console shows logs.
- Filter by status — show only failed / flaky / passed, filter by project or tag.
The Trace Viewer — the Forensic Tool
When a test fails, Playwright (if traces are enabled) records EVERYTHING: every action, before/after DOM snapshots, network requests, console messages, screenshots, test source lines, error stack trace. The package is a .zip in test-results/. Open it with npx playwright show-trace path/to/trace.zip — or drop it on trace.playwright.dev — and you get the same UI as Live mode, but for a past run.
The killer use case is CI failures. A test fails in CI, the terminal says "Locator expected to be visible, was hidden," and you can't reproduce it locally. Download the trace artifact from the CI run, open it, scrub to the failure, see the actual DOM at that exact moment — usually it tells you immediately what was different (a modal that didn't close, a timing issue, a different copy because of i18n).
use: { trace: 'on-first-retry' } in your config is the default for a reason — zero overhead on success, full forensics on failure. The minor disk-space cost is nothing compared to the debugging hours it saves.What the Trace Shows You
- Action timeline — every click, fill, wait, with timing.
- DOM snapshots — interactive (you can inspect, not just see) for each action, before and after.
- Network panel — every request, method, status, response. Filter by failed.
- Console panel — every console.log/warn/error from the page.
- Source panel — your test code with the current line highlighted.
- Errors — the failure with full stack trace.
Sharing Traces
The .zip is self-contained. Upload it as a CI artifact, attach to a bug report, send it to a teammate — they open it with the same tool and see exactly what you saw. No 'works on my machine' debate.
Screenshots and Video — Optional Lighter-Weight Records
Traces are heavy (multi-MB per failure). For lighter-weight failure records, enable screenshot: 'only-on-failure' and video: 'retain-on-failure' in use. These give you a final-state screenshot and a video of the run, respectively. Less detail than a trace, but smaller files and faster to glance at.