What was the alternative for Cypress?
My team has considered moving off of our current UI testing framework and moving to another. You mentioned your team moved to Cypress a few years ago. Which tool were you using before and what made you make the switch? What was your process in considering making the switch?
Hi both, thanks for the questions! I’m going to tackle these two together.
The project that we’re using Cypress in was actually greenfield, so Cypress was our first choice (we didn’t switch to it from another framework). We had a few devs on our team who’d had bad experiences with Selenium WebDriver in the past, so we decided to give something else a try for comparison. We found it to be a really good developer experience - things we liked were:
- Writing tests was straightforward, for example Cypress has built-in waiting for your assertions so you don’t have to think about that bit much.
- The documentation is pretty extensive and useful.
- Tests run quickly and easily locally.
- The UI when running the tests is really clean/nice.
It wasn’t all smooth sailing by any means - we did have to maintain a fork of it for a little while due to a Service Worker specific issue that took a while to get fixed. But in general they’ve been responsive to issues and it’s been a good fit for us - we’re back on the main trunk now!
I guess if we were to look into a replacement for some reason, the sorts of things that would be top of my shopping list would be:
- Built in videos/screenshots for when tests fail.
- Ability to run tests locally easily
- Ability to write the tests in your desired language (we write in TypeScript, which is nice as it’s the same as what we use for the regular frontend code)
- Support for multiple browsers / the ones you care about
- An active community, regular updates, issues being responded to etc.
Back when our E2E flakes were really bad, we thought a couple of times about spiking TestCafe because we’d heard good things about it. At this point I’m kinda glad we didn’t, though, as I think it would have been a bit of a distraction - it turned out most of our problems were our own doing and just needed better investigation. I think it’s easy to fall into a “grass is always greener” mentality when it comes to tooling - you feel the pain points of what you’re currently using, but don’t necessarily know what new ones you might inherit if you switch…
Sorry - a bit of a long answer! I guess the TL;DR is, there are a bunch of tools out there and probably multiple that will do the job you want well. Before considering switching tools (potentially a long and painful process) you want to be really sure that the problems you’re facing are because of your current tool and not a symptom of something else.