Instructor: In this lesson, we'll learn how to add Cypress to an existing application. First, let's clone the sample repo. Next, cd into the repo and get check out the 01 Cypress install branch.
Next, run npm install. When it's finished installing, you can start the demo application with npm run start. This command will automatically open the demo application on localhost 5000.
You can verify that your application is working by running npm run test. Once our application is verified, we're prepared to npm install cypress --save dev.
Once Cypress is installed, we're prepared to run it with npm bin/cypress open. This will pop open the Cypress interactive GUI which comes pre-seeded with a number of tests.
If we click on one, we can see an example of Cypress in action. This is Cypress running on the Cypress website. We can see here that Cypress can either run against our local page or against a remote page.
All of these example files live in the Cypress directory under integration. You'll probably want an easier way to run Cypress, so open package.json and add a Cypress command, which will be cypress open.
We can use our new command by running npm run cypress. Now you're all set up with Cypress and ready to roll. If you'd like to do an exercise before moving on to the next lesson, take a moment and familiarize yourself with some of the example tests.