From the course: End-to-End JavaScript Testing with Cypress.io

What is Cypress.io

From the course: End-to-End JavaScript Testing with Cypress.io

Start my 1-month free trial

What is Cypress.io

- [Announcer] So first thing's first: what exactly is cypress.io and why is it such a helpful tool? Well, here's how I usually answer this question: let's say you're working on a software development team and you're creating a web application. When you first start developing the app, it's probably fairly simple, maybe just a few buttons and some text boxes, and you can check that most of the flows of the application work just by clicking around for a minute or two, and then every time you make a change or add another piece of functionality, you click around a little more to make sure everything works, you interact with some other pieces of the application to make sure you didn't break anything, and then your code goes straight into production. The problem with this method of testing, of course, is that it doesn't scale well. As the application gets bigger and bigger, it becomes extremely impractical for the developers to test the entire application on their own. They become limited to testing only the new functionality they added, and then just crossing their fingers and hoping they didn't break something in another part of the app. And this is usually the point where companies hire people to do dedicated QA work. These people usually do the exact same kind of testing, but since that's the focus of their job, they're able to do a lot more of it. The main problem here is that it's very tedious work to click through all the possible flows of even a medium-sized application. And for this reason, this approach carries the same difficulties as before. It just doesn't scale. For every additional piece of functionality, several new flows are introduced in the application, all of which must be tested each and every time another change goes in, which itself carries several, other new flows that must be tested and so on and so on. So I think that by now we can see that manual testing is neither a scalable nor an efficient way to ensure software quality from the end user's point of view. So what other option do we have? Well, the answer to this dilemma is to automate the testing of the application. And we're not talking about unit testing here, which is only concerned with testing small pieces of code. Although it's definitely a good idea to have a good suite of unit tests, in this case what we're interested in is having automated tests that test the application from the user's point of view. And this means that our automated tests will be doing stuff like clicking buttons and typing into text boxes and checking if certain elements are visible on the page, stuff like that, instead of calling the code directly. This branch of testing is called end-to-end testing and it's extremely important in ensuring that your users have a good experience with your application and that visible bugs are caught before they make it in to production. And that's where cypress.io comes in. Cypress is a very easy to use library that allows us to conduct this sort of automated testing. In my opinion, it's definitely easier to use than other end-to-end testing framework such as Selenium and like Selenium, it's open source and free. So at its foundation, that's what Cypress is: a tool that allows you to automate and scale end-to-end testing and ensure your application works correctly under almost all the circumstances a user will encounter.

Contents