Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Table of Contents
minLevel1
maxLevel6
outlinefalse
stylenone
typelist
printablefalse

This page describes full installation from scratch - it will install everything you will need including the testing project. No previous knowledge or configuration is required. The following steps were done on Mac, but there should be no major difference with Windows.

Prerequisites

To run Cypress for the first time, we need to install this:

  1. Chrome

  2. Node.js

  3. Git

  4. IDE (Visual Studio Code. You can use also another editor on environment which allows you to display and edit the project (e.c. IntellIJ Idea).

There are other possibilities, but to make the first steps easier we expect the same installation for everybody.

Chrome

  • Note that Safari or IE are not supported

  • Another option is Mozilla Firefox

  • Cypress.io can be used on Windows and on Mac, so just install Chrome for your platform

Node.js

  • Run Chrome, search for “node js“

  • Open nodejs.org and download the last stable version

  • Install the downloaded version - use all default settings, no changes are needed

Git

  • Run Chrome, search for “git“

  • Open git-scm.com and download the last stable version

  • Install the downloaded version - use all default settings, no changes are needed

Visual Studio Code

  • Run Chrome, search for “Visual Studio Code“

  • Download the last stable version

  • Install the downloaded version - use all default settings, no changes are needed

  • Create an icon on your desktop

For the first time, you can try fast install described in this presentation and using GUI version of cypress.

...

Check the installation is correct:

  1. Launch Visual Studio Code

  2. Display Terminal window (if it is not displayed already)

  3. Select default shell (command prompt for Windows, bash for Mac)

  4. write node -v to check node.js version

  5. if the version is not displayed, you need to restart Visual Studio Code

  6. write npm -v to check version of node package manager

...

Clone new project from GIT:

For demonstration purposes there is possible to download open source project from GIT. Let's use it as an example, and other (real) projects will be cloned by using same procedure.

  1. Create a new folder in your computer and name it (name can not contain spaces) as an example we will name it as GITRepo. Remember where did you save this folder (in Desktop in this example).

  2. go to https://github.com/and enter ngx-cypress-test to the search field

  3. click on the following link (should be the first one)

...

3. Next step is click on Clone or download and some link shows up. Copy this link.

...

Install all dependencies and deploy the test application on your machine

  1. open Visual Studio Code

  2. open folder NGX-CYPRESS-TEST (this is the one you created during cloning the project)

  3. open new Terminal window in Visual Studio Code

  4. run command npm install in the terminal (node package manager will look into package.json file and download all devDependencies)

  5. ignore all vulnerabilities (application will work)

  6. run command npm start in the terminal (it will deploy the application)

  7. check the confirmation the application has been deployed

  8. open http://localhost:4200 in Chrome to check the application is really running

  9. open terminal and write command “npm install cypress --save-dev

  10. after Cypress installation write command “npx cypress test”. After installing Cypress open Visual studio core and open “package.json” → devDependencies - here you should see cypress: 4.7.0 (or other version). Once it is there the installation was completed successfully.

    Image Modified

Configure default behaviour of Cypress

...

https://docs.cypress.io/guides/references/configuration.html#Options

  1. open Visual studio code → NGX-CYPRESS-TEST → cypress.json and enter following commands:

    Image Modified

Note : Please check if cypress.json file is not created by default, then create the new file and save it as cypress.json and enter the above mentioned commands.

...