Cypress unable to run in Jenkins?

Viewed 1421

I'm trying to run the cypress test with jenkins in my workplace. Due to Proxy issue I have uploaded my local node modules in s3 and before running the test I will download those modules and then run the test using this command.

But I'm getting below error Which I haven't understood. Can someone please explain what's wrong here ?

CYPRESS_CACHE_FOLDER=./cypress-cache ./node_modules/.bin/cypress run --headless --browser chrome --spec cypress/integration/api/api-test.spec.ts
The cypress npm package is installed, but the Cypress binary is missing.

We expected the binary to be installed here: /home/jenkins/agent/workspace/test-builds/cypress-ui-test-build/cypress-cache/6.1.0/Cypress/Cypress

Reasons it may be missing:

- You're caching 'node_modules' but are not caching this path: /home/jenkins/.cache/Cypress
- You ran 'npm install' at an earlier build step but did not persist: /home/jenkins/.cache/Cypress

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

----------

Platform: linux (Debian- 9.9)
Cypress Version: 6.1.0

If I try ./node_modules/.bin/cypress --version

Cypress package version: 6.1.0
Cypress binary version: not installed
1 Answers

It seems like indeed you have uploaded all the node_modules, but you didn't upload Cypress itself. Have you tried to run npm install or cypress install?

Besides, just FYI, Jenkins is only a continuous integration tool. It helps you manage tasks. All the commands still just run on your server :)

Related