1
votes

Hi I am Trying to run cypress test through Jenkins and am getting the test form my local m/c not form github and am Executing windows batch command "./node_modules/.bin/cypress run --spec "cypress\integration\SignUpTestCases\NewUserSignUp.spec.js" in Bulid configuration.

and i am getting this error

C:\Users\akash\CypressAutomation>./node_modules/.bin/cypress run --spec "cypress\integration\SignUpTestCases\NewUserSignUp.spec.js" The cypress npm package is installed, but the Cypress binary is missing.

We expected the binary to be installed here: C:\WINDOWS\system32\config\systemprofile\AppData\Local\Cypress\Cache\4.4.1\Cypress\Cypress.exe

Reasons it may be missing:

  • You're caching 'node_modules' but are not caching this path: C:\WINDOWS\system32\config\systemprofile\AppData\Local\Cypress\Cache
  • You ran 'npm install' at an earlier build step but did not persist: C:\WINDOWS\system32\config\systemprofile\AppData\Local\Cypress\Cache

Properly caching the binary will fix this error and avoid downloading and unzipping Cypress.

Alternatively, you can run 'cypress install' to download the binary again.

https://on.cypress.io/not-installed-ci-error

WHat is the problem here .....or pls tell me about cypress configuration with Jenkins!!!!

2
Did you resolve your problem ? I'm facing the same thing now. - mr_incredible
Hi am still facing same problem but not found any solution yet.... - Akshat
If you're using Docker use Docker image with Cypress preinstalled with all its dependencies. I made it work that way. - mr_incredible

2 Answers

1
votes

Please set up environment variable CYPRESS_RUN_BINARY and its value should be your cypress runner location. (the runner defauly localtion is ~/AppData\Local\Cypress\Cache) the variable setting: Name: CYPRESS_RUN_BINARY Value:C:\Users\Administrator\AppData\Local\Cypress\Cache\4.8.0\Cypress\Cypress.exe

Or you can add the command in the jenkins job: set CYPRESS_RUN_BINARY=C:\Users\Administrator\AppData\Local\Cypress\Cache\4.8.0\Cypress\Cypress.exe before run the cypress cases.

1
votes

Your problem probably exists because you have node_modules added to your git repository.

  1. Remove node_modules folder from your repository
  2. add node_modules to .gitignore file.
  3. commit changes, push them and try again.