Skip to content
Latchkey

How to Run Cypress End-to-End Tests in CircleCI

The cypress-io/cypress orb handles install, caching, and running the suite, including starting your app and waiting on it before tests begin.

Import cypress-io/cypress and call its run job (or install + run steps). Use start-command and wait-on so the dev server is up before Cypress runs.

Steps

  • Add the cypress orb under orbs:.
  • Use cypress/run with start-command to boot your app and wait-on to block until it answers.
  • Add parallelism and --record to split a large spec set across containers.

Config

.circleci/config.yml
version: 2.1
orbs:
  cypress: cypress-io/cypress@3.3.0
workflows:
  e2e:
    jobs:
      - cypress/run:
          start-command: "npm start"
          wait-on: "http://localhost:3000"
          cypress-command: "npx cypress run"

Gotchas

  • Without wait-on, Cypress can start before the server is ready and fail with connection refused.
  • Recording and load balancing across parallel containers needs a Cypress Cloud record key set as an env var.

Related guides

Run this faster and cheaper on Latchkey managed runners. Start free →