# Playwright

CreateWithAI Hub page: https://createwithaihub.com/open-source/playwright
Latest version of this file: https://createwithaihub.com/open-source/playwright.md

- Type: Library · Category: Libraries & Open Source
- Publisher: Microsoft (official)
- Pricing: Free · License: Apache-2.0
- Works with: Claude Code, VS Code, OpenAI Codex, OpenCode
- Runs on: macOS, Windows, Linux

Microsoft's open-source framework for end-to-end testing and browser automation across Chromium, Firefox and WebKit.

Playwright is Microsoft's framework for web testing and automation that drives Chromium, Firefox and WebKit through one API. It includes Playwright Test, a test runner with auto-waiting, web-first assertions, isolated browser contexts, parallel runs and a trace viewer, and a library for scripts such as scraping, PDFs and screenshots, with bindings for TypeScript/JavaScript, Python, .NET and Java. This entry is the framework itself; Playwright MCP, the separate MCP server built on it for AI agents, has its own entry, and the related Playwright CLI and Test Agents target coding agents.

Useful for: Writing end-to-end tests for a signup flow that run headless in CI on Chromium, Firefox and WebKit, with traces saved on failure.

## Key features

- Playwright Test runner: auto-wait, web-first assertions, role-based locators, test isolation and parallelism
- Trace Viewer, screenshots and video on failure; codegen and locator picking in the VS Code extension
- Library mode for browser scripts: screenshots, PDFs, device emulation and network interception
- Test Agents (planner, generator, healer) set up with npx playwright init-agents for VS Code, Claude, Codex or OpenCode
- Playwright CLI (@playwright/cli) for coding agents, described as more token-efficient than MCP
- Bindings for TypeScript/JavaScript, Python, .NET and Java

## Connection

- Language: Python, TypeScript / JS

## Before you start

- Node.js 22.x, 24.x or 26.x (for the Node.js version)

## Install steps from the official documentation

New test project:

```
npm init playwright@latest
```

Add to an existing project:

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

Library only:

```
npm i playwright
```

Test Agents for Claude Code:

```
npx playwright init-agents --loop=claude
```

## Limitations

- Node.js runner requires Node.js 22, 24 or 26
- Supported OS: Windows 11+ / Server 2019+ / WSL, macOS 14+, Debian 12/13 and Ubuntu 22.04/24.04/26.04
- Downloads its own browser builds (Chrome for Testing by default for Chromium)
- Not an MCP server by itself; use Playwright MCP for MCP clients

## Official links

- Website: https://playwright.dev
- Source repository: https://github.com/microsoft/playwright
- Documentation: https://playwright.dev/docs/intro
- Source: https://github.com/microsoft/playwright (README: Playwright Test, CLI, MCP, Library and VS Code extension; cross-browser table; other languages; Apache-2.0; not archived)
- Source: https://playwright.dev/docs/intro (System requirements (Node.js 22/24/26, OS versions) and install commands)
- Source: https://playwright.dev/docs/test-agents (Planner, generator and healer agents; init-agents loops vscode, claude, codex, opencode)
