Repository navigation
98 lines (83 loc) · 3.08 KB
/
Copy pathplaywright.yml
File metadata and controls
98 lines (83 loc) · 3.08 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
name: E2E Tests (Playwright + Fineract)
on:
push:
branches: [main, dev]
pull_request:
branches: [main, dev]
concurrency:
group: e2e-${{ github.ref }}
cancel-in-progress: true
jobs:
e2e:
name: Playwright E2E
runs-on: ubuntu-latest
timeout-minutes: 45
env:
CI: true
E2E_BASE_URL: http://localhost:4200
E2E_FINERACT_URL: https://localhost:8443
E2E_USERNAME: mifos
E2E_PASSWORD: password
E2E_TENANT_ID: default
NODE_TLS_REJECT_UNAUTHORIZED: '0'
# Written by the `json` reporter in `npm run playwright:ci`. It sits inside
# playwright-report/ so the existing upload keeps it on every run. That only
# holds while `json` is listed after `html`: reporters finish in the order
# listed, and the html reporter clears this folder when it finishes.
PLAYWRIGHT_JSON_OUTPUT_FILE: playwright-report/results.json
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Use Node.js 26
uses: actions/setup-node@v6
with:
node-version: '26.13.0'
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Install Playwright browsers
run: npx playwright install --with-deps chromium
# `up -d` blocks until every `depends_on: condition: service_healthy`
# dependency reports healthy, so Postgres and Fineract are already up by
# the time this step returns. Readiness beyond that — Fineract seed data,
# and the web-app container, which has no compose healthcheck — is probed
# by `playwright/global-setup.ts` (pollFineract / pollWebApp), which runs
# in CI as part of the test command below.
- name: Start E2E infrastructure
run: docker compose -f docker-compose.e2e.yml up -d --build
- name: Run Playwright tests
run: npm run playwright:ci
- name: Summarize flaky tests
if: always()
# Reporting only: a problem in this step must never change the job result.
continue-on-error: true
run: node scripts/summarize-flaky-tests.js "$PLAYWRIGHT_JSON_OUTPUT_FILE"
- name: Dump Docker logs on failure
if: failure()
run: |
echo "=== Fineract ==="
docker logs e2e-fineract --tail 100 2>&1 || true
echo "=== PostgreSQL ==="
docker logs e2e-postgres --tail 50 2>&1 || true
echo "=== Web-App ==="
docker logs e2e-web-app --tail 50 2>&1 || true
echo "=== Memory ==="
docker stats --no-stream || true
- name: Upload Playwright report
uses: actions/upload-artifact@v7
if: always()
with:
name: playwright-report
path: playwright-report/
retention-days: 7
- name: Upload test results
uses: actions/upload-artifact@v7
if: failure()
with:
name: test-results
path: test-results/
retention-days: 7
- name: Tear down E2E infrastructure
if: always()
run: |
docker compose -f docker-compose.e2e.yml down -v --remove-orphans