Skip to content

Commit

Permalink
chore(e2e): Update submit card details locator on GovPay [skip pizza]
Browse files Browse the repository at this point in the history
  • Loading branch information
DafyddLlyr committed Apr 11, 2024
1 parent 6ed961e commit 314cf7d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
4 changes: 4 additions & 0 deletions e2e/tests/ui-driven/src/globalHelpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,10 @@ export async function fillGovUkCardDetails({
await page.locator("button#submit-card-details").click();
}

export async function submitCardDetails(page: Page) {
await page.getByRole("button", { name: "Continue" }).click();

Check failure on line 261 in e2e/tests/ui-driven/src/globalHelpers.ts

View workflow job for this annotation

GitHub Actions / E2E tests

[chromium] › pay.spec.ts:52:7 › Gov Pay integration @regression › a successful payment

1) [chromium] › pay.spec.ts:52:7 › Gov Pay integration @regression › a successful payment ──────── Error: locator.click: Test timeout of 45000ms exceeded. Call log: - waiting for getByRole('button', { name: 'Continue' }) at globalHelpers.ts:261 259 | 260 | export async function submitCardDetails(page: Page) { > 261 | await page.getByRole("button", { name: "Continue" }).click(); | ^ 262 | } 263 | 264 | export async function answerFindProperty(page: Page) { at submitCardDetails (/home/runner/work/planx-new/planx-new/e2e/tests/ui-driven/src/globalHelpers.ts:261:56) at /home/runner/work/planx-new/planx-new/e2e/tests/ui-driven/src/pay.spec.ts:61:28

Check failure on line 261 in e2e/tests/ui-driven/src/globalHelpers.ts

View workflow job for this annotation

GitHub Actions / E2E tests

[chromium] › pay.spec.ts:52:7 › Gov Pay integration @regression › a successful payment

1) [chromium] › pay.spec.ts:52:7 › Gov Pay integration @regression › a successful payment ──────── Retry #1 ─────────────────────────────────────────────────────────────────────────────────────── Error: locator.click: Test timeout of 45000ms exceeded. Call log: - waiting for getByRole('button', { name: 'Continue' }) at globalHelpers.ts:261 259 | 260 | export async function submitCardDetails(page: Page) { > 261 | await page.getByRole("button", { name: "Continue" }).click(); | ^ 262 | } 263 | 264 | export async function answerFindProperty(page: Page) { at submitCardDetails (/home/runner/work/planx-new/planx-new/e2e/tests/ui-driven/src/globalHelpers.ts:261:56) at /home/runner/work/planx-new/planx-new/e2e/tests/ui-driven/src/pay.spec.ts:61:28

Check failure on line 261 in e2e/tests/ui-driven/src/globalHelpers.ts

View workflow job for this annotation

GitHub Actions / E2E tests

[chromium] › pay.spec.ts:52:7 › Gov Pay integration @regression › a successful payment

1) [chromium] › pay.spec.ts:52:7 › Gov Pay integration @regression › a successful payment ──────── Retry #2 ─────────────────────────────────────────────────────────────────────────────────────── Error: locator.click: Test timeout of 45000ms exceeded. Call log: - waiting for getByRole('button', { name: 'Continue' }) at globalHelpers.ts:261 259 | 260 | export async function submitCardDetails(page: Page) { > 261 | await page.getByRole("button", { name: "Continue" }).click(); | ^ 262 | } 263 | 264 | export async function answerFindProperty(page: Page) { at submitCardDetails (/home/runner/work/planx-new/planx-new/e2e/tests/ui-driven/src/globalHelpers.ts:261:56) at /home/runner/work/planx-new/planx-new/e2e/tests/ui-driven/src/pay.spec.ts:61:28

Check failure on line 261 in e2e/tests/ui-driven/src/globalHelpers.ts

View workflow job for this annotation

GitHub Actions / E2E tests

[chromium] › pay.spec.ts:85:7 › Gov Pay integration @regression › a retry attempt for a failed GOV.UK payment

2) [chromium] › pay.spec.ts:85:7 › Gov Pay integration @regression › a retry attempt for a failed GOV.UK payment Error: locator.click: Test timeout of 45000ms exceeded. Call log: - waiting for getByRole('button', { name: 'Continue' }) at globalHelpers.ts:261 259 | 260 | export async function submitCardDetails(page: Page) { > 261 | await page.getByRole("button", { name: "Continue" }).click(); | ^ 262 | } 263 | 264 | export async function answerFindProperty(page: Page) { at submitCardDetails (/home/runner/work/planx-new/planx-new/e2e/tests/ui-driven/src/globalHelpers.ts:261:56) at /home/runner/work/planx-new/planx-new/e2e/tests/ui-driven/src/pay.spec.ts:120:28

Check failure on line 261 in e2e/tests/ui-driven/src/globalHelpers.ts

View workflow job for this annotation

GitHub Actions / E2E tests

[chromium] › pay.spec.ts:85:7 › Gov Pay integration @regression › a retry attempt for a failed GOV.UK payment

2) [chromium] › pay.spec.ts:85:7 › Gov Pay integration @regression › a retry attempt for a failed GOV.UK payment Retry #1 ─────────────────────────────────────────────────────────────────────────────────────── Error: locator.click: Test timeout of 45000ms exceeded. Call log: - waiting for getByRole('button', { name: 'Continue' }) at globalHelpers.ts:261 259 | 260 | export async function submitCardDetails(page: Page) { > 261 | await page.getByRole("button", { name: "Continue" }).click(); | ^ 262 | } 263 | 264 | export async function answerFindProperty(page: Page) { at submitCardDetails (/home/runner/work/planx-new/planx-new/e2e/tests/ui-driven/src/globalHelpers.ts:261:56) at /home/runner/work/planx-new/planx-new/e2e/tests/ui-driven/src/pay.spec.ts:120:28
}

export async function answerFindProperty(page: Page) {
await setupOSMockResponse(page);
await page.getByLabel("Postcode").fill("SW1 1AA");
Expand Down
13 changes: 7 additions & 6 deletions e2e/tests/ui-driven/src/pay.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import {
fillGovUkCardDetails,
getSessionId,
log,
submitCardDetails,
waitForPaymentResponse,
} from "./globalHelpers";
import type { Page } from "@playwright/test";
Expand Down Expand Up @@ -57,7 +58,7 @@ test.describe("Gov Pay integration @regression", async () => {
page,
cardNumber: cards.successful_card_number,
});
await page.locator("#confirm").click();
await submitCardDetails(page);
const { paymentId } = await waitForPaymentResponse(page, context);
expect(paymentId).toBeTruthy();

Expand Down Expand Up @@ -116,7 +117,7 @@ test.describe("Gov Pay integration @regression", async () => {
page,
cardNumber: cards.successful_card_number,
});
await page.locator("#confirm").click();
await submitCardDetails(page);
const { paymentId } = await waitForPaymentResponse(page, context);
expect(paymentId).toBeTruthy();

Expand Down Expand Up @@ -167,7 +168,7 @@ test.describe("Gov Pay integration @regression", async () => {
page,
cardNumber: cards.successful_card_number,
});
await page.locator("#confirm").click();
await submitCardDetails(page);
const { paymentId } = await waitForPaymentResponse(page, context);
expect(paymentId).toBeTruthy();

Expand Down Expand Up @@ -224,7 +225,7 @@ test.describe("Gov Pay integration @regression", async () => {
// retry the payment
await page.getByText("Retry payment").click();
await page.getByText("Continue with your payment").click();
await page.locator("#confirm").click();
await page.getByRole("button", { name: "Continue" }).click();

const { paymentId } = await waitForPaymentResponse(page, context);
expect(paymentId).toBeTruthy();
Expand Down Expand Up @@ -275,7 +276,7 @@ test.describe("Gov Pay integration @regression", async () => {
page,
cardNumber: cards.successful_card_number,
});
await page.locator("#confirm").click();
await submitCardDetails(page);
const { paymentId: actualPaymentId } = await waitForPaymentResponse(
page,
context,
Expand Down Expand Up @@ -303,7 +304,7 @@ test.describe("Gov Pay integration @regression", async () => {
page,
cardNumber: cards.successful_card_number,
});
await page.locator("#confirm").click();
await submitCardDetails(page);
const { paymentId: actualPaymentId } = await waitForPaymentResponse(
page,
context,
Expand Down

0 comments on commit 314cf7d

Please sign in to comment.