cypress: Tests fail on circleci but success locally

Current behavior:

  • circle-ci config:
version: 2
orbs:
  cypress: cypress-io/cypress@1.0.0
workflows:
  version: 2
  build_and_deploy:
    jobs:
      - build:
          context: phoenix-deploy
jobs:
  build:
    docker:
      - image: cypress/browsers:chrome67
    working_directory: ~/admin
    steps:
      - checkout
      - restore_cache:
          keys:
            - yarn-packages-{{ checksum "yarn.lock" }}
      - run:
          name: Install Dependencies
          command: yarn install --frozen-lockfile
      - save_cache:
          name: Save Yarn Cache
          key: yarn-packages-{{ checksum "yarn.lock" }}
          paths:
            - ~/.cache/yarn
      - run:
          name: Run Tests
          command: yarn run test:all
  • package.json’s scripts:
  "scripts": {
    "start": "react-scripts start",
    "cypress:run": "cypress run --browser chrome",
    "test:all": "yarn run test:unit && yarn run test:end2end",
    "test:unit": "REACT_APP_ENV=test react-scripts test --env=jsdom",
    "test:end2end": "start-server-and-test start http://localhost:3000 cypress:run",
    "eject": "react-scripts eject"
  }
  • test: screen shot 2019-01-23 at 18 51 38

  • circle-ci error: screen shot 2019-01-23 at 18 52 00

Versions

screen shot 2019-01-23 at 18 53 19

Any ideas? It works well locally. Maybe I didn’t understand something but I followed this documentation:

https://on.cypress.io/continuous-integration#Solutions

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 16 (9 by maintainers)

Most upvoted comments

@jennifer-shehane I have facing the same problem on my ci.