test(stellar): add SEP-10 authentication flow tests #5
Workflow file for this run
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/**' | ||
| - '.github/workflows/e2e.yml' | ||
| pull_request: | ||
| branches: [main, develop] | ||
| paths: | ||
| - 'frontend/**' | ||
| jobs: | ||
| e2e: | ||
| timeout-minutes: 60 | ||
| runs-on: ubuntu-latest | ||
| services: | ||
| backend: | ||
| image: node:18 | ||
| options: >- | ||
| --health-cmd "curl -f http://localhost:4000/health || exit 1" | ||
| --health-interval 10s | ||
| --health-timeout 5s | ||
| --health-retries 5 | ||
| ports: | ||
| - 4000:4000 | ||
| env: | ||
| 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: STEST000000000000000000000000000000000000000000000000000 | ||
| SEP10_SERVER_KEY: STEST000000000000000000000000000000000000000000000000001 | ||
| JWT_SECRET: test-jwt-secret | ||
| NODE_ENV: test | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: '18' | ||
| - run: cd backend && npm install && npm start & | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: '18' | ||
| - name: Install frontend dependencies | ||
| run: cd frontend && npm install | ||
| - name: Install Playwright browsers | ||
| run: cd frontend && npx playwright install --with-deps | ||
| - name: Wait for backend to be ready | ||
| run: | | ||
| for i in {1..30}; do | ||
| if curl -f http://localhost:4000/health; then | ||
| echo "Backend is ready" | ||
| exit 0 | ||
| fi | ||
| echo "Waiting for backend... ($i/30)" | ||
| sleep 2 | ||
| done | ||
| echo "Backend failed to start" | ||
| exit 1 | ||
| - name: Run E2E tests | ||
| run: cd frontend && npm run test:e2e | ||
| env: | ||
| CI: true | ||
| - name: Upload test results | ||
| if: always() | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: playwright-report | ||
| path: frontend/playwright-report/ | ||
| retention-days: 30 | ||
| - name: Upload test videos | ||
| if: failure() | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: test-videos | ||
| path: frontend/test-results/ | ||
| retention-days: 7 | ||