Skip to content

Commit

Permalink
all component types correctly setting data fields
Browse files Browse the repository at this point in the history
  • Loading branch information
jessicamcinchak committed Jan 3, 2025
1 parent c2d9133 commit b94e92a
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 9 deletions.
10 changes: 8 additions & 2 deletions e2e/tests/ui-driven/src/create-flow.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ test.describe("Flow creation, publish and preview", () => {
await publishService(page);
});

test("Can preview a published flow", async ({
test("Can preview a published flow with an external portal", async ({
browser,
}: {
browser: Browser;
Expand All @@ -243,12 +243,17 @@ test.describe("Flow creation, publish and preview", () => {
userId: context.user!.id!,
});

await page.goto(`/${context.team.slug}/${serviceProps.slug}`);
await navigateToService(page, serviceProps.slug);

await expect(
page.getByRole("link", { name: "E2E/an-external-portal-service" }),
).toBeVisible();

const previewLink = page.getByRole("link", {
name: "Open published service",
});
await expect(previewLink).toBeVisible();

await page.goto(
`/${context.team.slug}/${serviceProps.slug}/published?analytics=false`,
);
Expand All @@ -275,6 +280,7 @@ test.describe("Flow creation, publish and preview", () => {
});
await clickContinue({ page });

// The external portal question has been flattened into the overall flow data structure and can be successfully navigated through
await answerQuestion({
page,
title: externalPortalFlowData.title,
Expand Down
15 changes: 10 additions & 5 deletions e2e/tests/ui-driven/src/helpers/addComponent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,16 @@ const createBaseComponent = async (
await page.getByRole("combobox", { name: "Data field" }).click();
await page
.getByRole("combobox", { name: "Data field" })
.fill(options?.[0] || "");
.fill(options?.[0] || "proposal.address");
await page.getByRole("combobox", { name: "Data field" }).press("Enter");
break;
case ComponentType.ContactInput:
await page.getByPlaceholder("Title").fill(title || "");
await page.getByRole("combobox", { name: "Data field" }).click();
await page
.getByRole("combobox", { name: "Data field" })
.fill(options?.[0] || "");
.fill(options?.[0] || "proposal.contact");
await page.getByRole("combobox", { name: "Data field" }).press("Enter");
break;
case ComponentType.TaskList:
await page.getByPlaceholder("Main Title").fill(title || "");
Expand Down Expand Up @@ -121,21 +123,24 @@ const createBaseComponent = async (
await page.getByRole("combobox", { name: "Data field" }).click();
await page
.getByRole("combobox", { name: "Data field" })
.fill(options?.[0] || "");
.fill(options?.[0] || "otherDocument");
await page.getByRole("combobox", { name: "Data field" }).press("Enter");
break;
case ComponentType.FileUploadAndLabel:
await page.getByPlaceholder("File type").fill(options?.[0] || "");
await page.getByRole("combobox", { name: "Data field" }).click();
await page
.getByRole("combobox", { name: "Data field" })
.fill(options?.[1] || "");
.fill(options?.[1] || "otherDocument");
await page.getByRole("combobox", { name: "Data field" }).press("Enter");
break;
case ComponentType.List:
await page.getByPlaceholder("Title").fill(title || "");
await page.getByRole("combobox", { name: "Data field" }).click();
await page
.getByRole("combobox", { name: "Data field" })
.fill(options?.[0] || "");
.fill(options?.[0] || "proposal.list");
await page.getByRole("combobox", { name: "Data field" }).press("Enter");
break;
case ComponentType.Content:
await page
Expand Down
4 changes: 2 additions & 2 deletions e2e/tests/ui-driven/src/helpers/userActions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -328,14 +328,14 @@ export async function answerListInput(
await page
.getByRole("combobox", { name: "What best describes this unit?" })
.click();
await page.getByRole("option", { name: unitType }).click();
await page.getByRole("option", { name: unitType, exact: true }).click();

await page
.getByRole("combobox", {
name: "What best describes the tenure of this unit?",
})
.click();
await page.getByRole("option", { name: tenure }).click();
await page.getByRole("option", { name: tenure, exact: true }).click();

await page
.getByLabel("How many bedrooms does this unit have?")
Expand Down

0 comments on commit b94e92a

Please sign in to comment.