The UI mode is Playwright's secret weapon for productivity. Think of it as your test dashboard -- you see all your tests on the left, run them with a click, and see the results with screenshots, DOM snapshots, and network logs on the right. All without leaving the tool.
# Launch UI mode
npx playwright test --uiOpen UI mode: npx playwright test --ui
Click on a test file in the left panel to expand it
Click the green play button next to a test to run it
Watch the action timeline fill up with each step
Click on any step to see the screenshot and DOM at that moment
If a test fails, click the red step to see the error and the screenshot
Edit your test file in VS Code. UI mode auto-detects the change.
Click Run again -- the test re-runs instantly without restarting
UI mode keeps the browser context alive between runs. This means re-runs are blazing fast -- no cold start, no browser launch delay. This is why it is better than running npx playwright test --headed over and over.
Key Point: UI mode (--ui) is the fastest way to develop tests. Watch mode, screenshots at every step, DOM inspection, and instant re-runs.