From e56fb7cfc80decc1fa07b30864d33d0cbfd834cd Mon Sep 17 00:00:00 2001 From: fkwp Date: Fri, 30 May 2025 14:10:57 +0200 Subject: [PATCH] use .toBeVisible instead of continueButton.isVisible --- playwright/fixtures/widget-user.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/playwright/fixtures/widget-user.ts b/playwright/fixtures/widget-user.ts index 50949292..49aaecf5 100644 --- a/playwright/fixtures/widget-user.ts +++ b/playwright/fixtures/widget-user.ts @@ -95,11 +95,14 @@ async function registerUser( await page.getByRole("textbox", { name: "Confirm password" }).fill(PASSWORD); await page.getByRole("button", { name: "Register" }).click(); const continueButton = page.getByRole("button", { name: "Continue" }); - if (await continueButton.isVisible().catch(() => false)) { + try { + await expect(continueButton).toBeVisible({ timeout: 5000 }); await page .getByRole("textbox", { name: "Password", exact: true }) .fill(PASSWORD); await continueButton.click(); + } catch { + // continueButton not visible, continue as normal } await expect( page.getByRole("heading", { name: `Welcome ${username}` }),