From f545f879b1ed34bea6edcc8bb3af026a2b0da852 Mon Sep 17 00:00:00 2001 From: gitstart-calcom Date: Mon, 30 Oct 2023 19:54:53 +0000 Subject: [PATCH] FIx failing tests --- .../playwright/booking/checkBoxQuestion.e2e.ts | 2 +- apps/web/playwright/fixtures/regularBookings.ts | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/apps/web/playwright/booking/checkBoxQuestion.e2e.ts b/apps/web/playwright/booking/checkBoxQuestion.e2e.ts index 3cc3c7d0f3..1205cf8ae7 100644 --- a/apps/web/playwright/booking/checkBoxQuestion.e2e.ts +++ b/apps/web/playwright/booking/checkBoxQuestion.e2e.ts @@ -94,7 +94,7 @@ test.describe("Booking With Checkbox Question and Each Other Question", () => { }); }); - test.describe("Booking With checkbox Question and checkbox Question", () => { + test.describe("Booking With checkbox Question and Phone Question", () => { test("Checkbox required and checkbox required", async ({ bookingPage }) => { await bookingPage.addQuestion("boolean", "boolean-test", "boolean test", true); await bookingPage.addQuestion("phone", "phone-test", "phone test", true, "phone test"); diff --git a/apps/web/playwright/fixtures/regularBookings.ts b/apps/web/playwright/fixtures/regularBookings.ts index 5bd9d80c3a..c65568723f 100644 --- a/apps/web/playwright/fixtures/regularBookings.ts +++ b/apps/web/playwright/fixtures/regularBookings.ts @@ -194,6 +194,14 @@ export function createBookingPageFixture(page: Page) { await eventTypePage.getByPlaceholder(reschedulePlaceholderText).click(); await eventTypePage.getByPlaceholder(reschedulePlaceholderText).fill("Test reschedule"); await eventTypePage.getByTestId("confirm-reschedule-button").click(); + await eventTypePage.waitForTimeout(200); + if ( + await eventTypePage.getByRole("heading", { name: "Could not reschedule the meeting." }).isVisible() + ) { + await eventTypePage.getByTestId("back").click(); + await eventTypePage.getByTestId("time").last().click(); + await eventTypePage.getByTestId("confirm-reschedule-button").click(); + } }, assertBookingRescheduled: async (page: Page) => { @@ -248,6 +256,14 @@ export function createBookingPageFixture(page: Page) { options.isRequired && (await fillQuestion(eventTypePage, secondQuestion, customLocators)); await eventTypePage.getByTestId(confirmButton).click(); + await eventTypePage.waitForTimeout(200); + if (await eventTypePage.getByRole("heading", { name: "Could not book the meeting." }).isVisible()) { + await eventTypePage.getByTestId("back").click(); + await eventTypePage.getByTestId("time").last().click(); + await fillQuestion(eventTypePage, question, customLocators); + options.isRequired && (await fillQuestion(eventTypePage, secondQuestion, customLocators)); + await eventTypePage.getByTestId(confirmButton).click(); + } const scheduleSuccessfullyPage = eventTypePage.getByText(scheduleSuccessfullyText); await scheduleSuccessfullyPage.waitFor({ state: "visible" }); await expect(scheduleSuccessfullyPage).toBeVisible();