Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test(e2e): Setup FEE_BREAKDOWN feature flag #4065

Merged
merged 3 commits into from
Dec 11, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions e2e/tests/ui-driven/src/invite-to-pay/nominee.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { PaymentRequest, Session } from "@opensystemslab/planx-core/types";

Check failure on line 1 in e2e/tests/ui-driven/src/invite-to-pay/nominee.spec.ts

View workflow job for this annotation

GitHub Actions / E2E tests

[chromium] › invite-to-pay/nominee.spec.ts:51:7 › Nominee journey @regression › responding to a valid payment request

1) [chromium] › invite-to-pay/nominee.spec.ts:51:7 › Nominee journey @regression › responding to a valid payment request Error: "context" and "page" fixtures are not supported in "beforeAll" since they are created on a per-test basis. If you would like to reuse a single page between tests, create context manually with browser.newContext(). See https://aka.ms/playwright/reuse-page for details. If you would like to configure your page before each test, do that in beforeEach hook instead.

Check failure on line 1 in e2e/tests/ui-driven/src/invite-to-pay/nominee.spec.ts

View workflow job for this annotation

GitHub Actions / E2E tests

[chromium] › invite-to-pay/nominee.spec.ts:51:7 › Nominee journey @regression › responding to a valid payment request

1) [chromium] › invite-to-pay/nominee.spec.ts:51:7 › Nominee journey @regression › responding to a valid payment request Retry #1 ─────────────────────────────────────────────────────────────────────────────────────── Error: "context" and "page" fixtures are not supported in "beforeAll" since they are created on a per-test basis. If you would like to reuse a single page between tests, create context manually with browser.newContext(). See https://aka.ms/playwright/reuse-page for details. If you would like to configure your page before each test, do that in beforeEach hook instead.

Check failure on line 1 in e2e/tests/ui-driven/src/invite-to-pay/nominee.spec.ts

View workflow job for this annotation

GitHub Actions / E2E tests

[chromium] › invite-to-pay/nominee.spec.ts:51:7 › Nominee journey @regression › responding to a valid payment request

1) [chromium] › invite-to-pay/nominee.spec.ts:51:7 › Nominee journey @regression › responding to a valid payment request Retry #2 ─────────────────────────────────────────────────────────────────────────────────────── Error: "context" and "page" fixtures are not supported in "beforeAll" since they are created on a per-test basis. If you would like to reuse a single page between tests, create context manually with browser.newContext(). See https://aka.ms/playwright/reuse-page for details. If you would like to configure your page before each test, do that in beforeEach hook instead.
import { APIRequestContext, Page, expect, test } from "@playwright/test";
import { GraphQLClient, gql } from "graphql-request";
import { v4 as uuidV4 } from "uuid";
Expand All @@ -8,7 +8,7 @@
setUpTestContext,
tearDownTestContext,
} from "../helpers/context";
import { cards } from "../helpers/globalHelpers";
import { cards, setFeatureFlag } from "../helpers/globalHelpers";
import { fillGovUkCardDetails } from "../helpers/userActions";
import inviteToPayFlow from "../mocks/flows/invite-to-pay-flow";
import { getPaymentRequestBySessionId } from "./helpers";
Expand All @@ -29,6 +29,10 @@

const adminGQLClient = getGraphQLClient();

test.beforeAll(async ({ page }) => {
await setFeatureFlag(page, "FEE_BREAKDOWN");
});

test.describe("Nominee journey @regression", async () => {
test.beforeAll(async () => {
try {
Expand Down Expand Up @@ -60,7 +64,8 @@
"Add a verandah or deck and changes to internal walls or layout";
await expect(page.getByText(formattedProjectType)).toBeVisible();

await expect(page.getByText("Fee breakdown")).toBeVisible();
await expect(page.getByText("Fee")).toBeVisible();
await expect(page.getByTestId("fee-breakdown-table")).toBeVisible();

const payButton = page.getByRole("button", {
name: "Pay using GOV.UK Pay",
Expand Down Expand Up @@ -88,7 +93,7 @@
context.flow?.slug
}/pay?analytics=false&paymentRequestId=INVALID-ID`;
await page.goto(invalidPaymentRequestURL);
await page.waitForLoadState("networkidle");

Check warning on line 96 in e2e/tests/ui-driven/src/invite-to-pay/nominee.spec.ts

View workflow job for this annotation

GitHub Actions / E2E tests

Unexpected use of networkidle

Check warning on line 96 in e2e/tests/ui-driven/src/invite-to-pay/nominee.spec.ts

View workflow job for this annotation

GitHub Actions / E2E tests

Unexpected use of networkidle

await expect(page.getByText(PAYMENT_NOT_FOUND_TEXT)).toBeVisible();
});
Expand All @@ -96,7 +101,7 @@
test("navigating to a URL without a paymentRequestId", async ({ page }) => {
const invalidPaymentRequestURL = `/${context.team!.slug!}/${context.flow?.slug}/pay?analytics=false`;
await page.goto(invalidPaymentRequestURL);
await page.waitForLoadState("networkidle");

Check warning on line 104 in e2e/tests/ui-driven/src/invite-to-pay/nominee.spec.ts

View workflow job for this annotation

GitHub Actions / E2E tests

Unexpected use of networkidle

Check warning on line 104 in e2e/tests/ui-driven/src/invite-to-pay/nominee.spec.ts

View workflow job for this annotation

GitHub Actions / E2E tests

Unexpected use of networkidle

await expect(page.getByText(PAYMENT_NOT_FOUND_TEXT)).toBeVisible();
});
Expand Down Expand Up @@ -130,7 +135,7 @@
) {
const paymentRequestURL = `/${context.team!.slug!}/${context.flow?.slug}/pay?analytics=false&paymentRequestId=${paymentRequest.id}`;
await page.goto(paymentRequestURL);
await page.waitForLoadState("networkidle");

Check warning on line 138 in e2e/tests/ui-driven/src/invite-to-pay/nominee.spec.ts

View workflow job for this annotation

GitHub Actions / E2E tests

Unexpected use of networkidle

Check warning on line 138 in e2e/tests/ui-driven/src/invite-to-pay/nominee.spec.ts

View workflow job for this annotation

GitHub Actions / E2E tests

Unexpected use of networkidle
}

async function setupPaymentRequest(
Expand Down
Loading