Skip to content

playwright

Use when working with Playwright for E2E testing, browser automation, cross-browser testing, test generation, or visual comparison. Also use when setting up Playwright in a project, writing page object models, or debugging test failures with trace viewer.

ModelSourceCategory
sonnetcoreTesting
Full Reference

Cross-browser E2E testing framework by Microsoft. v1.58.2 (Jan 30, 2026) — Chromium 145, Firefox 146, WebKit 26.0. Auto-waiting, network interception, built-in test runner.

ItemValue
Installnpm init playwright@latest
Run testsnpx playwright test
UI modenpx playwright test --ui
Debugnpx playwright test --debug
Codegennpx playwright codegen [url]
Reportnpx playwright show-report
Trace viewernpx playwright show-trace trace.zip
Node.js20+ recommended (18 deprecated)
FileContents
reference/config.mdInstallation, playwright.config.ts, baseURL, timeouts, projects, reporter
reference/selectors.mdgetByRole, getByText, getByTestId, CSS/XPath, chaining, frame locators
reference/actions.mdclick, fill, select, drag, hover, keyboard, upload, scroll
reference/assertions.mdexpect() API, soft assertions, custom matchers, polling
reference/fixtures.mdTest structure, describe, annotations, custom fixtures, built-in fixtures, steps
reference/network.mdroute(), mock responses, HAR recording, API testing without browser
reference/auth.mdstorageState, multi-role auth, global setup, IndexedDB, .gitignore
reference/visual.mdtoHaveScreenshot(), update-snapshots, thresholds, masking, viewports, deterministic checklist
reference/component-testing.md@playwright/experimental-ct-react, mount, component fixtures, Vue/Svelte
reference/parallel.mdsharding, workers, test.describe.parallel, serial tests, CI distribution
reference/ci.mdGitHub Actions, Docker, browser caching, sharded CI, artifacts
reference/debugging.mdTrace viewer, playwright inspector, page.pause(), video, screenshots on failure
reference/navigation.mdgoto, waitForURL, waitForLoadState, auto-waiting, dialogs
reference/changelog.mdv1.50–v1.58 new features, breaking changes, deprecations