drydockcloud / ci-cypress

Customized Cypress docker image
https://hub.docker.com/r/drydockcloud/ci-cypress
GNU General Public License v3.0
1 stars 1 forks source link

Should we include common cypress plugins into this repo? #10

Closed dmundra closed 2 years ago

dmundra commented 2 years ago

We have found the need to add plugins like cypress-axe and @testing-library/cypress should we just add it to this repo and build the public image to include it instead of creating our own image? E.g. from https://github.com/CivicActions/cypress-tests/blob/main/docs/Plugins.md of installing the plugins.

FROM drydockcloud/ci-cypress:6.7.0
# Install Cypress plugins
RUN yarn add --cwd ../ axe-core cypress-axe
RUN yarn add --cwd ../ @testing-library/cypress
dmundra commented 2 years ago

Tested locally adding the plugins to the Dockerfile and also updating Cypress to version 9.7.0 (10+ is breaking) and it works well I believe.

FROM cypress/included:9.7.0

# Drydock environment setup
LABEL exposed.command.single=cypress
ENV TARGET=http://web
VOLUME ["/src"]
WORKDIR /src

# Ensure the binary cache folder is accessible even as non-root
ENV CYPRESS_CACHE_FOLDER=/etc/Cypress
RUN mv /root/.cache/Cypress/ /etc

# Copy in sample files for base image testing
COPY cypress.json /src/
COPY smoketest.js /src/cypress/integration/

# Install Cypress plugins
RUN yarn add --cwd ../ axe-core cypress-axe@0.14.0
RUN yarn add --cwd ../ @testing-library/cypress

COPY entrypoint.sh /usr/local/bin/entrypoint.sh
ENTRYPOINT [ "/usr/local/bin/entrypoint.sh" ]

After merging #11 I will add a merge request for this one.