test: few flaky e2e tests (#27171)

This commit is contained in:
Anik Dhabal Babu
2026-01-23 06:08:34 -03:00
committed by GitHub
parent b6b43c3318
commit 01a8f53ce7
4 changed files with 28 additions and 11 deletions
+21 -8
View File
@@ -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);
});
});
});
@@ -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")
@@ -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,
+3 -3
View File
@@ -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