Yesterday I shared why I'm switching from Cypress to Playwright
Yesterday I shared why I'm switching from Cypress to Playwright.
But Cypress is solid too. Here are 4 Cypress benefits:
1. More concise syntax. In Cypress, I don’t have to say “await”, “expect”, or “exact” constantly. In Playwright, I must use these 3 keywords a lot.
1/5 👇

2. Built-in watch mode. Cypress' test runner stays open and re-runs a single test on save. 😍 I really miss this feature in Playwright.
Playwright requires hacks to do something similar: https://github.com/microsoft/playwright/issues/7035#issuecomment-907799908
3. testing-library/cypress has built-in assertions.
With Playwright, failed selectors don’t fail the test, so you have to explicitly assert. I found this surprising, and annoying, since it requires more code on each line (It's admittedly more explicit, and thus, recommended)
4. Cypress avoids raw async/await's gotchas. See https://zellwk.com/blog/async-await-in-loops/.
Summary: To iterate in Playwright, use a for of, or plain for loop. Avoid map, filter, etc, because they return a callback, which messes up the async order.
Cypress' API avoids this issue.