Skip to content

Could not find a Cypress configuration file cypress.json on Jenkins #9084

@omelnik

Description

@omelnik

I decided to put my tests into a docker container, but I started facing an issue.
When I tried to map my current dir to a folder inside my container, I started getting this error: Could not find a Cypress configuration file, exiting. We looked but did not find a cypress.json file in this folder: /usr/src/app

Here's my Dockerfile:

# pull official Cypress image
FROM cypress/included:5.5.0

# set working directory
RUN mkdir /usr/src/app
WORKDIR /usr/src/app

# copy our test application
COPY package.json /usr/src/app/package.json
COPY package-lock.json /usr/src/app/package-lock.json

# install NPM dependencies and Cypress binary
RUN npm ci

# copy all files into the container
COPY . /usr/src/app
COPY cypress.json /usr/src/app/cypress.json

# check if the binary was installed successfully
RUN $(npm bin)/cypress verify

# run tests
CMD ["./node_modules/.bin/cypress", "run"]

Here's my command

docker run -v $PWD:/usr/src/app --ipc=host image:latest --headless --browser chrome

And like usually it works on my local, but doesn't work on Jenkins. I'm not sure what I'm missing. I was using this article as the reference. Just for the record, I tried to pass -w /usr/src/app flag as well.

Metadata

Metadata

Assignees

No one assigned

    Labels

    CIGeneral issues involving running in a CI providerstaleno activity on this issue for a long period

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions