Scheduling infrastructure for absolutely everyone.
fix: e2e tests flakes (#22415)
Anik Dhabal Babu14e14289f08f
diff --git a/apps/web/playwright/app-list-card.e2e.ts b/apps/web/playwright/app-list-card.e2e.tsindex 780bf759af4..802fb9edb43 100644--- a/apps/web/playwright/app-list-card.e2e.ts+++ b/apps/web/playwright/app-list-card.e2e.ts@@ -1,5 +1,9 @@import { test } from "./lib/fixtures";+test.describe.configure({ mode: "parallel" });++test.afterEach(({ users }) => users.deleteAll());+test.describe("AppListCard", async () => {test("should remove the highlight from the URL", async ({ page, users }) => {const user = await users.create({});diff --git a/apps/web/playwright/app-router-not-found.e2e.ts b/apps/web/playwright/app-router-not-found.e2e.tsindex c886b053525..315aae92978 100644--- a/apps/web/playwright/app-router-not-found.e2e.ts+++ b/apps/web/playwright/app-router-not-found.e2e.ts@@ -2,6 +2,10 @@ import { expectPageToBeNotFound } from "playwright/lib/testUtils";import { test } from "./lib/fixtures";+test.describe.configure({ mode: "parallel" });++test.afterEach(({ users }) => users.deleteAll());+test.describe("App Router - error handling", () => {test("404s must render App Router's not-found page regardless of whether pages router or app router is used", async ({page,diff --git a/apps/web/playwright/auth/auth-index.e2e.ts b/apps/web/playwright/auth/auth-index.e2e.tsindex dbb8beec8b1..e9476d33bce 100644--- a/apps/web/playwright/auth/auth-index.e2e.ts+++ b/apps/web/playwright/auth/auth-index.e2e.ts@@ -3,6 +3,8 @@ import { expect } from "@playwright/test";import { test } from "../lib/fixtures";import { submitAndWaitForResponse } from "../lib/testUtils";+test.describe.configure({ mode: "parallel" });+test.describe("Can signup from a team invite", async () => {test.beforeEach(async ({ users }) => {const proUser = await users.create();diff --git a/apps/web/playwright/auth/forgot-password.e2e.ts b/apps/web/playwright/auth/forgot-password.e2e.tsindex 04bc65e0113..33a775ad57f 100644--- a/apps/web/playwright/auth/forgot-password.e2e.ts+++ b/apps/web/playwright/auth/forgot-password.e2e.ts@@ -6,6 +6,8 @@ import prisma from "@calcom/prisma";import { test } from "../lib/fixtures";+test.describe.configure({ mode: "parallel" });+test.afterEach(({ users }) => users.deleteAll());test.describe("Forgot password", async () => {diff --git a/apps/web/playwright/bookings-list.e2e.ts b/apps/web/playwright/bookings-list.e2e.tsindex 5fe00b7b66f..dfad39877d9 100644--- a/apps/web/playwright/bookings-list.e2e.ts+++ b/apps/web/playwright/bookings-list.e2e.ts@@ -461,10 +461,13 @@ test.describe("Bookings", () => {await addFilter(page, "userId");await openFilter(page, "userId");+ const bookingsGetResponse2 = page.waitForResponse((response) =>+ /\/api\/trpc\/bookings\/get.*/.test(response.url())+ );await page.locator(`[data-testid="select-filter-options-userId"] [role="option"]:has-text("${anotherUser}")`).click();- await page.waitForResponse((response) => /\/api\/trpc\/bookings\/get.*/.test(response.url()));+ await bookingsGetResponse2;await expect(page.locator('[data-testid="booking-item"]')).toHaveCount(0);});diff --git a/apps/web/playwright/dynamic-booking-pages.e2e.ts b/apps/web/playwright/dynamic-booking-pages.e2e.tsindex d67df43f6ad..059bdacba13 100644--- a/apps/web/playwright/dynamic-booking-pages.e2e.ts+++ b/apps/web/playwright/dynamic-booking-pages.e2e.ts@@ -19,6 +19,8 @@ test("dynamic booking", async ({ page, users }) => {const free = await users.create({ username: "free.example" });await page.goto(`/${pro.username}+${free.username}`);+ //fix race condition+ await page.locator('[data-testid="day"][data-disabled="false"]').nth(0).waitFor({ state: "visible" });await test.step("book an event first day in next month", async () => {await selectFirstAvailableTimeSlotNextMonth(page);