Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more

To install Playwright Test, run npm init playwright@latest in your project and follow the prompts. The initializer sets up the test runner and can download its browser binaries; if you skip that step, install browsers separately with npx playwright install. Linux and CI machines may also need operating-system dependencies.

Before you install Playwright

Playwright’s official installation documentation currently lists Node.js 22.x, 24.x, or 26.x. Its listed operating systems 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, so check the official installation page and your project’s runtime constraints before setup.

How to install Playwright Test in an existing project

Run the initializer from the project directory. It can also start a new project if you run it outside an existing one.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  1. Open a terminal in the project directory.

  2. Run npm init playwright@latest. With Yarn, use yarn create playwright; with pnpm, use pnpm create playwright.

  3. Answer the prompts. Choose TypeScript or JavaScript (TypeScript is the default), the test directory, whether to add a GitHub Actions workflow, and whether to install the browsers. The directory is normally tests; if a tests directory already exists, the initializer uses e2e.

  4. Review the generated files and run the starter test. The initializer creates a configuration file, a test folder and starter test, plus a package manifest and lockfile as applicable. Running it again does not overwrite existing tests.

The initializer sets up Playwright Test, whose package is @playwright/test. Use this runner when you want its test fixtures, assertions, isolation and test-running tools.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Do you need to install browsers separately?

Playwright’s JavaScript package and its browser binaries are separate parts of setup. The initializer can install the browsers during setup. If you declined or need to install them later, run npx playwright install from the project directory. This installs the default supported browser set: Chromium, Firefox and WebKit. To install only Chromium, run npx playwright install chromium.

The default Playwright Test scaffold configures projects for Chromium, Firefox and WebKit. You can run a configured browser project with npx playwright test --project=chromium. For one visible browser run, use npx playwright test --headed; for the interactive test UI, use npx playwright test --ui. To open the HTML report after a run, use npx playwright show-report.

Playwright Test or the Playwright library?

These are different installation paths for different jobs. Playwright Test is the testing framework installed by the initializer. If you are building custom browser automation rather than using its test runner, the Playwright library documentation uses the playwright package. That workflow also needs browser binaries; for example, install them with npx playwright install chromium firefox webkit.

Installing Playwright on Linux and in CI

On Linux or a CI machine, browser binaries may not be enough: the machine may lack system libraries Playwright browsers require. To install browsers along with their operating-system dependencies, use npx playwright install --with-deps. To install dependencies for just Chromium, use npx playwright install-deps chromium.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

A typical npm CI sequence is:

npm ci
npx playwright install --with-deps
npx playwright test

Commit the project’s lockfile so npm ci installs the locked dependency set. Playwright’s CI guide recommends one worker by default in CI for stability and reproducibility. Increase parallelism only when the runner has enough capacity and the test suite remains reliable.

Which Playwright browser should you install?

Start with the default Chromium, Firefox and WebKit builds when you need cross-browser coverage. A single-browser installation can reduce downloads when your immediate task only requires one engine. Playwright can also target branded Chrome and Edge channels when those browsers are available or installed, which is useful for testing against those specific browsers.

Do not treat Playwright’s browser builds as interchangeable with all branded browsers. Its Firefox and WebKit builds include Playwright-specific patches; branded Firefox and Safari are not simple substitutions. Platform-dependent behavior, including media codecs, can differ. For Safari-like behavior, Playwright’s browser documentation recommends running WebKit on macOS for scenarios such as video playback. See the browser documentation when selecting channels or diagnosing platform differences.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Common installation issues and maintenance

For exact options and current behavior, consult the Playwright CLI reference.

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.