Getting started with Cypress
In this section, you will learn how to install and set up Cypress in an existing project. We will also write a test for a user flow. Use the following command at the command line to install Cypress:
npm install cypress --save-dev
The preceding command will install Cypress as a development dependency in your project. Once Cypress is installed, run the following command:
npx cypress open
The preceding command runs the Cypress interactive Test Runner. The Test Runner allows us to manually do things such as select specific tests to run, pick a browser to use for test execution, and see the browser output alongside each associated Cypress command. When we run Cypress in interactive mode for the first time, it creates a suggested folder structure for Cypress projects:
In the preceding screenshot, Cypress informs us that it automatically created a cypress
folder structure on our behalf...