Setup

Run Playwright Tests

Run Playwright tests in headless, headed, UI, debug, browser-specific, and report modes.

Basic Run Commands

npx playwright test
npx playwright test tests/login.spec.ts

Headed, UI, and Debug Modes

npx playwright test --headed
npx playwright test --ui
npx playwright test --debug

Project and Browser Runs

npx playwright test --project=chromium
npx playwright test --project=firefox

Reports and Artifacts

npx playwright show-report

Common Run Errors

  • Test file path is wrong.
  • Browser dependencies are missing.
  • Base URL is not configured.
  • A previous app server is not running.
  • The test depends on data that does not exist.