Skip to content

Commit

Permalink
fix(e2e): Add click on combobox
Browse files Browse the repository at this point in the history
  • Loading branch information
DafyddLlyr committed Dec 20, 2024
1 parent 83e6e3a commit 5114475
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions e2e/tests/ui-driven/src/helpers/addComponent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,14 @@ const createBaseComponent = async (
break;
case ComponentType.AddressInput:
await page.getByPlaceholder("Title").fill(title || "");
await page.getByRole("combobox", { name: "Data field" }).click();
await page
.getByRole("combobox", { name: "Data field" })
.fill(options?.[0] || "");
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] || "");
Expand Down Expand Up @@ -112,18 +114,21 @@ const createBaseComponent = async (
}
break;
case ComponentType.FileUpload:
await page.getByRole("combobox", { name: "Data field" }).click();
await page
.getByRole("combobox", { name: "Data field" })
.fill(options?.[0] || "");
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] || "");
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] || "");
Expand Down Expand Up @@ -387,6 +392,7 @@ async function createComponentOptionsWithDataValues(
for (const option of options) {
await page.locator("button").filter({ hasText: "add new" }).click();
await page.getByPlaceholder("Option").nth(index).fill(option.optionText);
await page.getByRole("combobox", { name: "Data field" }).click();
await page
.getByRole("combobox", { name: "Data field" })
.nth(index)
Expand Down

0 comments on commit 5114475

Please sign in to comment.