Unable to run cypress test in circleci with docker image

Viewed 222

How can I run my cypress test from Github using Circleci and Docker image. Below is my config.yml under the .circleci folder. After pushing a new test to github, it is not running the tests in cirlceci. I have also added script part in the package.json.

version: 2

jobs:
  build:
    working_directory: ~/tmp
    docker:
      - image: 'cypress/base:10'
        environment:
          TERM: xterm
    steps:
      - run: npm ci
      - persist_to_workspace:
          root: ~/
          paths:
            - .cache
            - tmp
   test:
     working_directory: ~/tmp
     docker:
        - image: 'cypress/base:10'
        environment:
          TERM: xterm
     steps:
      - attach_workspace:
          at: ~/
      - run: ls -la cypress
      - run: ls -la cypress/integration
      - run:
          name: Running cypress tests
          command: npm run cy:test-run
      - store_artifacts:
          path: cypress/videos
      - store_artifacts:
          path: cypress/screenshots

 workflows:
   version: 2
   build_and_test:
     jobs:
      - build
      - test:
          requires:
            - build

enter image description here

0 Answers
Related