Appearance
Install
System requirements
- Node.js 22.x, 24.x, or 26.x
- Windows 11+, macOS 14+, or a modern Linux distribution
Scaffold a new Playwright project
The recommended path is the init scaffolder. It creates playwright.config.ts, an example test, a GitHub Actions workflow (optional), and installs browser binaries.
bash
npm init playwright@latestOr with yarn or pnpm:
bash
yarn create playwright
pnpm create playwrightThe interactive installer asks:
- TypeScript or JavaScript?
- Where to put tests? (default:
tests/) - Add a GitHub Actions workflow? (optional)
- Install Playwright browsers? (yes -- required for first run)
Add to an existing project
bash
npm install --save-dev @playwright/test
npx playwright installnpx playwright install downloads Chromium, Firefox, and WebKit binaries into the local cache. To install only one browser:
bash
npx playwright install chromiumTemplate / starter
Running npm init playwright@latest scaffolds a complete starter. The generated files are:
playwright.config.ts # configuration: browsers, base URL, retries, reporters
tests/
example.spec.ts # two working example tests
tests-examples/
demo-todo-app.spec.ts # full demo against a sample todo appNo separate downloadable template repo is needed; the scaffolder IS the official starter.
Verify the install
bash
npx playwright --versionExpected output (version number will vary):
Version 1.x.x