Switching from Cypress to Playwright for End-2-End Testing
First impressions
Throughout the years as a software dev, I’ve worked with a variety of tools trying to solve the age old problem of testing a system at fullstack. Often referred to as integration testing, the idea of ensuring all system components function together as expected is a sensible one.
Ahhh but we have 98% unit test coverage…
Ignoring the argument about percentage unit test coverage for a minute, hand on heart I can say I’ve lost count the number of times an end-2-end test has saved my ass from shipping a broken feature or a dodgy bug fix. As always, the devil is in the detail with development and I’ve found these types of tests a great way to document as well as validate a specific use case. They become clear indicaters to a team exactly how a feature is supposed to function however “edge-casy” it may feel.
In my early career Selenium
seemed to be the go to choice for automated web testing across multiple browsers. It gave users the option to write test scripts in a preferred language, allowed tests to run with or without a visible UI and could capture screenshots/videos during execution for debugging. Alas, as I’m sure many can testify to, it wasn’t without it’s issues.
Flaky test runs, dynamic content being dynamic content, requirement for responsive design testing and inevitable scalability concerns left Selenium feeling like an aging, often frustrating tool…