Skip to content

Commit a9aa3b7

Browse files
authored
Run E2E tests on stage only after stage deployments (#923)
1 parent 3aeb976 commit a9aa3b7

File tree

2 files changed

+43
-44
lines changed

2 files changed

+43
-44
lines changed

.github/workflows/deploy-staging.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -364,3 +364,46 @@ jobs:
364364
ecr_tag.zip
365365
frontend.zip
366366
iac.zip
367+
368+
e2e-tests-browserstack-stage:
369+
name: e2e-tests-browserstack-stage
370+
needs:
371+
- deploy-stage-backend
372+
- build-and-deploy-stage-frontend
373+
if: |
374+
needs.deploy-stage-backend.result == 'success' || needs.build-and-deploy-stage-frontend.result == 'success'
375+
runs-on: ubuntu-latest
376+
environment: staging
377+
env:
378+
APPT_LOGIN_EMAIL: ${{ secrets.E2E_APPT_STAGE_LOGIN_EMAIL }}
379+
APPT_LOGIN_PWORD: ${{ secrets.E2E_APPT_STAGE_LOGIN_PASSWORD }}
380+
APPT_DISPLAY_NAME: ${{ secrets.E2E_APPT_STAGE_DISPLAY_NAME }}
381+
APPT_MY_SHARE_LINK: ${{ secrets.E2E_APPT_STAGE_MY_SHARE_LINK }}
382+
APPT_BOOKEE_EMAIL: ${{ secrets.E2E_APPT_STAGE_BOOKEE_EMAIL }}
383+
steps:
384+
- uses: actions/checkout@v4
385+
386+
- uses: actions/setup-node@v4
387+
with:
388+
node-version: 20
389+
cache: 'npm'
390+
cache-dependency-path: 'test/e2e/package-lock.json'
391+
392+
- name: Install dependencies
393+
run: |
394+
cd ./test/e2e
395+
npm install
396+
397+
- name: BrowserStack Env Setup
398+
uses: browserstack/github-actions/setup-env@master
399+
with:
400+
username: ${{ secrets.BROWSERSTACK_USERNAME }}
401+
access-key: ${{ secrets.BROWSERSTACK_ACCESS_KEY }}
402+
project-name: 'Thunderbird Appointment'
403+
build-name: 'E2E Tests: BUILD_INFO'
404+
405+
- name: Run E2E Tests on stage via Browserstack
406+
run: |
407+
cd ./test/e2e
408+
cp .env.stage.example .env
409+
npm run e2e-test-browserstack-gha

.github/workflows/validate.yml

Lines changed: 0 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ jobs:
2424
validate-iac: ${{ steps.check.outputs.validate-iac }}
2525
validate-backend: ${{ steps.check.outputs.validate-backend }}
2626
validate-frontend: ${{ steps.check.outputs.validate-frontend }}
27-
validate-e2e: ${{ steps.check.outputs.validate-e2e }}
2827
steps:
2928
- uses: actions/checkout@v4
3029

@@ -41,9 +40,6 @@ jobs:
4140
validate-frontend:
4241
- 'frontend/**'
4342
- '.github/workflows/validate.yml'
44-
validate-e2e:
45-
- 'test/e2e/**'
46-
- '.github/workflows/validate.yml'
4743
4844
validate-iac:
4945
needs: detect-changes
@@ -196,43 +192,3 @@ jobs:
196192
- name: Test with vitest
197193
run: |
198194
cd ./frontend && npm run test -- --run
199-
200-
e2e-tests-browserstack:
201-
name: e2e-tests-browserstack
202-
needs: detect-changes
203-
if: needs.detect-changes.outputs.validate-frontend == 'true' || needs.detect-changes.outputs.validate-backend == 'true' || needs.detect-changes.outputs.validate-e2e == 'true'
204-
runs-on: ubuntu-latest
205-
environment: staging
206-
env:
207-
APPT_LOGIN_EMAIL: ${{ secrets.E2E_APPT_STAGE_LOGIN_EMAIL }}
208-
APPT_LOGIN_PWORD: ${{ secrets.E2E_APPT_STAGE_LOGIN_PASSWORD }}
209-
APPT_DISPLAY_NAME: ${{ secrets.E2E_APPT_STAGE_DISPLAY_NAME }}
210-
APPT_MY_SHARE_LINK: ${{ secrets.E2E_APPT_STAGE_MY_SHARE_LINK }}
211-
APPT_BOOKEE_EMAIL: ${{ secrets.E2E_APPT_STAGE_BOOKEE_EMAIL }}
212-
steps:
213-
- uses: actions/checkout@v4
214-
215-
- uses: actions/setup-node@v4
216-
with:
217-
node-version: 20
218-
cache: 'npm'
219-
cache-dependency-path: 'test/e2e/package-lock.json'
220-
221-
- name: Install dependencies
222-
run: |
223-
cd ./test/e2e
224-
npm install
225-
226-
- name: BrowserStack Env Setup
227-
uses: browserstack/github-actions/setup-env@master
228-
with:
229-
username: ${{ secrets.BROWSERSTACK_USERNAME }}
230-
access-key: ${{ secrets.BROWSERSTACK_ACCESS_KEY }}
231-
project-name: 'Thunderbird Appointment'
232-
build-name: 'E2E Tests: BUILD_INFO'
233-
234-
- name: Run E2E Tests on Browserstack
235-
run: |
236-
cd ./test/e2e
237-
cp .env.stage.example .env
238-
npm run e2e-test-browserstack-gha

0 commit comments

Comments
 (0)