From 1fc01225239c6a88047b0f9b67171c3dfba09848 Mon Sep 17 00:00:00 2001 From: David Baker Date: Thu, 17 Oct 2024 15:44:53 +0100 Subject: [PATCH] Deflake unskippable verification (#28222) 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 696ecb183c..e1307f7402 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); }); }); });