playwright is a free, open source testing & quality assurance project written in TypeScript and released under Apache-2.0. It has 96,307 GitHub stars, 6,460 forks and 185 open issues, and was last pushed 7 hours ago. On this registry it ranks #1 of 3 tracked projects in Testing & Quality Assurance, with 5 head-to-head comparisons available.

What is playwright?

Playwright is an open-source, Apache-2.0 licensed TypeScript framework for web testing and browser automation that drives Chromium, Firefox, and WebKit through a single API, built for end-to-end testers, browser automation script writers, and AI coding agents.

What it is

Playwright is a web automation and testing framework published on npm and maintained under the Apache-2.0 licence. Its central promise is one API for three browser engines: the README pins Chromium 154.0.8037.0, Firefox 156.0, and WebKit 26.6, and the same code path drives all of them. The project ships as several entry points rather than one product — Playwright Test as a full-featured end-to-end test runner, Playwright CLI for coding agents, Playwright MCP for LLM-driven automation, Playwright Library for plain automation scripts, and a VS Code extension for authoring and debugging. Documentation and the API reference live at playwright.dev.

The concrete problem it solves is browser-driver fragmentation. Without it, a team testing across Chromium, Firefox, and WebKit maintains separate automation stacks and reconciles their differences by hand. Playwright replaces that with a single API plus a runner that handles parallelism, isolation, waiting, and retries natively. It also replaces the loose collection of browser scripts and ad hoc harnesses that automation work commonly accumulates: tests run in parallel by default across configured browsers, headless by default, and each test receives a fresh browser context equivalent to a clean browser profile.

Key capabilities

  • One API across Chromium 154.0.8037.0, Firefox 156.0, and WebKit 26.6, used in tests, scripts, and agent tooling.
  • Playwright Test runner, invoked with npx playwright test, running in parallel across all configured browsers.
  • Auto-waiting and web-first assertions: no artificial timeouts, with assertions retrying until conditions are met.
  • User-facing locators including page.getByRole, page.getByLabel, page.getByPlaceholder, and page.getByTestId.
  • Test isolation through a per-test browser context, with authentication state saved via storageState({ path: 'auth.json' }) and reused through test.use({ storageState: 'auth.json' }).
  • Tracing with screenshots and video on failure, configured as trace: 'on-first-retry' and inspected through npx playwright show-trace trace.zip in the Trace Viewer, which exposes actions, DOM snapshots, network requests, and console messages.
  • Playwright CLI via npm i -g @playwright/cli@latest, which the README describes as more token-efficient than MCP because commands avoid loading large tool schemas and accessibility trees into the model context.

Who uses it and how

  • End-to-end testing teams run Playwright Test in headless mode across configured browsers, parallel by default, with trace capture on first retry for CI debugging.
  • Coding agents such as Claude Code and Copilot use Playwright CLI for browser automation, chosen for lower token cost than loading MCP tool schemas.
  • AI agents and LLM-driven automation use Playwright MCP, started with npx @playwright/mcp@latest.
  • Developers and script authors use Playwright Library directly with npm i playwright for browser automation outside a test runner.
  • VS Code users install the ms-playwright.playwright extension from the Marketplace to author and debug tests in the editor. Registry topics also list electron and chrome coverage alongside firefox and webkit.

Getting started

The fastest path for end-to-end testing is npm init playwright@latest; adding it manually means npm i -D @playwright/test followed by npx playwright install. Full documentation and the API reference are hosted at playwright.dev.

How it compares

The facts provided name no competing tools and no list of paid products this project replaces, so no licence, hosting, or cost comparison can be drawn here. On the evidence available, it stands alone in this registry.

When to use it — and when not to

Adoption requires a Node.js and npm toolchain, since every install path runs through npm packages, and the browser binaries themselves arrive via npx playwright install. Teams that want a hosted, zero-install testing service, or that cannot run Node and npm in their build environment, are poor fits. The README excerpt also cuts off mid-sentence in the Playwright CLI section, so details for the CLI, MCP, Library, and VS Code paths rest on the homepage rather than on the repository text shown here; the project carries 185 open issues, and no release history was provided in the facts.

project readme (upstream, from github) — read inline

🎭 Playwright

npm version Chromium version Firefox version WebKit version Join Discord

Documentation | API reference

Playwright is a framework for web automation and testing. It drives Chromium, Firefox, and WebKit with a single API — in your tests, in your scripts, and as a tool for AI agents.

Get Started

Choose the path that fits your workflow:

Best for Install
Playwright Test End-to-end testing npm init playwright@latest
Playwright CLI Coding agents (Claude Code, Copilot) npm i -g @playwright/cli@latest
Playwright MCP AI agents and LLM-driven automation npx @playwright/mcp@latest
Playwright Library Browser automation scripts npm i playwright
VS Code Extension Test authoring and debugging in VS Code Install from Marketplace

Playwright Test

Playwright Test is a full-featured test runner built for end-to-end testing. It runs tests across Chromium, Firefox, and WebKit with full browser isolation, auto-waiting, and web-first assertions.

Install

npm init playwright@latest

Or add manually:

npm i -D @playwright/test
npx playwright install

Write a test

import { test, expect } from '@playwright/test';

test('has title', async ({ page }) => {
  await page.goto('https://playwright.dev/');
  await expect(page).toHaveTitle(/Playwright/);
});

test('get started link', async ({ page }) => {
  await page.goto('https://playwright.dev/');
  await page.getByRole('link', { name: 'Get started' }).click();
  await expect(page.getByRole('heading', { name: 'Installation' })).toBeVisible();
});

Run tests

npx playwright test

Tests run in parallel across all configured browsers, in headless mode by default. Each test gets a fresh browser context — full isolation with near-zero overhead.

Key capabilities

Auto-wait and web-first assertions. No artificial timeouts. Playwright waits for elements to be actionable, and assertions automatically retry until conditions are met.

Locators. Find elements with resilient locators that mirror how users see the page:

page.getByRole('button', { name: 'Submit' })
page.getByLabel('Email')
page.getByPlaceholder('Search...')
page.getByTestId('login-form')

Test isolation. Each test runs in its own browser context — equivalent to a fresh browser profile. Save authentication state once and reuse it across tests:

// Save state after login
await page.context().storageState({ path: 'auth.json' });

// Reuse in other tests
test.use({ storageState: 'auth.json' });

Tracing. Capture execution traces, screenshots, and videos on failure. Inspect every action, DOM snapshot, network request, and console message in the Trace Viewer:

// playwright.config.ts
export default defineConfig({
  use: {
    trace: 'on-first-retry',
  },
});
npx playwright show-trace trace.zip

Parallelism. Tests run in parallel by default across all configured browsers.

Full testing documentation


Playwright CLI

Playwright CLI is a command-line interface for browser automation designed for coding agents. It's more token-efficient than MCP — commands avoid loading large tool schemas and accessibility trees into the model context.

Install

npm install -g @playwright/cli@latest

Optionally install skills for richer agent integration:

playwright-cli install --skills

Usage

Point your coding agent at a task:

Test the "add todo" flow on https://demo.playwright.dev/todomvc using playwright-cli.
Take screenshots for all successful and failing scenarios.

Or run commands directly:

playwright-cli open https://demo.playwright.dev/todomvc/ --headed
playwright-cli type "Buy groceries"
playwright-cli press Enter
playwright-cli screenshot

Session monitoring

Use playwright-cli show to open a visual dashboard with live screencast previews of all running browser sessions. Click any session to zoom in and take remote control.

playwright-cli show

Full CLI documentation | GitHub


Playwright MCP

The Playwright MCP server gives AI agents full browser control through the Model Context Protocol. Agents interact with pages using structured accessibility snapshots — no vision models or screenshots required.

Setup

Add to your MCP client (VS Code, Cursor, Claude Desktop, Windsurf, etc.):

{
  "mcpServers": {
    "playwright": {
      "command": "npx",
      "args": ["@playwright/mcp@latest"]
    }
  }
}

One-click install for VS Code:

Install in VS Code

For Claude Code:

claude mcp add playwright npx @playwright/mcp@latest

How it works

Ask your AI assistant to interact with any web page:

Navigate to https://demo.playwright.dev/todomvc and add a few todo items.

The agent sees the page as a structured accessibility tree:

- heading "todos" [level=1]
- textbox "What needs to be done?" [ref=e5]
- listitem:
  - checkbox "Toggle Todo" [ref=e10]
  - text: "Buy groceries"

It uses element refs like e5 and e10 to click, type, and interact — deterministically and without visual ambiguity. Tools cover navigation, form filling, screenshots, network mocking, storage management, and more.

Full MCP documentation | GitHub


Playwright Library

Use playwright as a library for browser automation scripts — web scraping, PDF generation, screenshot capture, and any workflow that needs programmatic browser control without a test runner.

Install

npm i playwright

Examples

Take a screenshot:

import { chromium } from 'playwright';

const browser = await chromium.launch();
const page = await browser.newPage();
await page.goto('https://playwright.dev/');
await page.screenshot({ path: 'screenshot.png' });
await browser.close();

Generate a PDF:

import { chromium } from 'playwright';

const browser = await chromium.launch();
const page = await browser.newPage();
await page.goto('https://playwright.dev/');
await page.pdf({ path: 'page.pdf', format: 'A4' });
await browser.close();

Emulate a mobile device:

import { chromium, devices } from 'playwright';

const browser = await chromium.launch();
const context = await browser.newContext(devices['iPhone 15']);
const page = await context.newPage();
await page.goto('https://playwright.dev/');
await page.screenshot({ path: 'mobile.png' });
await browser.close();

Intercept network requests:

import { chromium } from 'playwright';

const browser = await chromium.launch();
const page = await browser.newPage();
await page.route('**/*.{png,jpg,jpeg}', route => route.abort());
await page.goto('https://playwright.dev/');
await browser.close();

Library documentation | API reference


VS Code Extension

The Playwright VS Code extension brings test running, debugging, and code generation d

readme truncated — read the full docs on github

Frequently asked questions

Is playwright free to use?

playwright is open source under the Apache-2.0 licence. There is no licence fee and no seat count — you can self-host it or, where the project offers one, pay a vendor for a managed version instead.

What does playwright do?

Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.

What is playwright written in?

playwright is primarily written in TypeScript. Its source is publicly available at https://github.com/microsoft/playwright, and it has 96,307 GitHub stars.