From ece7b2b3154a9e867453a20a78b93173ed802f4b Mon Sep 17 00:00:00 2001 From: Antoine Jaussoin Date: Sat, 16 Apr 2022 12:49:57 +0200 Subject: [PATCH] Add delay for integration tests (#390) --- .github/workflows/alpha.yml | 2 +- integration/cypress.json | 5 ++++- integration/cypress/integration/test.spec.js | 3 +++ integration/docker-compose.ci.alpha.yml | 1 + integration/docker-compose.ci.canary.yml | 1 + integration/docker-compose.ci.master.yml | 1 + 6 files changed, 11 insertions(+), 2 deletions(-) diff --git a/.github/workflows/alpha.yml b/.github/workflows/alpha.yml index 91556b171..cf0cbd619 100644 --- a/.github/workflows/alpha.yml +++ b/.github/workflows/alpha.yml @@ -2,7 +2,7 @@ name: 'Alpha Build' on: push: - branches: [v4140/x] + branches: [v4150/integ] jobs: build: diff --git a/integration/cypress.json b/integration/cypress.json index 979d4d05f..687450412 100644 --- a/integration/cypress.json +++ b/integration/cypress.json @@ -1,3 +1,6 @@ { - "baseUrl": "http://localhost:3000" + "baseUrl": "http://localhost:3000", + "env": { + "backend_delay": 0 + } } diff --git a/integration/cypress/integration/test.spec.js b/integration/cypress/integration/test.spec.js index be2454ec0..a24a4dc13 100644 --- a/integration/cypress/integration/test.spec.js +++ b/integration/cypress/integration/test.spec.js @@ -15,6 +15,9 @@ function get(name, rest) { describe('Post workflow', () => { it('Should login and write a post', () => { cy.visit('/'); + + // We need to wait until the backend is ready + cy.wait(+Cypress.env('backend_delay')); get('login-button').click(); get('anon-tab').click(); diff --git a/integration/docker-compose.ci.alpha.yml b/integration/docker-compose.ci.alpha.yml index f85bbeebc..27729d897 100644 --- a/integration/docker-compose.ci.alpha.yml +++ b/integration/docker-compose.ci.alpha.yml @@ -7,6 +7,7 @@ services: - frontend environment: - CYPRESS_baseUrl=http://frontend + - CYPRESS_backend_delay=30000 working_dir: /e2e volumes: - ./:/e2e diff --git a/integration/docker-compose.ci.canary.yml b/integration/docker-compose.ci.canary.yml index a7c82c217..18df674f4 100644 --- a/integration/docker-compose.ci.canary.yml +++ b/integration/docker-compose.ci.canary.yml @@ -7,6 +7,7 @@ services: - frontend environment: - CYPRESS_baseUrl=http://frontend + - CYPRESS_backend_delay=30000 working_dir: /e2e volumes: - ./:/e2e diff --git a/integration/docker-compose.ci.master.yml b/integration/docker-compose.ci.master.yml index ddd2b39eb..8baf18648 100644 --- a/integration/docker-compose.ci.master.yml +++ b/integration/docker-compose.ci.master.yml @@ -7,6 +7,7 @@ services: - frontend environment: - CYPRESS_baseUrl=http://frontend + - CYPRESS_backend_delay=30000 working_dir: /e2e volumes: - ./:/e2e