Playwright Cron Tests #751
This file contains 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 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 20.11.0 | |
- name: Install dependencies | |
working-directory: ./support-e2e | |
run: yarn install | |
- name: Install Playwright Browsers | |
working-directory: ./support-e2e | |
run: yarn playwright install --with-deps | |
- name: Run Playwright tests | |
working-directory: ./support-e2e | |
run: yarn 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>"}' |