Skip to content

Instantly share code, notes, and snippets.

@ondrej-janosik
Last active May 4, 2021 15:20
Show Gist options
  • Save ondrej-janosik/d448055af45e74eca6e3a16862425070 to your computer and use it in GitHub Desktop.
Save ondrej-janosik/d448055af45e74eca6e3a16862425070 to your computer and use it in GitHub Desktop.
Using NPM CI and Cypress with Bitbucket Pipelines
# Check out my blog post about this topic at https://medium.com/@ondrej.janosik42/setting-up-bitbucket-pipelines-with-proper-caching-of-npm-and-cypress-74d033888186
image: node:10.8.0
options:
max-time: 30
pipelines:
default:
- step:
name: Install, build and tests
caches:
- npm
script:
- npm ci
- npm run build
- npm run test
- step:
name: E2E tests
caches:
- npm
- cypress
image: cypress/base:10
script:
- npm ci
- npm run e2e
definitions:
caches:
npm: $HOME/.npm
cypress: $HOME/.cache/Cypress
@afsaneGhafouri
Copy link

Hey there,

I ran your gist but got this error on pipeline:

bash: cypress: command not found

I've checked the base image and there's no installation for cypress there. Would you kindly help me with it?

@renekorss
Copy link

Hey there,

I ran your gist but got this error on pipeline:

bash: cypress: command not found

I've checked the base image and there's no installation for cypress there. Would you kindly help me with it?

Just add it to your own project npm install --save-dev cypress

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment