Scheduling infrastructure for absolutely everyone.
test: few more e2e flakes (#26278)
Anik Dhabal Babuff9d88479ccf
diff --git a/apps/web/playwright/auth/auth-index.e2e.ts b/apps/web/playwright/auth/auth-index.e2e.tsindex e9476d33bce..8665919d814 100644--- a/apps/web/playwright/auth/auth-index.e2e.ts+++ b/apps/web/playwright/auth/auth-index.e2e.ts@@ -24,6 +24,7 @@ test.describe("Can signup from a team invite", async () => {email: `${proUser.username}[email protected]`,};await page.goto("/settings/teams/new");+ await page.waitForLoadState("networkidle");// Create a new teamawait page.locator('input[name="name"]').fill(teamName);diff --git a/apps/web/playwright/availability.e2e.ts b/apps/web/playwright/availability.e2e.tsindex 03fb165f930..cabed0e2785 100644--- a/apps/web/playwright/availability.e2e.ts+++ b/apps/web/playwright/availability.e2e.ts@@ -113,7 +113,7 @@ test.describe("Availability", () => {test("Schedule listing", async ({ page }) => {await test.step("Can add a new schedule", async () => {- await page.getByTestId("new-schedule").click();+ await page.getByTestId("new-schedule").first().click();await page.locator('[id="name"]').fill("More working hours");page.locator('[type="submit"]').click();await expect(page.getByTestId("availablity-title")).toHaveValue("More working hours");@@ -149,7 +149,7 @@ test.describe("Availability", () => {await page.getByTestId("availablity-title").click();// change availability nameawait page.getByTestId("availablity-title").fill("Working Hours test");- await expect(page.getByTestId("subtitle")).toBeVisible();+ await expect(page.getByTestId("subtitle").first()).toBeVisible();await page.getByTestId(sunday).getByRole("switch").click();await page.getByTestId(monday).first().click();await page.getByTestId(wednesday).getByRole("switch").click();diff --git a/apps/web/playwright/booking-pages.e2e.ts b/apps/web/playwright/booking-pages.e2e.tsindex b178329d2c1..c0f598bd847 100644--- a/apps/web/playwright/booking-pages.e2e.ts+++ b/apps/web/playwright/booking-pages.e2e.ts@@ -449,19 +449,27 @@ test.describe("prefill", () => {test.describe("Booking on different layouts", () => {test.beforeEach(async ({ page, users }) => {- const user = await users.create();+ // Create user with specific availability (9 AM - 5 PM UTC, Monday-Friday)+ // This ensures slots are available and reduces race conditions+ const dateRanges: TimeRange = {+ start: new Date(new Date().setUTCHours(9, 0, 0, 0)),+ end: new Date(new Date().setUTCHours(17, 0, 0, 0)),+ };+ const schedule: Schedule = [[], [dateRanges], [dateRanges], [dateRanges], [dateRanges], [dateRanges], []];++ const user = await users.create({ schedule });await page.goto(`/${user.username}`);});test("Book on week layout", async ({ page }) => {// Click first event type- await page.click('[data-testid="event-type-link"]');+ await page.locator('[data-testid="event-type-link"]').first().click();await page.click('[data-testid="toggle-group-item-week_view"]');await page.click('[data-testid="incrementMonth"]');- await page.locator('[data-testid="calendar-empty-cell"]').nth(0).click();+ await page.locator('[data-testid="calendar-empty-cell"]').nth(1).click();// Fill what is this meeting about? name email and notesawait page.locator('[name="name"]').fill("Test name");@@ -476,13 +484,13 @@ test.describe("Booking on different layouts", () => {test("Book on column layout", async ({ page }) => {// Click first event type- await page.click('[data-testid="event-type-link"]');+ await page.locator('[data-testid="event-type-link"]').first().click();await page.click('[data-testid="toggle-group-item-column_view"]');await page.click('[data-testid="incrementMonth"]');- await page.locator('[data-testid="time"]').nth(0).click();+ await page.locator('[data-testid="time"]').nth(1).click();// Fill what is this meeting about? name email and notesawait page.locator('[name="name"]').fill("Test name");diff --git a/apps/web/playwright/i18n-routing.e2e.ts b/apps/web/playwright/i18n-routing.e2e.tsindex eeb287cf238..80065562c91 100644--- a/apps/web/playwright/i18n-routing.e2e.ts+++ b/apps/web/playwright/i18n-routing.e2e.ts@@ -39,9 +39,7 @@ test.describe("Locale-specific pages must not 404", () => {await user.apiLogin();const response = await page.goto(`/${locale}/event-types`);expect(response?.status()).not.toBe(404);- await expect(- page.locator("text=Create events to share for people to book on your calendar.")- ).toBeVisible();+ await expect(page.getByTestId("subtitle").first()).toBeVisible();});test(`/${locale}/availability page shouldn't 404`, async ({ page, users }) => {@@ -49,7 +47,7 @@ test.describe("Locale-specific pages must not 404", () => {await user.apiLogin();const response = await page.goto(`/${locale}/availability`);expect(response?.status()).not.toBe(404);- await expect(page.locator("text=Configure times when you are available for bookings.")).toBeVisible();+ await expect(page.getByTestId("subtitle").first()).toBeVisible();});test(`/${locale}/bookings/upcoming page shouldn't 404`, async ({ page, users }) => {@@ -65,9 +63,7 @@ test.describe("Locale-specific pages must not 404", () => {await user.apiLogin();const response = await page.goto(`/${locale}/teams`);expect(response?.status()).not.toBe(404);- await expect(- page.locator("text=Create and manage teams to use collaborative features.")- ).toBeVisible();+ await expect(page.getByTestId("subtitle").first()).toBeVisible();});test(`/${locale}/routing page shouldn't 404`, async ({ page, users }) => {@@ -75,9 +71,7 @@ test.describe("Locale-specific pages must not 404", () => {await user.apiLogin();const response = await page.goto(`/${locale}/routing`);expect(response?.status()).not.toBe(404);- await expect(- page.locator("text=Create forms to direct attendees to the correct destinations")- ).toBeVisible();+ await expect(page.getByTestId("subtitle").first()).toBeVisible();});test(`/${locale}/insights page shouldn't 404`, async ({ page, users }) => {@@ -85,7 +79,7 @@ test.describe("Locale-specific pages must not 404", () => {await user.apiLogin();const response = await page.goto(`/${locale}/insights`);expect(response?.status()).not.toBe(404);- await expect(page.locator("text=View booking insights across your events")).toBeVisible();+ await expect(page.getByTestId("subtitle").first()).toBeVisible();});});}diff --git a/apps/web/playwright/organization/organization-privacy.e2e.ts b/apps/web/playwright/organization/organization-privacy.e2e.tsindex 55268634609..b5beba9dc24 100644--- a/apps/web/playwright/organization/organization-privacy.e2e.ts+++ b/apps/web/playwright/organization/organization-privacy.e2e.ts@@ -57,7 +57,7 @@ test.describe("Organization - Privacy", () => {await secondPage.goto(`/settings/organizations/${org.slug}/members`);await secondPage.waitForLoadState("domcontentloaded");const userDataTable = secondPage.getByTestId("user-list-data-table").first();- const membersPrivacyWarning = secondPage.getByTestId("members-privacy-warning");+ const membersPrivacyWarning = secondPage.getByTestId("members-privacy-warning").first();await expect(userDataTable).toBeHidden();await expect(membersPrivacyWarning).toBeVisible();await secondContext.close();diff --git a/apps/web/playwright/organization/team-management.e2e.ts b/apps/web/playwright/organization/team-management.e2e.tsindex c6fc65b76f3..9b798912721 100644--- a/apps/web/playwright/organization/team-management.e2e.ts+++ b/apps/web/playwright/organization/team-management.e2e.ts@@ -28,7 +28,7 @@ test.describe("Teams", () => {await test.step("Can create team", async () => {// Click text=Create Teamawait page.locator("text=Create a new Team").click();- await page.waitForURL((url) => url.pathname === "/settings/teams/new");+ await page.waitForLoadState("networkidle");// Fill input[name="name"]await page.locator('input[name="name"]').fill(`${user.username}'s Team`);// Click text=Continuediff --git a/apps/web/playwright/teams.e2e.ts b/apps/web/playwright/teams.e2e.tsindex 4321de66845..6bc77519cd7 100644--- a/apps/web/playwright/teams.e2e.ts+++ b/apps/web/playwright/teams.e2e.ts@@ -141,6 +141,7 @@ test.describe("Teams - NonOrg", () => {// Go directly to the create team pageawait page.goto("/settings/teams/new");+ await page.waitForLoadState("networkidle");// Fill input[name="name"]await page.locator('input[name="name"]').fill(uniqueName);await page.click("[type=submit]");@@ -161,7 +162,7 @@ test.describe("Teams - NonOrg", () => {await test.step("Can create team with same name", async () => {// Click text=Create Teamawait page.locator("text=Create Team").click();- await page.waitForURL("/settings/teams/new");+ await page.waitForLoadState("networkidle");// Fill input[name="name"]await page.locator('input[name="name"]').fill(uniqueName);// Click text=Continue