From d80cc185da887e5902b73a0959a34840893d2a6e Mon Sep 17 00:00:00 2001 From: David Baker Date: Thu, 17 Oct 2024 13:11:43 +0100 Subject: [PATCH] Deflake unskippable verification Discovering what is the correct way of asserting that an element is *not* on screen with Playwright, which apparently is nontrivial. --- playwright/e2e/login/login.spec.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/playwright/e2e/login/login.spec.ts b/playwright/e2e/login/login.spec.ts index 696ecb183c8..e1307f7402d 100644 --- a/playwright/e2e/login/login.spec.ts +++ b/playwright/e2e/login/login.spec.ts @@ -217,7 +217,7 @@ test.describe("Login", () => { const h1 = await page.getByRole("heading", { name: "Verify this device", level: 1 }); await expect(h1).toBeVisible(); - expect(h1.locator(".mx_CompleteSecurity_skip")).not.toBeVisible(); + await expect(h1.locator(".mx_CompleteSecurity_skip")).toHaveCount(0); }); }); });