Chapter 35: Running tests and headed mode
Automation learning lab
Playwright Automation
Self Study Guide
Start from zero. Learn JavaScript and TypeScript, automate browsers, and build reliable end-to-end tests.
Running tests and headed mode
The test runner discovers spec files and can filter by file, test title or browser project. Headless mode usually does not show a browser window, while headed mode displays it. Use UI mode for interactive debugging.
How it works
Step-by-step walkthrough
- Run the full suite
- Run a single file
- Compare headed and UI mode
Example
npx playwright test
npx playwright test tests/first.spec.ts --headed
npx playwright test --uiAvoid interpreting a headed pass as proof a test is reliable.
Screenshot walkthrough

✎ Your practice task
Run only the configured chromium project.
Knowledge check
Which flag displays browser windows?
🌐 Continue learning
60-chapter learning path
Start at chapter 1, or choose any topic. Your progress is tracked separately for each chapter.
JavaScript fundamentals
TypeScript fundamentals
Playwright • setup & locators
Playwright • interactions & assertions
Playwright • framework & debugging
Playwright • real-world automation
Interactive practice lab
Try the controls below and observe the corresponding Playwright locator instructions. This browser demo does not execute Node.js or Playwright Test; copy the code to your local Playwright project to automate it.
Task manager demo
Suggested automation
Actions on the demo update these examples. In your local test use a page that contains the same controls.
Download a standalone lab page, then serve it locally (for example with Python's http.server). Navigate to it in a Playwright test.