From 61397e51841fa4d1093c824766b5beab09b09721 Mon Sep 17 00:00:00 2001 From: Anik Dhabal Babu <81948346+anikdhabal@users.noreply.github.com> Date: Wed, 7 May 2025 18:04:06 +0530 Subject: [PATCH] fix: e2e flakes (#20630) * fix * Update managed-event-types.e2e.ts * fix --- apps/web/playwright/hash-my-url.e2e.ts | 5 +++++ apps/web/playwright/login.2fa.e2e.ts | 7 ++----- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/apps/web/playwright/hash-my-url.e2e.ts b/apps/web/playwright/hash-my-url.e2e.ts index 35685f9ace..bb48cb87a2 100644 --- a/apps/web/playwright/hash-my-url.e2e.ts +++ b/apps/web/playwright/hash-my-url.e2e.ts @@ -23,6 +23,11 @@ test.describe("hash my url", () => { // We wait until loading is finished await page.waitForSelector('[data-testid="event-types"]'); await page.locator("ul[data-testid=event-types] > li a").first().click(); + await expect(page.getByTestId("vertical-tab-event_setup_tab_title")).toHaveAttribute( + "aria-current", + "page" + ); // fix the race condition + await expect(page.getByTestId("vertical-tab-event_setup_tab_title")).toContainText("Event Setup"); //fix the race condition // We wait for the page to load await page.locator(".primary-navigation >> text=Advanced").click(); // ignore if it is already checked, and click if unchecked diff --git a/apps/web/playwright/login.2fa.e2e.ts b/apps/web/playwright/login.2fa.e2e.ts index d55f453039..e9fa121434 100644 --- a/apps/web/playwright/login.2fa.e2e.ts +++ b/apps/web/playwright/login.2fa.e2e.ts @@ -50,16 +50,13 @@ test.describe("2FA Tests", async () => { secret: secret!, }); - // FIXME: this passes even when switch is not checked, compare to test - // below which checks for data-state="checked" and works as expected - await page.waitForSelector(`[data-testid=two-factor-switch]`); - await expect(page.locator(`[data-testid=two-factor-switch]`).isChecked()).toBeTruthy(); + await expect(page.getByTestId("backup-codes-download")).toBeVisible(); return user; }); await test.step("Logout", async () => { - await page.goto("/auth/logout"); + await users.logout(); }); await test.step("Login with 2FA enabled", async () => {