To install Playwright Test in a JavaScript or TypeScript project, run npm init playwright@latest from the project directory. The setup wizard adds the test runner and can download its browser binaries; you can install browsers later with npx playwright install. On Linux or CI, use npx playwright install --with-deps when system browser dependencies are needed.
Check Playwright’s current system requirements
Playwright’s official installation documentation currently lists Node.js 22.x, 24.x, or 26.x. Supported operating systems listed there are Windows 11 or later, Windows Server 2019 or later, or WSL; macOS 14 (Sonoma) or later; and Debian 12/13 or Ubuntu 22.04/24.04/26.04 on x86-64 or arm64. These requirements can change with Playwright releases, so check the official installation page and your project’s runtime constraints before setup.
As an Amazon Associate I earn from qualifying purchases.
Use a supported Node.js version and run the setup command from the directory where you want the project files. If the project uses a different package manager, use its matching initializer command instead.
Quick wins for a faster PC:
Repair Windows errors before they cause bigger problemsFix Now →Scan for outdated or missing drivers - takes under a minuteDriver Scan →Install Playwright Test in a new or existing project
For Playwright’s end-to-end test runner, the official setup command is:
#1 Best Overall
npm init playwright@latest
You can run it in a new project directory or an existing JavaScript or TypeScript project. The equivalent commands for other package managers are:
yarn create playwrightpnpm create playwright
The wizard asks whether to use TypeScript or JavaScript (TypeScript is the default), where to put tests, whether to add a GitHub Actions workflow, and whether to install browser binaries. It normally uses a tests directory, or e2e when a tests directory already exists. Setup creates a configuration file, a package manifest and lockfile as applicable, a test directory, and a starter test. Running the initializer again does not overwrite existing tests. See the installation guide for the current wizard details.
Choose between Playwright Test and the browser automation library
Use Playwright Test when you want the end-to-end test runner, fixtures, assertions, test isolation, and runner tooling. Its initializer sets up the test framework as @playwright/test.
Recommended Free Tools
Rank #2
Use the playwright package if you are writing custom browser automation rather than tests managed by Playwright Test. The library setup is documented separately and also requires installing browser binaries, for example:
npm install playwright
npx playwright install chromium firefox webkit
Do not confuse installing a package with installing the browsers it controls. The library documentation covers the automation-library workflow.
Install the browser binaries
The setup wizard can install browsers as part of initialization. If you skipped that prompt or need to add browsers later, run:
npx playwright install
This installs the default supported browser set. To install only Chromium, use npx playwright install chromium; you can substitute another supported browser name. Installing one browser reduces downloads when you do not need cross-browser coverage. The browser documentation explains browser versions and installation options.
The Tool Desk
Outbyte PC Repair FREEClear out junk files and repair common Windows errorsFree Scan →Outbyte Driver Updater FREEScan for outdated or missing drivers - takes under a minuteDriver Scan →Playwright releases expect particular browser binaries. After updating Playwright, rerun the install command if the required binaries are missing or have changed. On Linux, CI, or a machine without required operating-system libraries, install browsers and their system dependencies together:
npx playwright install --with-deps
You can install dependencies for one browser, such as Chromium, with npx playwright install-deps chromium. The CLI also offers options including --only-shell for installing only Chromium’s headless shell and --no-shell to omit it; use these only when your headless or CI setup calls for them. The CLI reference lists the available flags.
Rank #4
Run the starter test and view its results
Run the generated tests with:
npx playwright test
The default Playwright Test scaffold configures Chromium, Firefox, and WebKit projects. To run only the configured Chromium project, use:
npx playwright test --project=chromium
To see the browser while tests run, add --headed. For the interactive test runner, use --ui. After a test run, open the HTML report with:
npx playwright show-report
These commands and the scaffold workflow are documented on the installation page.
Best Value
Use the right browser for the test
Playwright supports Chromium, Firefox, and WebKit. Its own browser builds are the straightforward default for broad browser coverage. You can also target branded Chrome and Edge channels when those browsers are available or installed, and use device emulation for mobile-like configurations.
Playwright’s Firefox and WebKit builds use Playwright-specific patches, so do not assume branded Firefox or Safari can be substituted directly. Platform-dependent capabilities, including media codecs, can differ. For the closest Safari-related behavior in cases such as video playback, the browser documentation recommends running WebKit on macOS. Check the browser guide when choosing channels or investigating platform differences.
Install Playwright in CI
A basic npm-based CI sequence installs the locked project dependencies, the browsers and required system packages, then runs tests:
npm ci
npx playwright install --with-deps
npx playwright test
The setup wizard can generate a GitHub Actions workflow, and Playwright’s CI guide provides configuration examples for CI providers. It recommends one worker in CI by default for stability and reproducibility; increase parallelism only when the runner has enough capacity and your test suite benefits from it.
Troubleshoot browser installation
If browser downloads fail, first confirm that the installed Playwright package and browser binaries are compatible, then rerun npx playwright install. Downloads normally come from Microsoft’s CDN. For restricted networks or unusual environments, the browser guide documents proxy and custom download-host configuration, custom certificates through NODE_EXTRA_CA_CERTS, and connection-timeout settings.
The same guide covers browser cache locations, shared or hermetic installation paths, listing installed browsers, and removing unused browser versions. These options are useful when downloads are blocked, the browser cache is not shared with the test process, or a CI image needs controlled browser storage.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.




