Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 7 additions & 44 deletions .github/workflows/playwright.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,53 +41,17 @@ jobs:
- 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: Wait for PostgreSQL
run: |
timeout 60 bash -c '
until docker exec e2e-postgres pg_isready -U postgres 2>/dev/null; do
sleep 2
done
'
echo "✅ PostgreSQL ready"

- name: Wait for Fineract backend
run: |
timeout 300 bash -c '
until docker ps --filter "health=healthy" --filter "name=e2e-fineract" | grep -q healthy; do
echo " … Fineract not healthy yet"
sleep 10
done
'
curl -fk --retry 30 --retry-all-errors --connect-timeout 10 --retry-delay 10 \
https://localhost:8443/fineract-provider/actuator/health
echo ""
echo "✅ Fineract ready"

- name: Verify Fineract initialization complete
run: |
AUTH_HEADER=$(echo -n "${E2E_USERNAME}:${E2E_PASSWORD}" | base64 | tr -d '\n')
timeout 120 bash -c "
until curl -fsk \
-H 'Fineract-Platform-TenantId: ${E2E_TENANT_ID}' \
-H 'Authorization: Basic ${AUTH_HEADER}' \
https://localhost:8443/fineract-provider/api/v1/offices 2>/dev/null | grep -q 'Head Office'; do
echo ' … waiting for seed data'
sleep 5
done
"
echo "✅ Fineract initialization complete"

- name: Wait for web-app
run: |
curl -f --retry 20 --retry-all-errors --connect-timeout 5 --retry-delay 5 \
http://localhost:4200 > /dev/null 2>&1
echo "✅ Web-app ready"

- name: Run Playwright tests
run: npx playwright test --reporter=html,github --workers=1
run: npm run playwright:ci

- name: Dump Docker logs on failure
if: failure()
Expand Down Expand Up @@ -121,4 +85,3 @@ jobs:
if: always()
run: |
docker compose -f docker-compose.e2e.yml down -v --remove-orphans
docker system prune -f
Loading