Git Product home page Git Product logo

cypress-example-docker-codeship's Introduction

Cypress + Docker + Codeship Pro = ❤️

Codeship Status for cypress-io/cypress-example-docker-codeship renovate-app badge

Running your Cypress E2E tests on Codeship Pro CI is very simple. You can either start with a base image cypress/base with all dependencies.

  1. Create test image

Use Dockerfile to build a test image. If you use cypress/base image you would need to install NPM dependencies that includes Cypress.

FROM cypress/base:10
WORKDIR /app
# Copy our test page and test files
COPY index.html ./
COPY cypress.json ./
COPY package.json ./
COPY cypress ./cypress
# Install npm dependencies, can also use "npm ci"
RUN npm install
  1. Define Codeship build step

Use codeship-services.yml file to build cypress/cypress-codeship-test image (from the above Dockerfile).

cypress-codeship-test:
  build:
    image: cypress/cypress_codeship_test
    dockerfile: Dockerfile
  1. Define test steps

Use codeship-steps.yml file to use the built image and run one or more E2E tests in parallel or in sequence.

- name: "Cypress E2E tests"
  service: cypress-codeship-test
  command: npm run cy:run

The cy:run command is an NPM script defined in package.json

{
    "scripts": {
        "cy:run": "cypress run"
    }
}

Now push the changes to the repo, and watch Codeship run

Codeship run

Recording

The tests are recorded on Cypress Dashboard. The CYPRESS_RECORD_KEY is encrypted following Codeship Pro documentation

Happy testing

If you find problems with Cypress and CI, please

cypress-example-docker-codeship's People

Contributors

bahmutov avatar brian-mann avatar greenkeeper[bot] avatar jennifer-shehane avatar renovate-bot avatar renovate[bot] avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.