Skip to content

Commit

Permalink
fix(e2e): Missing clicks and enters
Browse files Browse the repository at this point in the history
  • Loading branch information
DafyddLlyr committed Dec 20, 2024
1 parent 867a6c2 commit e57ba7f
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion e2e/tests/ui-driven/src/helpers/addComponent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,9 @@ export const createQuestionWithDataFieldOptions = async (
await locatingNode.click();
await page.getByRole("dialog").waitFor();
await page.getByPlaceholder("Text").fill(questionText);
await page.getByRole("combobox", { name: "Data field" }).click();
await page.getByRole("combobox", { name: "Data field" }).fill(dataField);
await page.getByRole("combobox", { name: "Data field" }).press("Enter");
await createComponentOptionsWithDataValues(page, options);
await page.locator('button[form="modal"][type="submit"]').click();
};
Expand Down Expand Up @@ -392,11 +394,15 @@ 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).click();
await page
.getByRole("combobox", { name: "Data field" })
.nth(index)
.fill(option.dataValue);
await page
.getByRole("combobox", { name: "Data field" })
.nth(index)
.press("Enter");
index++;
}
}
Expand Down

0 comments on commit e57ba7f

Please sign in to comment.