Hire QA – Specialized in QA Recruitment, Technical Interviews and Testing Solutions

Setup Cypress

Category: Cypress
  • Download and install node.js from https://nodejs.org/en/download/
  • Once the installation is done, a nodejs file gets created in the Program files.
  • In the System Properties pop-up, move to Advanced, click on Environment Variables. Then click on OK.
  • In the Environment Variables pop-up, move to the System variables section and click on New.
  • Enter NODE_HOME and the node.js path (noted earlier) in the Variable name and the Variable value fields respectively in the New System Variable pop-up.
  • Once the path of the node.js file is set, we shall create an empty folder (say cypressautomation) in any desired location.
  • Next, we need to have a JavaScript editor to write the code for Cypress. For this, we can download Visual Studio Code from the link https://code.visualstudio.com/
  • Once the executable file is downloaded, and all the installation steps are completed, the Visual Studio Code gets launched.
  • Select the option Open Folder from the File menu. Then, add the CypressAutomation folder (that we have created before) to the Visual Studio Code.
  • We need to create the package.json file with the below command from terminal −
  • We have to enter details like the package name, description, and so on, as mentioned in the image given below −
  • npm init
  • Once done, the package.json file gets created within the project folder with the information we have provided.
  • Finally, to install Cypress run the command given below −
  • npm install cypress –save-dev

Leave a Reply

Your email address will not be published. Required fields are marked *