cypress-example-docker-compose icon indicating copy to clipboard operation
cypress-example-docker-compose copied to clipboard

Failed on running npx cypress verify

Open convers39 opened this issue 3 years ago • 1 comments

Folder structure as below:

.
├── README.md
├── docker-compose.yaml
├── e2e
├── backend
├── client
└── template-backend.yaml

3 directories, 5 files
FROM cypress/base:14
WORKDIR /app

# dependencies will be installed only if the package files change
COPY package*.json ./

# by setting CI environment variable we switch the Cypress install messages
# to small "started / finished" and avoid 1000s of lines of progress messages
# https://github.com/cypress-io/cypress/issues/1243
ENV CI=1
RUN npm ci
# verify that Cypress has been installed correctly.
# running this command separately from "cypress run" will also cache its result
# to avoid verifying again when running the tests
RUN npx cypress verify

version: "3.8"
networks:
  default:
services:
  client:
    depends_on:
      - backend
      # ..
  backend:
      # ..
  e2e:
    image: cypress
    build: ./e2e
    container_name: cypress
    depends_on:
      - client
      - backend
    environment:
      - CYPRESS_baseUrl=http://client:3000
    command: npx cypress run
    volumes:
      - ./e2e/cypress:/app/cypress
      - ./e2e/cypress.config.js:/app/cypress.config.js
    networks:
      - default
image

convers39 avatar Sep 27 '22 03:09 convers39

Looks like there are some depenedencies missing. Try this In your Dockerfile: Use image cypress/browsers and install the dependencies RUN apt-get install libgtk2.0-0 libgtk-3-0 libgbm-dev libnotify-dev libgconf-2-4 libnss3 libxss1 libasound2 libxtst6 xauth xvfb

arorahanisha50 avatar Sep 11 '23 18:09 arorahanisha50