Playwright Cron Tests #1873
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: Playwright Cron Tests | |
on: | |
workflow_dispatch: | |
schedule: | |
# every hour, 9-17:00, Mon - Fri | |
- cron: "0 9-17 * * 1-5" | |
jobs: | |
test: | |
timeout-minutes: 60 | |
runs-on: ubuntu-latest | |
env: | |
PAYPAL_TEST_PASSWORD: ${{ secrets.PAYPAL_TEST_PASSWORD }} | |
GOOGLE_CHAT_WEB_HOOK: ${{ secrets.GOOGLE_CHAT_WEB_HOOK }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Node and Install Dependencies | |
uses: ./.github/actions/setup-node-and-install | |
- name: Install Playwright Browsers | |
run: pnpm --filter support-e2e exec playwright install --with-deps | |
- name: Run Playwright tests | |
run: pnpm --filter support-e2e test-cron | |
- uses: actions/upload-artifact@v4 | |
if: ${{ !cancelled() }} | |
with: | |
name: playwright-report | |
path: support-e2e/playwright-report/ | |
retention-days: 30 | |
- name: Notify on Failure | |
if: ${{ failure() }} | |
run: | | |
failedWorkflowRun="https://github.com/guardian/support-frontend/actions/runs/$GITHUB_RUN_ID" | |
prTrigger="https://github.com/guardian/support-frontend/pull/${{ github.event.number }}" | |
curl -X POST -H "Content-Type: application/json" "$GOOGLE_CHAT_WEB_HOOK" -d '{"text": "π¨ The Playwright cron tests for support-frontend have failed π¨\n\n- <'"$failedWorkflowRun"'|You can see the reason for this failure on GitHub>. \n\n π <https://github.com/guardian/support-frontend/wiki/Post-deployment-test-runbook|Check the runbook for a step by step guide>"}' |