Add Playwright e2e tests for supporter mode and donation upsell #32
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: E2E Tests | |
| on: | |
| push: | |
| branches: | |
| - master | |
| pull_request: | |
| jobs: | |
| e2e: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| - name: Install root deps | |
| run: yarn install | |
| - name: Build join-flow bundle (E2E mode) | |
| working-directory: packages/join-flow | |
| run: npm run test:build | |
| - name: Install E2E deps | |
| working-directory: packages/join-e2e | |
| run: npm ci | |
| - name: Install Playwright browsers | |
| working-directory: packages/join-e2e | |
| run: npx playwright install --with-deps chromium | |
| - name: Start wp-env | |
| working-directory: packages/join-e2e | |
| run: npx wp-env start | |
| - name: Seed WordPress test environment | |
| working-directory: packages/join-e2e | |
| run: | | |
| npx wp-env run tests-cli wp eval-file /var/www/html/wp-content/e2e-scripts/setup.php | |
| npx wp-env run tests-cli wp rewrite flush --hard | |
| - name: Run E2E tests | |
| working-directory: packages/join-e2e | |
| run: npm test -- --reporter=list,html | |
| - uses: actions/upload-artifact@v4 | |
| if: failure() | |
| with: | |
| name: playwright-report | |
| path: packages/join-e2e/playwright-report/ |