Scheduling infrastructure for absolutely everyone.
fix: all the e2e flakes visible (#26161)
Anik Dhabal Babub62493235c03
diff --git a/apps/web/playwright/booking-phone-autofill.e2e.ts b/apps/web/playwright/booking-phone-autofill.e2e.tsindex 7b7c37020c9..36cc4129018 100644--- a/apps/web/playwright/booking-phone-autofill.e2e.ts+++ b/apps/web/playwright/booking-phone-autofill.e2e.ts@@ -38,7 +38,10 @@ test.describe("Phone Location Auto-fill Feature", () => {// Skip booking confirmation to keep this test fast and focused on autofill behavior});- test("should NOT sync changes from custom phone fields back to location or other fields", async ({ page, users }) => {+ test("should NOT sync changes from custom phone fields back to location or other fields", async ({+ page,+ users,+ }) => {await createUserWithPhoneFields({ users, page });await gotoBookingPage(page);@@ -168,13 +171,17 @@ async function fillPhoneLocationInput(page: Page, phoneNumber: string) {// Ensure the field is empty firstawait locationInput.clear();- // Wait for mask/prefix to settle (empty string or just country prefix)- await expect.poll(async () => locationInput.inputValue()).toMatch(/^(?:|\+\d{1,3})$/);+ // Wait for mask/prefix to settle (empty string, just "+", or country prefix)+ await expect.poll(async () => locationInput.inputValue()).toMatch(/^(?:|\+|\+\d{1,3})$/);- // If the mask auto-inserts a country prefix, avoid duplicating it+ // If the mask auto-inserts a country prefix (or just "+"), avoid duplicating itconst prefill = await locationInput.inputValue();let toType = phoneNumber;- if (/^\+\d{1,3}$/.test(prefill) && phoneNumber.startsWith(prefill)) {+ if (prefill === "+" && phoneNumber.startsWith("+")) {+ // If field has just "+", type the rest without the "+"+ toType = phoneNumber.slice(1);+ } else if (/^\+\d{1,3}$/.test(prefill) && phoneNumber.startsWith(prefill)) {+ // If field has a country prefix like "+1", type the resttoType = phoneNumber.slice(prefill.length);}diff --git a/apps/web/playwright/lib/testUtils.ts b/apps/web/playwright/lib/testUtils.tsindex 238f568d1e8..98f0a61d73a 100644--- a/apps/web/playwright/lib/testUtils.ts+++ b/apps/web/playwright/lib/testUtils.ts@@ -480,6 +480,9 @@ export async function gotoBookingPage(page: Page) {const previewLink = await page.locator("[data-testid=preview-button]").getAttribute("href");await page.goto(previewLink ?? "");+ await page.waitForURL((url) => {+ return url.searchParams.get("overlayCalendar") === "true";+ });}export async function saveEventType(page: Page) {diff --git a/apps/web/playwright/manage-booking-questions.e2e.ts b/apps/web/playwright/manage-booking-questions.e2e.tsindex 044b5ff1c1d..ad157a0974b 100644--- a/apps/web/playwright/manage-booking-questions.e2e.ts+++ b/apps/web/playwright/manage-booking-questions.e2e.ts@@ -672,6 +672,9 @@ async function openBookingFormInPreviewTab(context: PlaywrightTestArgs["context"await page.locator('[data-testid="preview-button"]').click();const previewTabPage = await previewTabPromise;await previewTabPage.waitForLoadState();+ await previewTabPage.waitForURL((url) => {+ return url.searchParams.get("overlayCalendar") === "true";+ });await selectFirstAvailableTimeSlotNextMonth(previewTabPage);return previewTabPage;}diff --git a/playwright.config.ts b/playwright.config.tsindex 86ba209daf7..95029ccee5c 100644--- a/playwright.config.ts+++ b/playwright.config.ts@@ -28,7 +28,7 @@ const IS_EMBED_REACT_TEST = process.argv.some((a) => a.startsWith("--project=@caconst webServer: PlaywrightTestConfig["webServer"] = [{command:- "NEXT_PUBLIC_IS_E2E=1 NODE_OPTIONS='--dns-result-order=ipv4first' yarn workspace @calcom/web start -p 3000",+ "yarn workspace @calcom/web copy-app-store-static && NEXT_PUBLIC_IS_E2E=1 NODE_OPTIONS='--dns-result-order=ipv4first' yarn workspace @calcom/web start -p 3000",port: 3000,timeout: 60_000,reuseExistingServer: !process.env.CI,