From cf89046ede1a7de67b075ae557aa684489544fc9 Mon Sep 17 00:00:00 2001 From: Anik Dhabal Babu <81948346+anikdhabal@users.noreply.github.com> Date: Sat, 20 Sep 2025 17:17:01 +0530 Subject: [PATCH] fix: few more e2e flakes (#23966) --- apps/web/playwright/fixtures/users.ts | 4 ++++ apps/web/playwright/insights.e2e.ts | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/apps/web/playwright/fixtures/users.ts b/apps/web/playwright/fixtures/users.ts index cd5370e422..d4ac303f0f 100644 --- a/apps/web/playwright/fixtures/users.ts +++ b/apps/web/playwright/fixtures/users.ts @@ -684,6 +684,10 @@ const createUserFixture = (user: UserWithIncludes, page: Page) => { }, logout: async () => { await page.goto("/auth/logout"); + const logoutBtn = page.getByTestId("logout-btn"); + await expect(logoutBtn).toHaveText("Go back to the login page"); + await page.reload(); + await expect(logoutBtn).toHaveText("Go back to the login page"); }, getFirstTeamMembership: async () => { const memberships = await prisma.membership.findMany({ diff --git a/apps/web/playwright/insights.e2e.ts b/apps/web/playwright/insights.e2e.ts index 5f81d411d3..49ca82fd55 100644 --- a/apps/web/playwright/insights.e2e.ts +++ b/apps/web/playwright/insights.e2e.ts @@ -271,7 +271,9 @@ test.describe("Insights", async () => { ]; for (const title of expectedChartTitles) { - const chartCard = page.locator("[data-testid='panel-card'] h2").filter({ hasText: title }); + const chartCard = page + .locator("[data-testid='panel-card'] h2") + .filter({ hasText: new RegExp(`^${title}$`) }); await expect(chartCard).toBeVisible(); } });