Playwright logo

Playwright

by Microsoft

Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API, enabling cross-browser web automation that is ever-green, capable, reliable and fast.

View on GitHub

Last updated: N/A

What is Playwright?

Playwright is a framework for reliable end-to-end testing for modern web apps. It supports Chromium, Firefox, and WebKit browsers and offers features like auto-waiting, web-first assertions, and tracing to eliminate flaky tests.

How to use Playwright?

Playwright can be installed using npm. The easiest way to get started is to use the init command: npm init playwright@latest. This will create a configuration file and optionally add examples. Alternatively, you can manually add the dependency and install browsers using npm i -D @playwright/test and npx playwright install.

Key features of Playwright

  • Resilient with auto-wait and web-first assertions

  • Supports multiple browsers (Chromium, Firefox, WebKit)

  • Full isolation with browser contexts

  • Powerful tooling including Codegen, Playwright inspector, and Trace Viewer

Use cases of Playwright

  • Automated web testing

  • Cross-browser compatibility testing

  • UI testing

  • Web scraping and automation

FAQ from Playwright

What browsers does Playwright support?

Playwright supports Chromium, Firefox, and WebKit.

What languages are supported?

Playwright supports TypeScript, JavaScript, Python, .NET, and Java.

How does Playwright handle flaky tests?

Playwright has features like auto-wait, web-first assertions, and tracing to eliminate flaky tests.

What is a browser context?

A browser context is equivalent to a brand new browser profile, providing full test isolation with zero overhead.

What is Codegen?

Codegen generates tests by recording your actions, which can then be saved into any supported language.