-
Notifications
You must be signed in to change notification settings - Fork 91
130 lines (112 loc) · 3.91 KB
/
e2e.yml
File metadata and controls
130 lines (112 loc) · 3.91 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
name: Frontend E2E Tests
on:
push:
branches: [main, develop]
paths:
- 'frontend/**'
- 'backend/**'
- 'docker-compose.yml'
- 'docker-compose.e2e.yml'
- '.github/workflows/e2e.yml'
pull_request:
branches: [main, develop]
paths:
- 'frontend/**'
- 'backend/**'
- 'docker-compose.yml'
- 'docker-compose.e2e.yml'
jobs:
e2e:
name: E2E – issuer→patient journey
timeout-minutes: 30
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '18'
cache: 'npm'
cache-dependency-path: frontend/package-lock.json
- name: Install frontend dependencies
run: npm ci
working-directory: frontend
- name: Install Playwright browsers
run: npx playwright install chromium --with-deps
working-directory: frontend
- name: Start stack (HTTP-only override)
run: docker compose -f docker-compose.yml -f docker-compose.e2e.yml up -d --build
env:
# Minimal env so the backend starts without real Stellar keys
STELLAR_NETWORK: testnet
HORIZON_URL: https://horizon-testnet.stellar.org
SOROBAN_RPC_URL: https://soroban-testnet.stellar.org
STELLAR_NETWORK_PASSPHRASE: "Test SDF Network ; September 2015"
VACCINATIONS_CONTRACT_ID: CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABSC4
ADMIN_SECRET_KEY: SAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA0
ADMIN_PUBLIC_KEY: GAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAWHF
SEP10_SERVER_KEY: SAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA1
ISSUER_SECRET_KEY: SAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA2
JWT_SECRET: e2e-test-jwt-secret-not-for-production
- name: Wait for frontend to be ready
run: |
for i in $(seq 1 30); do
if curl -sf http://localhost:3000; then
echo "Frontend ready"; exit 0
fi
echo "Waiting... ($i/30)"; sleep 3
done
docker compose -f docker-compose.yml -f docker-compose.e2e.yml logs
exit 1
- name: Run E2E tests
run: npx playwright test e2e/issue-vaccination.spec.js --project=chromium
working-directory: frontend
env:
CI: true
- name: Stop stack
if: always()
run: docker compose -f docker-compose.yml -f docker-compose.e2e.yml down -v
- name: Upload Playwright report
if: always()
uses: actions/upload-artifact@v4
with:
name: playwright-report
path: frontend/playwright-report/
retention-days: 14
- name: Upload failure artifacts
if: failure()
uses: actions/upload-artifact@v4
with:
name: test-results
path: frontend/test-results/
retention-days: 7
visual:
name: Visual regression tests
timeout-minutes: 30
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '18'
cache: 'npm'
cache-dependency-path: frontend/package-lock.json
- name: Install frontend dependencies
run: npm ci
working-directory: frontend
- name: Install Playwright Chromium
run: npx playwright install chromium --with-deps
working-directory: frontend
- name: Run visual regression tests
run: npx playwright test e2e/visual.spec.js --project=chromium
working-directory: frontend
env:
CI: true
- name: Upload visual diff artifacts
if: failure()
uses: actions/upload-artifact@v4
with:
name: visual-diff-results
path: |
frontend/test-results/
frontend/playwright-report/
retention-days: 14