fix: all the e2e flakes visible (#26161)

* fix: all th e2e flakes

* check

* fix
This commit is contained in:
Anik Dhabal Babu authored and GitHub committed 2025-12-23 18:55:37 +00:00
1 parent f35b36fafa
commit b62493235c
4 files changed
+19 -6

No files matched your search

@@ -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 first
await 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 it
const 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 rest
toType = phoneNumber.slice(prefill.length);
}
+3
View File
@@ -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) {
@@ -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;
}
+1 -1
View File
@@ -28,7 +28,7 @@ const IS_EMBED_REACT_TEST = process.argv.some((a) => a.startsWith("--project=@ca
const 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,