I want to make the case that prioritizing end-to-end (E2E) testing for the critical parts of your app will reduce risk and give you the best return. Further, I’ll show how you can adopt this methodology in mere minutes.
His test is:
- Spin up Puppeteer (Headless Chrome) and Chai
- Go to the homepage
- Test if the homepage has his name on it.
Just one super basic integration goes a long way. If your site spins up, returns a page, and renders stuff on it that you expect, a lot is going right. Then, once you have that, you can toss in a handful more where you navigate around a little and click some things. And, if it still works, you’re in pretty good shape.
I’ve had a little trouble with Cypress over the years, but you’ll probably have better luck than I did. Overall, I think it’s the nicest player in the integration test market.
Would like to know issues you faced with cypress!
For me, it was testing CodePen with 100+ tests. We’d have maybe 2-3 totally random failures each run. Nothing to do with the actual test failing what it was supposed to test, just the page not loading, or the test running before data was there, or something weird/awkward. So when the tests were in the build pipeline, you basically couldn’t trust the results, nor could we use it in a “if there are failures, don’t deploy” situation, as we’d never be able to deploy. There was just something funky with our setup and a lot of us spent an absolute ton of hours trying to sort it out and never could. I don’t expect most people have this same experience.