FIx failing tests

teste2e-checkboxQuestion
gitstart-calcom 2023-10-30 19:54:53 +00:00
parent 83bb01aae8
commit f545f879b1
2 changed files with 17 additions and 1 deletions

View File

@ -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 }) => { test("Checkbox required and checkbox required", async ({ bookingPage }) => {
await bookingPage.addQuestion("boolean", "boolean-test", "boolean test", true); await bookingPage.addQuestion("boolean", "boolean-test", "boolean test", true);
await bookingPage.addQuestion("phone", "phone-test", "phone test", true, "phone test"); await bookingPage.addQuestion("phone", "phone-test", "phone test", true, "phone test");

View File

@ -194,6 +194,14 @@ export function createBookingPageFixture(page: Page) {
await eventTypePage.getByPlaceholder(reschedulePlaceholderText).click(); await eventTypePage.getByPlaceholder(reschedulePlaceholderText).click();
await eventTypePage.getByPlaceholder(reschedulePlaceholderText).fill("Test reschedule"); await eventTypePage.getByPlaceholder(reschedulePlaceholderText).fill("Test reschedule");
await eventTypePage.getByTestId("confirm-reschedule-button").click(); 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) => { assertBookingRescheduled: async (page: Page) => {
@ -248,6 +256,14 @@ export function createBookingPageFixture(page: Page) {
options.isRequired && (await fillQuestion(eventTypePage, secondQuestion, customLocators)); options.isRequired && (await fillQuestion(eventTypePage, secondQuestion, customLocators));
await eventTypePage.getByTestId(confirmButton).click(); 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); const scheduleSuccessfullyPage = eventTypePage.getByText(scheduleSuccessfullyText);
await scheduleSuccessfullyPage.waitFor({ state: "visible" }); await scheduleSuccessfullyPage.waitFor({ state: "visible" });
await expect(scheduleSuccessfullyPage).toBeVisible(); await expect(scheduleSuccessfullyPage).toBeVisible();