E2E tests with Cypress
It is time to move our testing focus from a micro level, offered by unit tests, to a macro level, provided by E2E tests. If unit tests focus on a single state of a single component, E2E will help us test a complete user journey.
As I mentioned previously, we will be able to use some of the knowledge that we learned in the previous section, since E2E tests follow a similar structure to the ones we learned about in Vitest.
Let’s break down this section into three different parts. First, we are going to learn how to install Cypress in your application. Then, we will learn the basic structure of an E2E test file and its placement within a project. Lastly, we will end the section by writing an E2E test for our application.
The most used E2E tools within the JS industry are Cypress and Playwright. Cypress has been around for quite a few years, and it currently holds a very large section of the market. Playwright is a little newer, but it is gaining...