Lesson 1 of 12Beginner
What is Playwright & Why Use It
What is Playwright?
Playwright is an open-source end-to-end (E2E) testing framework from Microsoft. It drives a real browser the way a user would — clicking, typing, navigating — and lets you assert that your app behaves correctly.
Why teams pick it
- One API, three engines — Chromium, Firefox and WebKit (Safari) from the same test.
- Auto-waiting — it waits for elements to be actionable before interacting, which kills most "flaky test" problems.
- Fast & parallel — tests run in isolated browser contexts, in parallel, by default.
- Great tooling — a code generator, an inspector, and a Trace Viewer that records a full timeline of every action.
Install it
npm init playwright@latest
This scaffolds a tests/ folder, a playwright.config.ts, installs the browsers, and adds an example test.
Key takeaways
- Playwright automates a real browser across Chromium, Firefox and WebKit.
- Its auto-waiting model is the main reason tests stay stable.
npm init playwright@latestgives you a working project in one command.