Skip to content

Commit 31f4076

Browse files
fix: stabilize flaky E2E booking sheet tests by waiting for button visibility (calcom#28631)
Both booking-sheet-keyboard.e2e.ts and bookings-list.e2e.ts intermittently timeout in CI when clicking the booking item button before the DOM has finished rendering. Adding explicit waitFor({ state: 'visible' }) on the role=button element after the parent booking item is visible ensures the click target is fully ready. Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
1 parent 0f4717e commit 31f4076

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

apps/web/playwright/booking-sheet-keyboard.e2e.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,9 @@ async function setupBookingsAndOpenSheet({
100100

101101
const firstBookingItem = page.locator(`[data-booking-uid="${fixtures[0].uid}"]`);
102102
await expect(firstBookingItem).toBeVisible();
103-
await firstBookingItem.locator('[role="button"]').first().click();
103+
const firstButton = firstBookingItem.locator('[role="button"]').first();
104+
await firstButton.waitFor({ state: "visible" });
105+
await firstButton.click();
104106

105107
const sheet = page.locator('[role="dialog"]');
106108
await expect(sheet).toBeVisible();

apps/web/playwright/bookings-list.e2e.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -798,8 +798,9 @@ test.describe("Bookings", () => {
798798

799799
const bookingItem = page.locator(`[data-booking-uid="${bookingFixture.uid}"]`);
800800
await expect(bookingItem).toBeVisible();
801-
802-
await bookingItem.locator('[role="button"]').first().click();
801+
const bookingButton = bookingItem.locator('[role="button"]').first();
802+
await bookingButton.waitFor({ state: "visible" });
803+
await bookingButton.click();
803804

804805
await expect(page).toHaveURL(new RegExp(`[?&]uid=${bookingFixture.uid}(&|$)`));
805806
} finally {

0 commit comments

Comments
 (0)