microsoft /playwright

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

★ 100,250⑂ 6,881👁 619⑃ 21,930● 18,540▤ 170
TypeScriptApache-2.0Created 2019-11-15playwright.dev
Download: v1.65.1v1.65.1 ↓1.65.12026-11-13
+77
Daily
+601
Weekly
100,250
stars
6,881
forks
619
watchers
21,930
prs
18,540
issues
170
releases

README

🎭 Playwright

    

 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

bash
npm init playwright@latest


Or add manually:

bash
npm i -D @playwright/test
npx playwright install


 Write a test

TypeScript
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

bash
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:

TypeScript
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:

TypeScript
// 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:

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


bash
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 automa

Top issues

Latest release

v1.65.1 v1.65.1 2026-11-13
Bug Fixes

- 43936 [Regression]: decorated class with a static field fails to load in 1.65 ("_initClass is not a function") with useDefineForClassFields: false
- 43934 [Bug]: Test locations are one column off under Bun 1.4.4+

 Browser Versions

- Chromium 159.0.8154.6
- Mozilla Firefox 159.0
- WebKit 27.2

News & coverage (17)

Hacker NewsPlaywright: Automate Chromium, WebKit and Firefox▲ 383 · 140 comments · 2022-01-26Hacker NewsPlaywright Tools for MCP▲ 181 · 34 comments · 2025-03-26Hacker NewsPlaywright for .NET is now stable▲ 155 · 64 comments · 2021-06-10Hacker NewsPlaywright CLI – Open/inspect/emulate pages, generate screenshots, record users▲ 134 · 21 comments · 2020-09-18Hacker NewsPlaywright-test – cross-browser end-to-end test suite with Playwright▲ 101 · 26 comments · 2021-04-05Hacker NewsMicrosoft Playwright: Automate Chromium, WebKit and Firefox▲ 43 · 3 comments · 2020-01-23noteValidating APIs During Playwright Tests with Postman2026-10-27StreetInsider.comBest AI Testing Platform, Amikoo, Launches Workers to Automate End-to-End Playwright Tests for Every Pull Request2026-10-27noteI also automated posting note articles—drafts are now automatically entered using a free public script2026-10-21learnPlaywright MCP server for Power Platform testing2026-04-17
7 morelearnQuickstart: Set up continuous end-to-end testing with Playwright Workspaces2025-08-06Online RecruitmentMastering Playwright: A Comprehensive Guide to Modern Automation Testing2024-11-11Amazon Web Services (AWS)Extending AWS Transform custom with MCP Servers for End-to-End Code Modernization2026-08-12The GitHub BlogCopilot code review: Agent skills and MCP now generally available2026-07-29The GitHub BlogHow to debug a web app with Playwright MCP and GitHub Copilot2025-09-05The GitHub BlogCopilot coding agent now has its own web browser2025-07-02SnykHow to add Playwright tests to your pull request CI with GitHub Actions2022-10-14

Snapshot: 2026-11-16T09:23:14Z · Data license Apache-2.0 · JSON