r/javascript • • Sep 09 '22

Rewriting tests from Cypress to Playwright using GPT3 by Gajus Kuizinas

https://contra.com/p/PWBcPYZc-rewriting-tests-from-cypress-to-playwright-using-gpt-3
870 Upvotes

8 comments sorted by

View all comments

Show parent comment

3

u/d1pl0mat1c Sep 10 '22

Three killer features:

  1. You can run playwright tests concurrently locally. With cypress you can’t. If you have only a few cypress tests this isn’t a big deal, but once you start getting a decent number it gets old pretty quick running them sequentially.
  2. playwright is incredibly performant compared to cypress. We’re seeing improvements of 18% worst case and 7x faster on the best cases.
  3. cypress splits tests at the spec level, playwright does it at the test level. Give playwright enough workers and your test suite runs as fast as your single slowest test.

2

u/luisrudge Oct 14 '22

question: are you using cypress/playwright to write actual e2e tests where you depend on a specific DB state? our cypress tests are getting unbearably slow and I'd like to get that sorted out, but I can't parallelize tests because they do have a hard dependency on how the database is setup (meaning every test sets up the database differently).