Skip to content

Scheduling infrastructure for absolutely everyone.

test: few flaky e2e tests (#27171)

Anik Dhabal Babu01a8f53ce74c
diff --git a/apps/web/playwright/bookings-list.e2e.ts b/apps/web/playwright/bookings-list.e2e.ts
index b371fd4253c..b97c04968bf 100644
--- a/apps/web/playwright/bookings-list.e2e.ts
+++ b/apps/web/playwright/bookings-list.e2e.ts
@@ -361,9 +361,12 @@ test.describe("Bookings", () => {
//where ThirdUser is either organizer or attendee
const upcomingBookingsTable = page.locator('[data-testid="upcoming-bookings"]');
const bookingListItems = upcomingBookingsTable.locator('[data-testid="booking-item"]');
- const bookingListCount = await bookingListItems.count();
- expect(bookingListCount).toBe(3);
+ await expect
+ .poll(async () => {
+ return await bookingListItems.count();
+ })
+ .toBe(3);
//verify with the booking titles
const firstUpcomingBooking = bookingListItems.nth(0);
@@ -616,9 +619,12 @@ test.describe("Bookings", () => {
const upcomingBookingsTable = page.locator('[data-testid="upcoming-bookings"]');
const bookingListItems = upcomingBookingsTable.locator('[data-testid="booking-item"]');
- const bookingListCount = await bookingListItems.count();
- expect(bookingListCount).toBe(1);
+ await expect
+ .poll(async () => {
+ return await bookingListItems.count();
+ })
+ .toBe(1);
await expect(bookingListItems.first().locator(`text=${teamBooking!.title}`)).toBeVisible();
});
@@ -668,9 +674,13 @@ test.describe("Bookings", () => {
const upcomingBookingsTable = page.locator('[data-testid="upcoming-bookings"]');
const bookingListItems = upcomingBookingsTable.locator('[data-testid="booking-item"]');
- const bookingListCount = await bookingListItems.count();
+
+ await expect
+ .poll(async () => {
+ return await bookingListItems.count();
+ })
+ .toBe(1);
- expect(bookingListCount).toBe(1);
await expect(bookingListItems.first().locator(`text=${managedEventBooking!.title}`)).toBeVisible();
});
@@ -741,9 +751,12 @@ test.describe("Bookings", () => {
const upcomingBookingsTable = page.locator('[data-testid="upcoming-bookings"]');
const bookingListItems = upcomingBookingsTable.locator('[data-testid="booking-item"]');
- const bookingListCount = await bookingListItems.count();
- expect(bookingListCount).toBe(1);
+ await expect
+ .poll(async () => {
+ return await bookingListItems.count();
+ })
+ .toBe(1);
});
});
});
diff --git a/apps/web/playwright/oauth/oauth-client-admin.e2e.ts b/apps/web/playwright/oauth/oauth-client-admin.e2e.ts
index 043fe3da859..e4058aee3a4 100644
--- a/apps/web/playwright/oauth/oauth-client-admin.e2e.ts
+++ b/apps/web/playwright/oauth/oauth-client-admin.e2e.ts
@@ -133,6 +133,8 @@ test.describe("OAuth clients admin", () => {
await expectClientNotInAdminSection(page, "oauth-client-admin-pending-section", toBeRejected.clientId);
await expectClientInAdminSection(page, "oauth-client-admin-rejected-section", toBeRejected.clientId);
+ await expect(page.getByTestId("toast-success").first()).toBeVisible();
+ await page.reload();
await page
.getByTestId("oauth-client-admin-rejected-section")
diff --git a/apps/web/playwright/oauth/oauth-client-owner-crud.e2e.ts b/apps/web/playwright/oauth/oauth-client-owner-crud.e2e.ts
index 3675ef06e7f..2c95a12c678 100644
--- a/apps/web/playwright/oauth/oauth-client-owner-crud.e2e.ts
+++ b/apps/web/playwright/oauth/oauth-client-owner-crud.e2e.ts
@@ -469,6 +469,8 @@ test.describe("OAuth client creation", () => {
await closeOAuthClientDetails(page);
+ await page.reload();
+
const detailsAfterUpdate = await openOAuthClientDetails(page, clientId);
await expectOAuthClientDetails(detailsAfterUpdate, {
clientId,
diff --git a/apps/web/playwright/profile.e2e.ts b/apps/web/playwright/profile.e2e.ts
index 815f9967507..b7389274732 100644
--- a/apps/web/playwright/profile.e2e.ts
+++ b/apps/web/playwright/profile.e2e.ts
@@ -59,12 +59,12 @@ test.describe("Update Profile", () => {
await emailInput.fill(email);
- await page.getByTestId("profile-submit-button").click();
+ await page.getByTestId("profile-submit-button").first().click();
- await page.getByTestId("password").fill(user?.username ?? "Nameless User");
+ await page.getByTestId("password").first().fill(user?.username ?? "Nameless User");
await submitAndWaitForResponse(page, "/api/trpc/me/updateProfile?batch=1", {
- action: () => page.getByTestId("profile-update-email-submit-button").click(),
+ action: () => page.getByTestId("profile-update-email-submit-button").first().click(),
});
// Instead of dealing with emails in e2e lets just get the token and navigate to it