Merge pull request #428 from wealth4ever123/feat/global-error-handler #131
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |