From c7ab4c7ecf7b05f32a85568bce1a667ad8c62703 Mon Sep 17 00:00:00 2001 From: Laurent Nguyen Date: Mon, 8 Jul 2024 13:52:48 +0200 Subject: [PATCH] Select dropdown option with playwright api instead of manual click --- test/sql/selfServeExample.spec.ts | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/test/sql/selfServeExample.spec.ts b/test/sql/selfServeExample.spec.ts index 24f89200c..67b5f59f8 100644 --- a/test/sql/selfServeExample.spec.ts +++ b/test/sql/selfServeExample.spec.ts @@ -7,11 +7,7 @@ test("Self Serve", async ({ page }) => { const loggingToggle = explorer.frame.locator("#enableLogging-toggle-input"); await expect(loggingToggle).toBeEnabled(); - const regionDropdown = explorer.frame.getByText("Select a region"); - await regionDropdown.click(); - const firstOption = explorer.frame.getByRole("option").first(); - await firstOption.waitFor(); - await firstOption.click(); + explorer.frame.locator("#regions-dropdown-input").selectOption({ index: 0 }); const currentRegionLabel = explorer.frame.getByLabel("Current Region"); await currentRegionLabel.waitFor();