Installing and setting up Cypress
Let us now run through a detailed step-by-step installation and setup process for Cypress:
- In Chapter 4, we installed Node.js, which is a runtime environment for JavaScript. Node.js installation comes with a default and extremely useful package manager called npm. Figure 5.1 shows how to check the version of npm installed on your machine:
Figure 5.1 – Checking the installed npm version
- Let us next create an empty project to install Cypress and further explore its features. Run npm init –y in an empty folder (preferably named app) in your local directory to create a package.json file. Figure 5.2 shows the corresponding output with the contents of the file:
Figure 5.2 – npm init
Note
npm init <initializer> is used to set up new or existing packages. If <initializer> is omitted, it will create a package.json file with fields based on the...