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 all commits
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
11 changes: 9 additions & 2 deletions e2e/tests/ui-driven/src/invite-to-pay/nominee.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 Down Expand Up @@ -40,6 +40,10 @@
}
});

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

test.afterAll(async () => {
await tearDownTestContext();
});
Expand All @@ -60,7 +64,10 @@
"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.getByRole("heading", { name: "Fee", level: 3 }),
).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 +95,7 @@
context.flow?.slug
}/pay?analytics=false&paymentRequestId=INVALID-ID`;
await page.goto(invalidPaymentRequestURL);
await page.waitForLoadState("networkidle");

Check warning on line 98 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 98 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 +103,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 106 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 106 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 +137,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 140 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 140 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