Playwright

No Change
adopt
First Added:May 28, 2026 Updated: July 2, 2026

Playwright. Is Microsoft’s end-to-end test framework for modern web apps.

Summary

What it is: Node-first test runner (Python, Java, .NET ports exist) plus browser automation library, codegen, trace viewer, and UI mode for debugging.

When to use: default choice for web E2E on greenfield or migrated repos; cross-browser regression in Continuous Integration (especially GitHub Actions); API plus browser tests in one project; flaky-test reduction via auto-wait and trace replay.

When to skip: mobile-native apps (use dedicated mobile frameworks); simple smoke tests where a lightweight HTTP check suffices; legacy Cypress suites with no cross-browser requirement and no plan to consolidate.

Key capabilities: locators, network mocking, auth state reuse, visual comparisons, component testing (experimental), Docker images for CI.

Details

TopicNotes
Installnpm init playwright@latest scaffolds config and sample tests
Runnpx playwright test; --ui for interactive debug
CIOfficial GitHub Action; shard and retry built in
Tracestrace: 'on-first-retry' captures repro artifacts

Versus Selenium: Playwright ships browsers and waits; Selenium needs driver management and explicit sleeps more often. Prefer Playwright for new work; migrate Selenium incrementally.

Versus Cypress: Playwright runs multiple tabs/contexts and all major engines; Cypress historically centered Chromium and in-browser execution. Standardize on Playwright unless a team has a strong Cypress-only constraint.

Garden stance: Adopt for web E2E in the Test Pyramid layer above Unit Testing; wire into GitHub Actions required checks on pull requests.

References