What it is
Playwright is an open source library from Microsoft for automating web browsers. It drives Chromium, Firefox and WebKit through one API, so the same test can click, type and read a page in each engine the way a person would. Because it talks to the browser engines directly, tests run quickly and do not depend on a separate driver program.
Its test runner adds what end-to-end testing needs: automatic waiting for elements, parallel runs, screenshots, video and traces of failed tests. It can run headless on a server or with a visible browser, and it works from JavaScript, TypeScript, Python, Java and .NET. It also includes a code generator that records clicks into a test, and a trace viewer for stepping through a failure.
How I use it
- End-to-end tests for Rental Pilot's React web app run in Playwright.
- A smoke suite runs against production after every web deploy, and the deploy does not count as done until it passes.
- Part of a habit of rendering screens in a real browser and reading a screenshot before a change ships.
- Sits beside Vitest, which covers the unit tests.
Playwright is the right tool when you need to know the real screen works, not just that the code compiles. I reach for it because a green build has never been my bar for done. A deploy is not finished until a browser has signed in and checked the pages people depend on.
Questions
How do you know a deploy did not break the site?
Every Rental Pilot web deploy builds, syncs to S3, invalidates CloudFront and then runs a smoke suite against production. If the smoke suite fails, the deploy is not done.
Do you write automated tests?
Yes. Rental Pilot's web app has Playwright end-to-end tests and Vitest unit tests. I also look at the rendered screen before shipping, because passing tests are not the same as a working page.