RepoPilotOpen in app →

microsoft/playwright

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

GO

Healthy across the board

  • Last commit today
  • 5 active contributors
  • Distributed ownership (top contributor 35%)
  • Apache-2.0 licensed
  • CI configured
  • Tests present
  • Small team — 5 top contributors

Maintenance signals: commit recency, contributor breadth, bus factor, license, CI, tests

Embed this verdict

[![RepoPilot: GO](https://repopilot.app/api/badge/microsoft/playwright)](https://repopilot.app/r/microsoft/playwright)

Paste into your README — the badge live-updates from the latest cached analysis.

Onboarding doc

Onboarding: microsoft/playwright

Generated by RepoPilot · 2026-05-05 · Source

Verdict

GO — Healthy across the board

  • Last commit today
  • 5 active contributors
  • Distributed ownership (top contributor 35%)
  • Apache-2.0 licensed
  • CI configured
  • Tests present
  • ⚠ Small team — 5 top contributors

<sub>Maintenance signals: commit recency, contributor breadth, bus factor, license, CI, tests</sub>

TL;DR

Playwright is a cross-browser end-to-end testing and web automation framework that drives Chromium, Firefox, and WebKit through a single unified TypeScript/JavaScript API. It solves the problem of reliable browser automation by providing auto-waiting, web-first assertions, browser contexts for isolation, and a full test runner (@playwright/test) — plus newer modes like MCP (Model Context Protocol) server for AI agent integration and a CLI tool for coding assistants like Claude Code. Monorepo with browser-specific protocol implementations under packages/ (e.g. packages/playwright-core for the engine, packages/playwright-test for the test runner, packages/playwright for the user-facing bundle). Browser automation drivers live in src/ with per-browser subdirectories; .claude/skills/playwright-dev/ contains internal engineering guides for the trace system, API design, browser vendoring, and dashboard tooling.

Who it's for

Frontend and full-stack engineers who need reliable, fast end-to-end test coverage across multiple browsers without flakiness from manual sleep/wait calls. Also increasingly targeted at AI agent developers who need a structured browser automation interface (via @playwright/mcp and @playwright/cli). Contributors are typically Microsoft employees and OSS contributors working in TypeScript/C++.

Maturity & risk

Extremely mature and production-ready — Playwright is maintained by Microsoft, has millions of weekly npm downloads, and has been in active development since ~2020. The repo has extensive CI coverage across .github/workflows/ (tests_primary.yml, tests_secondary.yml, tests_video.yml, tests_bidi.yml, tests_components.yml, etc.) and ships versioned browser binaries for Chromium, Firefox (149.0), and WebKit (26.4). Commit activity is continuous with automated browser roll workflows.

Very low risk for adoption — Microsoft-backed with multiple full-time maintainers, not a single-maintainer project. The main risk for contributors is the C++/Objective-C browser driver layer (98K+ C++ lines) which requires deep knowledge of browser internals. Breaking changes occur at major API boundaries but are well-documented via changelogs and the GEN: comment-based code generation system.

Active areas of work

Active work includes BiDi (WebDriver BiDi protocol) support (.github/workflows/tests_bidi.yml), MCP server integration (.github/workflows/tests_mcp.yml), rolling Node.js versions (.github/workflows/roll_nodejs.yml), and automated browser version bumps via roll_browser_into_playwright.yml. The .claude/ directory with SKILL.md files indicates active AI-assisted development tooling integration.

Get running

git clone https://github.com/microsoft/playwright.git && cd playwright && npm install && npx playwright install && npx playwright test

Daily commands: npx playwright test # run all tests npx playwright test --project=chromium # single browser npx playwright show-report # open HTML report npx playwright codegen https://example.com # record a test

Map of the codebase

  • CLAUDE.md — Top-level contributor guide describing build commands, test workflows, code conventions, and repo-specific rules every contributor must follow.
  • .claude/skills/playwright-dev/SKILL.md — Core skill definition for Playwright development, outlining the primary abstractions and development patterns used throughout the codebase.
  • .claude/skills/playwright-dev/api.md — Documents the public Playwright API surface, which is the contract all browser automation code must conform to across Chromium, Firefox, and WebKit.
  • .claude/skills/playwright-dev/trace_system_guide.md — Explains the trace recording and replay system, a load-bearing feature used for debugging and CI artifact analysis across all browser targets.
  • browser_patches/firefox/juggler/protocol/Protocol.js — Defines the Juggler wire protocol between Playwright and the patched Firefox browser, the foundational interface for all Firefox automation commands.
  • browser_patches/firefox/juggler/TargetRegistry.js — Manages Firefox browser targets (pages, frames, workers), the central registry that lifecycle events flow through on the Firefox side.
  • .github/workflows/tests_primary.yml — Primary CI workflow defining how all browser-specific test suites are executed, critical for understanding the project's testing matrix and release gates.

How to make changes

Add a new Juggler protocol command for Firefox

  1. Define the new command's parameter and return types in the protocol schema (browser_patches/firefox/juggler/protocol/Protocol.js)
  2. Implement the command handler method in the appropriate handler (Page or Browser) (browser_patches/firefox/juggler/protocol/PageHandler.js)
  3. If the command requires in-page JS access, add the corresponding method in the content-side agent (browser_patches/firefox/juggler/content/PageAgent.js)
  4. Update the dispatcher if the new command needs routing to a new handler class (browser_patches/firefox/juggler/protocol/Dispatcher.js)

Add a new network interception capability in Firefox

  1. Add the network event or modification hook inside the Firefox network observer (browser_patches/firefox/juggler/NetworkObserver.js)
  2. Expose the capability as a new protocol event or command (browser_patches/firefox/juggler/protocol/Protocol.js)
  3. Handle the new protocol message in the BrowserHandler or PageHandler (browser_patches/firefox/juggler/protocol/BrowserHandler.js)

Add a new CI test workflow for a new feature area

  1. Create a new workflow file following the existing pattern (trigger, matrix, steps) (.github/workflows/tests_others.yml)
  2. Reference the shared run-test action for consistent test execution setup (.github/actions/run-test/action.yml)
  3. Add blob report upload for result aggregation in CI (.github/actions/upload-blob-report/action.yml)

Add screencast/video capture support for a new scenario

  1. Implement the low-level frame capture logic in the C++ capturer (browser_patches/firefox/juggler/screencast/HeadlessWindowCapturer.cpp)
  2. Expose the new capture mode through the XPCOM screencast service (browser_patches/firefox/juggler/screencast/nsScreencastService.cpp)
  3. Update the IDL interface if adding a new method to the screencast service (browser_patches/firefox/juggler/screencast/nsIScreencastService.idl)

Why these technologies

  • Custom Firefox patch (Juggler protocol) — Firefox does not expose a Chrome DevTools Protocol endpoint natively; Juggler is a purpose-built automation protocol embedded into a patched Firefox build, giving Playwright full low-level control (network interception, JS contexts, etc.) without depending on incomplete WebDriver or CDP shims.
  • C++ for pipe transport and screencast — stdin/stdout IPC and frame capture require native OS-level performance and direct Firefox XPCOM API access that cannot be achieved from JavaScript content scripts.
  • Node.js for the Playwright library and test runner — Node.js provides the async I/O model needed to multiplex many browser protocol messages, a large ecosystem, and first-class TypeScript support for the public API.
  • GitHub Actions for CI — Large matrix of browser × OS × feature combinations requires scalable hosted runners; GitHub Actions native integration with the repo simplifies artifact management and PR gating.
  • TypeScript — Strong typing for a large, multi-browser API surface prevents regressions and enables IDE autocompletion for both internal contributors and end users.

Trade-offs already made

  • Maintaining a patched Firefox build (browser_patches/firefox)

    • Why: Needed to implement Juggler protocol features (e.g., reliable network interception, screencast) not available in stock Firefox.
    • Consequence: Every Firefox upstream update requires rebasing and validating the patch set, increasing maintenance burden and delaying Firefox version upgrades.
  • Single unified API across Chromium, Firefox, and WebKit

    • Why: Enables developers to write browser-agnostic tests and switch browsers with one config change.
    • Consequence: The API is constrained to the lowest common denominator of browser capabilities; browser-specific features must be exposed through workarounds or not at all.
  • Bundling browser binaries with npm packages

    • Why: Guarantees version compatibility between Playwright and the browser, eliminating 'works on my machine' browser version mismatches.
    • Consequence: Large download sizes and separate install step (playwright install); version pinning makes it harder to test against arbitrary browser versions.

    • Why: undefined
    • Consequence: undefined

Traps & gotchas

Browser binaries must be installed separately via 'npx playwright install' — tests will silently fail or error without them. The C++ and Objective-C browser patches (for WebKit especially) require platform-specific build toolchains that are non-trivial to set up locally; most contributors never touch this layer. The GEN: comment blocks in source files are auto-generated — manually editing generated sections will be overwritten. The merge.config.ts in .github/workflows/ controls merge queue behavior and has specific branch protection rules.

Architecture

Concepts to learn

  • Chrome DevTools Protocol (CDP) — Playwright communicates with Chromium browsers via CDP — understanding this wire protocol explains how page.evaluate(), network interception, and tracing work under the hood
  • Browser Context Isolation — Playwright's BrowserContext is the key isolation primitive — it gives each test a fresh cookie jar, localStorage, and permissions without launching a new browser process, enabling fast parallel tests
  • WebDriver BiDi Protocol — The next-generation browser automation protocol (W3C standard) that Playwright is actively implementing to replace CDP for cross-browser compatibility — visible in tests_bidi.yml
  • Auto-waiting and Actionability Checks — Playwright's core reliability feature — before acting on an element it checks visibility, stability, and interactability, eliminating most flaky test patterns
  • Model Context Protocol (MCP) — The protocol used by @playwright/mcp to expose browser automation as structured tool calls for LLM agents — a new usage pattern reflected in tests_mcp.yml and the CLI skill docs
  • Playwright Trace Format — Playwright records structured binary traces of test runs (network, screenshots, DOM snapshots) — the trace_system_guide.md in .claude/skills/ documents this internal format critical for the trace viewer
  • Web-first Assertions with Retry — Unlike Node.js assert, Playwright's expect() assertions poll until the condition is true within a timeout — understanding this prevents writing redundant manual waits in tests

Related repos

  • SeleniumHQ/selenium — The predecessor/alternative for cross-browser automation — Playwright was partly created by the same team as a more modern alternative to Selenium WebDriver
  • cypress-io/cypress — Direct competitor for end-to-end testing in the JavaScript ecosystem, takes a different architecture (in-browser test runner vs. out-of-process)
  • microsoft/playwright-python — Official Python bindings for the same Playwright browser automation engine
  • microsoft/playwright-dotnet — Official .NET/C# bindings for Playwright, maintained by Microsoft alongside this repo
  • puppeteer/puppeteer — Google's Chromium-only automation library — shares CDP-based approach for Chromium but lacks Firefox/WebKit support

PR ideas

To work on one of these in Claude Code or Cursor, paste: Implement the "<title>" PR idea from CLAUDE.md, working through the checklist as the task list.

Add integration tests for Firefox Juggler's NetworkObserver.js

The Firefox browser patch at browser_patches/firefox/juggler/NetworkObserver.js is a critical and complex custom networking layer unique to Playwright's Firefox implementation. It intercepts and modifies network requests/responses for Firefox's protocol bridge. This file has no dedicated test coverage visible in the repo structure, and bugs here can silently break network interception features (request interception, HAR recording, response modification) exclusively on Firefox. Adding targeted tests would catch regressions when Firefox is updated upstream.

  • [ ] Audit browser_patches/firefox/juggler/NetworkObserver.js to enumerate all public methods and event handlers (e.g., request interception, response body modification, auth challenge handling)
  • [ ] Create tests/firefox/networkobserver.spec.ts (or similar path matching repo conventions) covering: request abort, request continuation with modified headers, response interception, and multipart responses
  • [ ] Ensure tests run in the existing Firefox-specific CI workflow (.github/workflows/tests_primary.yml or tests_secondary.yml) by verifying the correct browserName filter is applied
  • [ ] Add edge-case tests for WebSocket upgrade requests passing through NetworkObserver, since this is a known tricky path in the juggler layer
  • [ ] Cross-reference with browser_patches/firefox/juggler/TargetRegistry.js to verify NetworkObserver lifecycle (attach/detach) is also covered

Add a dedicated GitHub Actions workflow for BiDi (WebDriver BiDi) protocol tests

The repo already has .github/workflows/tests_bidi.yml, but the dependency config snippet shows @playwright/test at ^1.17.1 which is very old relative to the current BiDi work. More importantly, the .claude/skills/playwright-dev/bisect-published-versions.md and the bidi workflow suggest active development on the BiDi protocol layer, yet there is no workflow that runs bisection-based regression detection for BiDi-specific failures across published npm versions. Adding a scheduled bisect workflow for BiDi would catch protocol regressions introduced between releases before they reach users.

  • [ ] Review .github/workflows/tests_bidi.yml to understand current BiDi test triggers and matrix
  • [ ] Create .github/workflows/bisect_bidi_regression.yml that triggers on a schedule (e.g., nightly) and uses the logic described in .claude/skills/playwright-dev/bisect-published-versions.md to bisect across recent npm published versions
  • [ ] Use the existing .github/actions/run-test/action.yml composite action as the test execution step to stay consistent with repo conventions
  • [ ] Parameterize the workflow to accept a test filter input so maintainers can manually trigger bisection for a specific BiDi test file
  • [ ] Add a step that posts bisection results as a GitHub issue comment or creates a new issue using the GitHub API, referencing .github/ISSUE_TEMPLATE/regression.yml as the template

Extract and document the Trace System internals from the skill guide into official /docs

The file .claude/skills/playwright-dev/trace_system_guide.md contains detailed internal documentation about Playwright's trace recording and viewing system — but this knowledge is buried in an internal Claude skill directory, completely inaccessible to open source contributors who need to understand the trace system to contribute to it. The public docs on playwright.dev cover trace usage but not the architecture. Surfacing this as a CONTRIBUTING guide for the trace system would dramatically lower the barrier for new contributors working on trace-related features or bugs.

  • [ ] Read .claude/skills/playwright-dev/trace_system_guide.md in full and identify all architectural components described (e.g., trace writer, trace viewer, snapshot system, network resource recording)
  • [ ] Create docs/trace-system-architecture.md in the repo root docs folder (or CONTRIBUTING/trace-system.md) covering: the data flow from browser event → trace file → viewer, the file format schema, and extension points
  • [ ] Cross-reference the new doc with .

Good first issues

  1. Add missing test coverage for the @playwright/mcp server paths visible in .github/workflows/tests_mcp.yml — the MCP integration is newer and likely has gaps. 2. Improve the .claude/skills/playwright-dev/vendor.md documentation with concrete step-by-step instructions for vendoring a new browser version, since this is a recurring task. 3. Add TypeScript type tests for the BiDi protocol types being added under tests_bidi.yml to catch regressions in the new WebDriver BiDi API surface.

Top contributors

Recent commits

  • f536e37 — fix(dashboard): close server in singleton handler on shutdown (#40626) (Skn0tt)
  • 70e061e — test: add test for issue #39160 (#40628) (aslushnikov)
  • c025980 — fix(har): stream HAR to disk to support files >512MB (#40616) (yury-s)
  • 7147fa2 — Revert "feat(tracing): add live option to startHar" (#40621) (yury-s)
  • 1109b9b — fix(mcp): recover from page renderer crash (#40617) (yury-s)
  • 9ed57f1 — Revert "fix(mcp): handle page crash event in Tab constructor" (#40619) (pavelfeldman)
  • 5263a48 — feat(electron): add timeout option to electronApp.close() for force-kill escalation (#40613) (Copilot)
  • 628d858 — fix(routing): throw on unbalanced braces in route glob patterns (#40614) (Copilot)
  • b25fbe4 — fix(cli): make install-deps --dry-run report missing packages (#40615) (pavelfeldman)
  • 0aec507 — fix(mcp): handle page crash event in Tab constructor (#40426) (o070256)

Security observations

Failed to generate security analysis.

LLM-derived; treat as a starting point, not a security audit.

Where to read next


Generated by RepoPilot. Verdict based on maintenance signals — see the live page for receipts. Re-run on a new commit to refresh.

GO · microsoft/playwright — RepoPilot Verdict