3 ms·
sad move from cypress. they make you pay just for the ability to run tests in parallel on your own hardware. this combined with performance, iframe, tab suppor
by dvngnt_ 3y ago
sad move from cypress. they make you pay just for the ability to run tests in parallel on your own hardware.
this combined with performance, iframe, tab support, and others is why playwright has been eating cypress' lunch
Microsoft can afford an open source testing tool whereas a VC backed Cypress must engage in enshittification
- no_wizard 3y agoPlaywright doesn't have a good component testing story yet though. It really needs to come out of beta into mainline. At this point, its the only reason I use Cypress, as E2E testing via Playwright is a joy to write
- dvngnt_ 3y agoRTL exists and is probably faster than cypress. is component testing from cypress really needed. the only "benefit" I see is using a single tool
- no_wizard 3y agoIt is to me, testing arbitrary tree of components in live browsers can be invaluable, espcially for things like a design system, where snapshot testing can actually be really valuable[0]. RTL is great, but jsdom and similar solutions have limitations, being able to run similar tests in live browsers is really validating, in many cases allows us to cut down on writing somewhat more brittle E2E tests The biggest win with playwright its like writing vitest / jest tests, it uses a similar `expect` function (I believe its a modified version of Jest expect but that may have changed) and I like their Pages API The only thing I haven't used Playwright for yet is API testing [0]: as you get more than just a DOM tree snapshot, you get the styles too. Great for catching regressions
- paularmstrong 3y agoPlaywright has experimental component testing[1] and it's been working great at my company for months. [1]: https://playwright.dev/docs/test-components https://playwright.dev/docs/test-components
- no_wizard 3y agoits been in experimental for over a year I think, my worry is, in typical Microsoft fashion, they do the bizarre thing and actually kill it off. They haven't signaled any intention to move this into production ready status, and I don't want to write tests in a way where I have to port them again. Vitest is also adding browser support of this nature and if that hits enough maturity its all moot anyway
- spankalee 3y agoComponent testing is trivial in test runners that run tests in browsers, like @web/test-runner. We use that exclusively on Lit and Angular is adopting it too. It'll run tests in Puppeteer, Playwright, local browsers via WebDriver, Sauce, etc.
- no_wizard 3y agoI extremely dislike that I can't use vite with @web/test-runner. It runs its own thing, which means I have to use a different pipeline than the one I already use to build the app. Both Cypress and Playwright can use vite out of the box, on the other hand. I like this, since I can use the same configuration for production for running tests (we do this to run tests against prod builds) Its more overhead currently than I want to take on.
- justinclift 3y ago> Microsoft can afford an open source testing tool ... Microsoft can also afford to keep the tool fully free and open source until the VC funded competitor expires, at which point MS can switch things around by introducing paid options. Open Core, paid add-ons/plugins, etc.
- dvngnt_ 3y agopossibly, but the default playwright installation creates a github action which makes Microsoft money so there's less pressure to gate features
- justinclift 3y agoInteresting. That makes sense too. :)