Playwright E2E Testing: An Honest Review
Switched from Cypress to Playwright. Faster and more stable, but honestly there are some downsides too.
Cypress was too slow, so we switched
We were running E2E tests with Cypress -- 42 tests took 7 minutes 38 seconds. This was the bottleneck in CI. Waiting 8 minutes every time you open a PR is just not acceptable.
Heard Playwright was faster and decided to migrate. Same tests in Playwright: 2 minutes 12 seconds. 3.5x faster. Parallel execution is the default, which explains a lot.
Migration was smoother than expected
Cypress and Playwright APIs are similar enough that a lot of the conversion was mechanical. cy.get('.button').click() becomes page.locator('.button').click(). Migrating 42 tests took two days.
The cy.intercept() network mocking parts were trickier though. Playwright's page.route() has a subtly different API, and that's where I lost some time.
Auto-waiting is really good
Cypress also does auto-waiting, but Playwright's is more granular. When you click(), it automatically checks if the element is visible, clickable, and done animating. We had 8 places where Cypress tests had cy.wait(1000) hardcoded -- in Playwright, none of those were needed.
Flaky tests dropped significantly. Tests that failed 1-2 times out of 10 runs in Cypress passed all 50 runs in Playwright.
(Thinking about all the time I spent chasing flaky tests, I should've switched sooner.)
But there are downsides
The debugging experience is worse than Cypress. Cypress has time-travel debugging in the browser -- you can see DOM state snapshots at each step. Playwright has a Trace Viewer, but you need to explicitly enable traces and then open the file separately.
Playwright also runs headless by default. If you want to see what the test is doing, you have to add the --headed flag. Having to type an extra option every time you debug is a minor annoyance.
Cross-browser testing
One of Playwright's strengths is cross-browser testing. You can test Chromium, Firefox, and WebKit in one go. But honestly, how many projects actually use this? We only run on Chromium. Running other browsers triples the CI time.
If I ever hit a bug that only shows up in WebKit, I might change my mind. Hasn't happened yet though.
Bottom line
Switching from Cypress to Playwright was the right call. Speed and stability are clearly better. But Cypress isn't a bad tool. Its debugging experience is still superior, and the learning curve is gentler.
For new projects, I'd recommend Playwright. Whether it's worth migrating an existing Cypress suite depends -- if you have 30+ tests and CI time is painful, do it. Otherwise, probably not worth the effort.