Forked from mtlynch/hello-world-cypress that allows to run a project and its Cypress end-to-end tests using docker-compose. The initial setup is well described in "End-to-End Testing Web Apps: The Painless Way.".
Also read "Run Cypress with a single Docker command".
e2e/docker-compose.yml has all settings to start the web application and run Cypress end-to-end tests from e2e/cypress/integration
cd e2e
docker-compose up --exit-code-from cypress
To start Cypress Test Runner (just like cypress open
does), you need to:
- set up X11 server on the host machine, for example using XQuartz following the Running GUI applications using Docker for Mac
- set the
IP
variable and allow X11 server to accept incoming connections from that network address, see e2e/cy-open.yml for commands - set the
DISPLAY
variable and pass it to thedocker-compose
when running with both configuration files
cd e2e
docker-compose -f docker-compose.yml -f cy-open.yml up --exit-code-from cypress
You should see Cypress open and be able to run tests, change files, see tests rerun.