Skip to content

Scheduling infrastructure for absolutely everyone.

fix: resolve flaky team-management E2E test (#28575)

Romite073cbd5ea54
diff --git a/apps/web/playwright/organization/team-management.e2e.ts b/apps/web/playwright/organization/team-management.e2e.ts
index c770645ef88..0ebca8d8f5f 100644
--- a/apps/web/playwright/organization/team-management.e2e.ts
+++ b/apps/web/playwright/organization/team-management.e2e.ts
@@ -29,8 +29,7 @@ test.describe("Teams", () => {
await page.goto("/teams");
await test.step("Can create team", async () => {
- // Click the new team button
- await page.locator("[data-testid=new-team-btn]").click();
+ await page.locator("[data-testid=new-team-btn]").first().click();
await page.waitForLoadState("networkidle");
// Fill team name input (new onboarding-v3 style flow)
await page.locator('[data-testid="team-name-input"]').fill(`${user.username}'s Team`);
@@ -63,7 +62,7 @@ test.describe("Teams", () => {
await page.getByTestId("disband-team-button").click();
await page.getByTestId("dialog-confirmation").click();
await page.waitForURL("/teams");
- expect(await page.locator(`text=${user.username}'s Team`).count()).toEqual(0);
+ await expect(page.locator(`text=${user.username}'s Team`)).toBeHidden({ timeout: 10000 });
// Cleanup the invited user since they were created without our fixtures
const invitedUser = await prisma.user.findUnique({ where: { email: inviteeEmail } });