Playwright is a framework for automating and testing web pages across Chromium, Firefox, and WebKit using a single API. It ships as several tools built around that same underlying automation engine: a full end-to-end test runner, a command-line tool built for coding agents, an MCP server for LLM-driven browser control, a library for writing custom automation scripts, and a VS Code extension for authoring and debugging tests. It's built for developers who need reliable, cross-browser testing or scripting, and increasingly for AI coding agents that need to drive a real browser.
getByRole, getByLabel, getByPlaceholder, and getByTestId.npx playwright show-trace.Playwright fits teams that need dependable end-to-end tests across multiple real browser engines, especially where flaky, timeout-based tests have been a problem elsewhere, since its auto-waiting and web-first assertions are designed specifically to reduce that flakiness. It also fits developers writing browser automation scripts outside of testing (scraping, PDF generation, screenshot pipelines) via the Library, and teams building or using AI coding agents that need to drive a browser through either the CLI or the MCP server.
It's a heavier tool than needed if you only ever test in one browser engine and don't care about cross-browser coverage, where a lighter, single-engine tool might be simpler to set up. It's also primarily aimed at browser-level testing; it's not a unit testing framework, so you'd still pair it with something like Jest or Vitest for logic-level tests that don't need a real browser. Teams outside the JavaScript/TypeScript ecosystem are still covered, since Playwright is also officially available for Python, .NET, and Java, so a mixed-language organization doesn't need a separate tool per stack.
For end-to-end testing with Playwright Test:
npm init playwright@latest
Or add it manually:
npm i -D @playwright/test
npx playwright install
Run tests with:
npx playwright test
For the CLI aimed at coding agents:
npm install -g @playwright/cli@latest
For the MCP server, add this to your MCP client configuration:
{
"mcpServers": {
"playwright": {
"command": "npx",
"args": ["@playwright/mcp@latest"]
}
}
}
Or, for Claude Code specifically:
claude mcp add playwright npx @playwright/mcp@latest
To use Playwright as a plain automation library:
npm i playwright
The VS Code extension is installed separately from the Marketplace and adds test running, debugging, and code generation, recording your interactions into test code, directly in the editor. Optional skills can be added to the CLI for richer agent integration with playwright-cli install --skills, and playwright-cli show opens a dashboard with live screencast previews of running browser sessions that you can click into and take remote control of.