From 8416b76bf60e6ac6a66d4064bba2f10081c8bf09 Mon Sep 17 00:00:00 2001 From: Hariom Balhara Date: Thu, 10 Nov 2022 13:15:10 +0530 Subject: [PATCH] Fix flakiness (#5454) --- apps/web/playwright/wipe-my-cal.e2e.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/apps/web/playwright/wipe-my-cal.e2e.ts b/apps/web/playwright/wipe-my-cal.e2e.ts index e40f727e11..cc417cf258 100644 --- a/apps/web/playwright/wipe-my-cal.e2e.ts +++ b/apps/web/playwright/wipe-my-cal.e2e.ts @@ -35,16 +35,16 @@ test.describe("Wipe my Cal App Test", () => { await bookings.create(pro.id, pro.username, eventType.id, {}); await pro.login(); await page.goto("/bookings/upcoming"); - await expect(page.locator("data-testid=wipe-today-button")).toBeVisible(); const $openBookingCount = await page.locator('[data-testid="bookings"] > *').count(); - await expect($openBookingCount).toBe(3); + expect($openBookingCount).toBe(3); await page.locator("data-testid=wipe-today-button").click(); - await page.locator("data-testid=send_request").click(); - const $openBookings = await page.locator('[data-testid="bookings"]'); + // Don't await send_request click, otherwise mutation can possibly occur before observer is attached + page.locator("data-testid=send_request").click(); + const $openBookings = page.locator('[data-testid="bookings"]'); await $openBookings.evaluate((ul) => { return new Promise((resolve) => new window.MutationObserver(() => {