Introduction
This article is about how to get cypress in working state on windows.
Cypress is the new standard in front-end testing that every developer and QA engineer needs.
So, I thought of digging into learning what cypress is. But, the installation wasn't smooth. Earlier, I thought as per the official doc it would be just the basic command npm i cypress --save-dev. But it wasn't.
While doing so ,I bumped into this
Installing Cypress (version: 4.4.1)
✖ Downloading Cypress
→ Cypress Version: 4.4.1
Unzipping Cypress
Finishing Installation
The Cypress App could not be downloaded.
Please check network connectivity and try again:
----------
URL: https://download.cypress.io/desktop/../../4.4.1?platform=win32&arch=x64
Error: self signed certificate in certificate chain
Even after setting corporate proxy it didnot work. Did search about it and found that it is marked as bug in their github repo.
Then, as per few suggestions went for direct download from cypress.io.
steps which I followed:
- Download zip file from Cypress
- In vscode terminal run, setx CYPRESS_INSTALL_BINARY C:\path-to\Downloads\cypress.zip
- Don't be in a hurry restart vscode.
- Now run ** npm i cypress --save-dev ** in vscode terminal
- You would see something like this:
> cypress@4.4.1 postinstall C:\react-project-path\node_modules\cypress
> node index.js --exec install
‼ Warning: Forcing a binary version different than the default.
The CLI expected to install version: 4.4.1
Instead we will install version: C:\path-to\Downloads\cypress.zip
These versions may not work properly together.
√ Unzipped Cypress
You can now open Cypress by running: node_modules\.bin\cypress open
https://on.cypress.io/installing-cypress
In your package.json file, find the scripts section and add a new entry.
"scripts": {
.....
"cypress:open": "cypress open"
},
In your project terminal, execute npm run cypress:open
> react_project@0.1.0 cypress:open C:\path-toproject\
> cypress open
It looks like this is your first time using Cypress: 4.4.1
√ Verified Cypress! C:\...\AppData\Local\Cypress\Cache\4.4.1\Cypress
Opening Cypress...
It would open up a cypress window and then you can begin your learning in cypress framework.
Note: With direct download you will not be able to use dashboard service and that is a shortcoming of this approach.
Cheers !!!
Top comments (1)
Hi Mitesh,
While I follow the steps I am geeting below error
npm ERR! [STARTED] Task without title.
npm ERR! The Cypress App could not be unzipped.
npm ERR!
npm ERR! Search for an existing issue or open a GitHub issue at
npm ERR!
npm ERR! github.com/cypress-io/cypress/issues