fix: stabilize flaky E2E booking sheet tests by waiting for button visibility (#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>
This commit is contained in:
Romit
2026-03-28 11:37:55 -03:00
committed by GitHub
co-authored by Devin AI
parent 0f4717e0be
commit 31f40764da
2 changed files with 6 additions and 3 deletions
@@ -100,7 +100,9 @@ async function setupBookingsAndOpenSheet({
const firstBookingItem = page.locator(`[data-booking-uid="${fixtures[0].uid}"]`);
await expect(firstBookingItem).toBeVisible();
await firstBookingItem.locator('[role="button"]').first().click();
const firstButton = firstBookingItem.locator('[role="button"]').first();
await firstButton.waitFor({ state: "visible" });
await firstButton.click();
const sheet = page.locator('[role="dialog"]');
await expect(sheet).toBeVisible();
+3 -2
View File
@@ -798,8 +798,9 @@ test.describe("Bookings", () => {
const bookingItem = page.locator(`[data-booking-uid="${bookingFixture.uid}"]`);
await expect(bookingItem).toBeVisible();
await bookingItem.locator('[role="button"]').first().click();
const bookingButton = bookingItem.locator('[role="button"]').first();
await bookingButton.waitFor({ state: "visible" });
await bookingButton.click();
await expect(page).toHaveURL(new RegExp(`[?&]uid=${bookingFixture.uid}(&|$)`));
} finally {