Cypress Test Automation

Why I like Cypress for test automation

I am using for about a year now and I think it is great.

test automation with Cypress

In my opinion it offers the following good features:

The Cypress Test Runner supports you very well for developing or maintaining tests.

  • You receive fast feedback. When you save the test, the Test Runner immediately runs the test.
  • You can select HTML elements with the Test Runner and insert them quickly into the test source code via the clipboard.
  • You can view the settings with the Test Runner which can be very helpful for error analysis.
  • Test Runner allows you to debug the tests very easily.
  • Information can be queried via the browser console.

You don’t need any waits, which you know from Selenium. Cypress waits “automatically” until the element is “ready”.

Cypress records videos of the tests. This is helpful if a test fails when it is not obvious at first glance why there was a failure. Cypress also automatically creates a screenshot (as known from other tools), but the video can make the analysis easier.

It is easy to install and set-up. You just need Node and npm or yarn.

The documentation is very good.

Cypress allows to retry failing tests. This could by handy for end-to-end tests.

Cypress allows to make http requests within the browser context. With this it is possible to test API’s. Furthermore with this is for example a login in the context of a web application possible. This can be helpful if you do not want to test the login functionality but the functionality is protected by a login. This results in faster running tests and in reduced complexity.

Cypress does not support as much browser as for example Selenium. However with my previous experience, I very rarely needed to run the automatic tests on different devices to significantly reduce the risk of regression errors.