diff --git a/test/e2e/docker-compose.ci.yml b/test/e2e/docker-compose.ci.yml new file mode 100644 index 000000000..03bcd48e6 --- /dev/null +++ b/test/e2e/docker-compose.ci.yml @@ -0,0 +1,17 @@ +version: '3' +services: + cypress: + image: cypress/included:3.5.0 + container_name: e2e-cypress + command: --record --browser chrome + depends_on: + - portainer + working_dir: /e2e + environment: + CYPRESS_baseUrl: http://e2e-portainer:9000 + CYPRESS_RECORD_KEY: ${CYPRESS_RECORD_KEY} + volumes: + - ./cypress:/e2e/cypress + - ./cypress.json:/e2e/cypress.json + networks: + - e2e-ci diff --git a/test/e2e/docker-compose.yml b/test/e2e/docker-compose.yml index 89b878a3c..8f36c7a8d 100644 --- a/test/e2e/docker-compose.yml +++ b/test/e2e/docker-compose.yml @@ -11,13 +11,12 @@ services: cypress: image: cypress/included:3.5.0 container_name: e2e-cypress - # command: --record --browser chrome + command: --browser chrome depends_on: - portainer working_dir: /e2e environment: CYPRESS_baseUrl: http://e2e-portainer:9000 - # CYPRESS_RECORD_KEY: volumes: - ./cypress:/e2e/cypress - ./cypress.json:/e2e/cypress.json diff --git a/test/e2e/run-e2e.sh b/test/e2e/run-e2e.sh index 7d017c0fd..37fc85ac6 100755 --- a/test/e2e/run-e2e.sh +++ b/test/e2e/run-e2e.sh @@ -19,5 +19,11 @@ exec_in worker1 docker swarm join --token $TOKEN_WORKER manager1:2377 # Worker2 join exec_in worker2 docker swarm join --token $TOKEN_WORKER manager1:2377 -# Up portainer -docker-compose up --exit-code-from cypress +# Run portainer + cypress +# Use export CI=1 to run in CI mode +if [ -z "${CI}" ]; +then + docker-compose up --exit-code-from cypress +else + docker-compose -f docker-compose.yml -f docker-compose.ci.yml up --exit-code-from cypress +fi