diff --git a/e2e/tests/ui-driven/src/create-flow.spec.ts b/e2e/tests/ui-driven/src/create-flow.spec.ts index 9407992289..dab9f9d4db 100644 --- a/e2e/tests/ui-driven/src/create-flow.spec.ts +++ b/e2e/tests/ui-driven/src/create-flow.spec.ts @@ -25,7 +25,11 @@ import { createExternalPortal, createQuestionWithOptions, } from "./helpers/addComponent"; -import { navigateToService, publishService, turnServiceOnline } from "./helpers/navigateAndPublish"; +import { + navigateToService, + publishService, + turnServiceOnline, +} from "./helpers/navigateAndPublish"; test.describe("Flow creation, publish and preview", () => { let context: Context = { @@ -129,7 +133,7 @@ test.describe("Flow creation, publish and preview", () => { await page.goto(`/${context.team.slug}/${serviceProps.slug}`); - await publishService(page) + await publishService(page); const previewLink = page.getByRole("link", { name: "Open published service", @@ -164,7 +168,7 @@ test.describe("Flow creation, publish and preview", () => { await page.goto(`/${context.team.slug}/${serviceProps.slug}`); -await turnServiceOnline(page) + await turnServiceOnline(page); // Exit back to main Editor page page.locator('[aria-label="Editor"]').click(); @@ -209,10 +213,10 @@ await turnServiceOnline(page) externalPortalFlowData.answers[1], ]); - await publishService(page) - await turnServiceOnline(page) + await publishService(page); + await turnServiceOnline(page); - navigateToService(page, serviceProps.slug) + navigateToService(page, serviceProps.slug); await createExternalPortal(page, page.locator("li:nth-child(6)")); @@ -220,7 +224,7 @@ await turnServiceOnline(page) page.getByRole("link", { name: "E2E/an-external-portal-service" }), ).toBeVisible(); - await publishService(page) + await publishService(page); }); test("Can preview a published flow", async ({ diff --git a/e2e/tests/ui-driven/src/helpers/navigateAndPublish.ts b/e2e/tests/ui-driven/src/helpers/navigateAndPublish.ts index d66b4055b2..1858537eb0 100644 --- a/e2e/tests/ui-driven/src/helpers/navigateAndPublish.ts +++ b/e2e/tests/ui-driven/src/helpers/navigateAndPublish.ts @@ -1,31 +1,28 @@ import { expect, Page } from "@playwright/test"; import { contextDefaults } from "./context"; -export const navigateToService = async (page: Page, slug:string) => { - - await page.goto(`/${contextDefaults.team.slug}/${slug}`); +export const navigateToService = async (page: Page, slug: string) => { + await page.goto(`/${contextDefaults.team.slug}/${slug}`); - await expect( - page.getByRole("link", { name: slug }), - ).toBeVisible(); + await expect(page.getByRole("link", { name: slug })).toBeVisible(); - return true -} + return true; +}; -export const publishService = async (page:Page) => { - page.getByRole("button", { name: "CHECK FOR CHANGES TO PUBLISH" }).click(); - await expect( - page.getByRole("heading", { name: "Check for changes to publish" }), - ).toBeVisible(); - page.getByRole("button", { name: "PUBLISH", exact: true }).click(); -} +export const publishService = async (page: Page) => { + page.getByRole("button", { name: "CHECK FOR CHANGES TO PUBLISH" }).click(); + await expect( + page.getByRole("heading", { name: "Check for changes to publish" }), + ).toBeVisible(); + page.getByRole("button", { name: "PUBLISH", exact: true }).click(); +}; -export const turnServiceOnline = async (page: Page) =>{ - page.locator('[aria-label="Service settings"]').click(); - page.getByLabel("Offline").click(); +export const turnServiceOnline = async (page: Page) => { + page.locator('[aria-label="Service settings"]').click(); + page.getByLabel("Offline").click(); - page.getByRole("button", { name: "Save", disabled: false }).click(); - await expect( - page.getByText("Service settings updated successfully"), - ).toBeVisible(); -} \ No newline at end of file + page.getByRole("button", { name: "Save", disabled: false }).click(); + await expect( + page.getByText("Service settings updated successfully"), + ).toBeVisible(); +}; diff --git a/e2e/tests/ui-driven/src/invite-to-pay/helpers.ts b/e2e/tests/ui-driven/src/invite-to-pay/helpers.ts index 1680c5afd0..ff7b23239b 100644 --- a/e2e/tests/ui-driven/src/invite-to-pay/helpers.ts +++ b/e2e/tests/ui-driven/src/invite-to-pay/helpers.ts @@ -14,8 +14,9 @@ import { * Navigates to pay component whilst completing the minimum requirements for an Invite to Pay flow */ export async function navigateToPayComponent(page: Page, context: Context) { - const previewURL = `/${context.team!.slug!}/${context.flows?.[0] - .slug}/published?analytics=false`; + const previewURL = `/${context.team!.slug!}/${ + context.flows?.[0].slug + }/published?analytics=false`; await page.goto(previewURL); await fillInEmail({ page, context });