Skip to content

E2E Regression Tests #221

E2E Regression Tests

E2E Regression Tests #221

name: E2E Regression Tests
on:
schedule:
- cron: "0 7 * * *"
workflow_dispatch:
permissions:
contents: read
jobs:
e2e-regression-tests:
name: Run E2E Tests (${{ matrix.browser }})
runs-on: ubuntu-latest
timeout-minutes: 90
strategy:
fail-fast: false
matrix:
browser: [chromium, firefox, webkit]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 9
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "20"
cache: "pnpm"
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Install Playwright browsers
run: pnpm exec playwright install --with-deps ${{ matrix.browser }}
working-directory: apps/wallets/quickstart-devkit
- name: Build dependencies
run: pnpm build --filter=@crossmint/client-sdk-react-ui --filter=@crossmint/wallets-sdk --filter=@crossmint/client-sdk-react-base
working-directory: .
- name: Run E2E regression tests (${{ matrix.browser }})
id: run-tests
working-directory: apps/wallets/quickstart-devkit
env:
NEXT_PUBLIC_CROSSMINT_API_KEY: ${{ secrets.NEXT_PUBLIC_CROSSMINT_AUTH_SMART_WALLET_API_KEY }}
NEXT_PUBLIC_EVM_CHAIN: "base-sepolia"
TESTS_CROSSMINT_API_KEY: ${{ secrets.TESTS_CROSSMINT_API_KEY_SMOKE_TESTS }}
MAILOSAUR_API_KEY: ${{ secrets.MAILOSAUR_API_KEY }}
MAILOSAUR_SERVER_ID: ${{ secrets.SERVER_ID_MAILOSAUR }}
MAILOSAUR_PHONE_NUMBER: ${{ secrets.PHONE_NUMBER_MAILOSAUR }}
PLAYWRIGHT_BASE_URL: "http://localhost:3000"
# Per-browser wallet identity: browser jobs run concurrently, and
# simultaneous OTP requests for the same email get rate-limited/blocked.
# Each browser gets its own persistent wallet, reused across runs.
TESTS_WALLET_EMAIL_SUFFIX: e2e-${{ matrix.browser }}
run: |
mkdir -p test-results
pnpm exec playwright test --project=${{ matrix.browser }} || true
if [ ! -f test-results/playwright-results.json ]; then
echo "::error::No test results file generated — no tests were discovered. Check testMatch patterns in playwright.config.ts."
exit 1
fi
- name: Generate test report
if: always()
working-directory: apps/wallets/quickstart-devkit
run: |
mkdir -p test-results
if [ -f test-results/playwright-results.json ]; then
node scripts/generate-test-report.js test-results/playwright-results.json > test-results/report.md || printf "# E2E Regression Test Results\n\nFailed to generate report from JSON.\n" > test-results/report.md
else
printf "# E2E Regression Test Results\n\nTest results file not found.\n" > test-results/report.md
fi
- name: Upload test results (${{ matrix.browser }})
if: always()
uses: actions/upload-artifact@v4
with:
name: e2e-test-results-${{ matrix.browser }}
path: apps/wallets/quickstart-devkit/test-results/
retention-days: 30
notify:
name: Notify Slack
runs-on: ubuntu-latest
needs: e2e-regression-tests
if: always()
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Download chromium results
uses: actions/download-artifact@v4
with:
name: e2e-test-results-chromium
path: test-results/chromium
continue-on-error: true
- name: Download firefox results
uses: actions/download-artifact@v4
with:
name: e2e-test-results-firefox
path: test-results/firefox
continue-on-error: true
- name: Download webkit results
uses: actions/download-artifact@v4
with:
name: e2e-test-results-webkit
path: test-results/webkit
continue-on-error: true
- name: Parse results and send to Slack
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_QA_ALERTS_WEBHOOK }}
GITHUB_RUN_ID: ${{ github.run_id }}
GITHUB_REPOSITORY: ${{ github.repository }}
GITHUB_SHA: ${{ github.sha }}
MATRIX_RESULT: ${{ needs.e2e-regression-tests.result }}
run: node apps/wallets/quickstart-devkit/scripts/notify-slack.js