Skip to content

Commit

Permalink
Merge pull request #6421 from guardian/pd/playwright-ticket-tailor-pr…
Browse files Browse the repository at this point in the history
…od-fix2

Playwright: Ticket tailor re-enable, use test event
  • Loading branch information
paul-daniel-dempsey authored Oct 16, 2024
2 parents eb23eaf + b4ddb83 commit cda7025
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 27 deletions.
50 changes: 25 additions & 25 deletions .github/workflows/playwright-smoke.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,28 +14,28 @@ jobs:
env:
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-smoke
- 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 smoke tests for support-frontend have failed 🚨\n\n- <'"$failedWorkflowRun"'|You can see the reason for this failure on GitHub>. \n- <'"$prTrigger"'|PR that triggered this>.\n\n 📖 <https://github.com/guardian/support-frontend/wiki/Post-deployment-test-runbook|Check the runbook for a step by step guide>"}'
- 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-smoke
- 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 smoke tests for support-frontend have failed 🚨\n\n- <'"$failedWorkflowRun"'|You can see the reason for this failure on GitHub>. \n- <'"$prTrigger"'|PR that triggered this>.\n\n 📖 <https://github.com/guardian/support-frontend/wiki/Post-deployment-test-runbook|Check the runbook for a step by step guide>"}'
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,15 @@ test('Ticket Tailor iframe loads correctly', async ({
},
]);

// Remove test user cookie
await context.clearCookies({
name: '_test_username',
domain: baseURL ? new URL(baseURL).hostname : undefined,
path: '/',
});

// Navigate to the page containing the iframe
await page.goto('https://support.theguardian.com/uk/events/1347872');
await page.goto('https://support.theguardian.com/uk/events/1428771');

// Wait for the iframe to be present in the DOM
const iframe = await page.waitForSelector(
Expand All @@ -36,6 +43,6 @@ test('Ticket Tailor iframe loads correctly', async ({
if (frame) {
await frame.waitForSelector('body');
const content = await frame.content();
expect(content).toContain('Next');
expect(content).toContain('EndToEnd Test Event');
}
});

0 comments on commit cda7025

Please sign in to comment.