Requested changes

teste2e-multiSelectQuestion
gitstart-calcom 2023-10-24 15:00:56 +00:00
parent 6be86b2f6c
commit f78fe1f55c
1 changed files with 469 additions and 412 deletions

View File

@ -12,7 +12,7 @@ test.describe("Booking With Multi Select Question and Each Other Question", () =
}); });
test.describe("Booking With Multi Select Question and Address Question", () => { test.describe("Booking With Multi Select Question and Address Question", () => {
test("Multi Select and Address required", async ({ bookingPage }) => { test("Multi Select required and Address required", async ({ bookingPage }) => {
await bookingPage.addQuestion( await bookingPage.addQuestion(
"multiselect", "multiselect",
"multiselect-test", "multiselect-test",
@ -32,7 +32,10 @@ test.describe("Booking With Multi Select Question and Each Other Question", () =
secondQuestion: "address", secondQuestion: "address",
options: bookingOptions, options: bookingOptions,
}); });
await bookingPage.cancelAndRescheduleBooking(eventTypePage); await bookingPage.rescheduleBooking(eventTypePage);
await bookingPage.assertBookingRescheduled(eventTypePage);
await bookingPage.cancelBooking(eventTypePage);
await bookingPage.assertBookingCanceled(eventTypePage);
}); });
test("Multi Select and Address not required", async ({ bookingPage }) => { test("Multi Select and Address not required", async ({ bookingPage }) => {
@ -55,453 +58,507 @@ test.describe("Booking With Multi Select Question and Each Other Question", () =
secondQuestion: "address", secondQuestion: "address",
options: { ...bookingOptions, isRequired: false }, options: { ...bookingOptions, isRequired: false },
}); });
await bookingPage.cancelAndRescheduleBooking(eventTypePage); await bookingPage.rescheduleBooking(eventTypePage);
await bookingPage.assertBookingRescheduled(eventTypePage);
await bookingPage.cancelBooking(eventTypePage);
await bookingPage.assertBookingCanceled(eventTypePage);
});
});
test.describe("Booking With Multi Select Question and checkbox group Question", () => {
test("Multi Select required and checkbox group required", async ({ bookingPage }) => {
await bookingPage.addQuestion(
"multiselect",
"multiselect-test",
"multiselect test",
true,
"multiselect test"
);
await bookingPage.addQuestion("checkbox", "checkbox-test", "checkbox test", true);
await bookingPage.updateEventType();
const eventTypePage = await bookingPage.previewEventType();
await bookingPage.selectTimeSlot(eventTypePage);
await bookingPage.fillAndConfirmBooking({
eventTypePage,
placeholderText: "Please share anything that will help prepare for our meeting.",
question: "multiselect",
fillText: "Test Multi Select question and checkbox group question (both required)",
secondQuestion: "checkbox",
options: bookingOptions,
});
await bookingPage.rescheduleBooking(eventTypePage);
await bookingPage.assertBookingRescheduled(eventTypePage);
await bookingPage.cancelBooking(eventTypePage);
await bookingPage.assertBookingCanceled(eventTypePage);
}); });
test.describe("Booking With Multi Select Question and checkbox group Question", () => { test("Multi Select and checkbox group not required", async ({ bookingPage }) => {
const bookingOptions = { hasPlaceholder: false, isRequired: true }; await bookingPage.addQuestion(
test("Multi Select and checkbox group required", async ({ bookingPage }) => { "multiselect",
await bookingPage.addQuestion( "multiselect-test",
"multiselect", "multiselect test",
"multiselect-test", true,
"multiselect test", "multiselect test"
true, );
"multiselect test" await bookingPage.addQuestion("checkbox", "checkbox-test", "checkbox test", false);
); await bookingPage.updateEventType();
await bookingPage.addQuestion("checkbox", "checkbox-test", "checkbox test", true); const eventTypePage = await bookingPage.previewEventType();
await bookingPage.updateEventType(); await bookingPage.selectTimeSlot(eventTypePage);
const eventTypePage = await bookingPage.previewEventType(); await bookingPage.fillAndConfirmBooking({
await bookingPage.selectTimeSlot(eventTypePage); eventTypePage,
await bookingPage.fillAndConfirmBooking({ placeholderText: "Please share anything that will help prepare for our meeting.",
eventTypePage, question: "multiselect",
placeholderText: "Please share anything that will help prepare for our meeting.", fillText: "Test Multi Select question and checkbox group question (only multiselect required)",
question: "multiselect", secondQuestion: "checkbox",
fillText: "Test Multi Select question and checkbox group question (both required)", options: { ...bookingOptions, isRequired: false },
secondQuestion: "checkbox",
options: bookingOptions,
});
await bookingPage.cancelAndRescheduleBooking(eventTypePage);
}); });
await bookingPage.rescheduleBooking(eventTypePage);
await bookingPage.assertBookingRescheduled(eventTypePage);
await bookingPage.cancelBooking(eventTypePage);
await bookingPage.assertBookingCanceled(eventTypePage);
});
});
test("Multi Select and checkbox group not required", async ({ bookingPage }) => { test.describe("Booking With Multi Select Question and checkbox Question", () => {
await bookingPage.addQuestion( test("Multi Select required and checkbox required", async ({ bookingPage }) => {
"multiselect", await bookingPage.addQuestion(
"multiselect-test", "multiselect",
"multiselect test", "multiselect-test",
true, "multiselect test",
"multiselect test" true,
); "multiselect test"
await bookingPage.addQuestion("checkbox", "checkbox-test", "checkbox test", false); );
await bookingPage.updateEventType(); await bookingPage.addQuestion("boolean", "boolean-test", "boolean test", true);
const eventTypePage = await bookingPage.previewEventType(); await bookingPage.updateEventType();
await bookingPage.selectTimeSlot(eventTypePage); const eventTypePage = await bookingPage.previewEventType();
await bookingPage.fillAndConfirmBooking({ await bookingPage.selectTimeSlot(eventTypePage);
eventTypePage, await bookingPage.fillAndConfirmBooking({
placeholderText: "Please share anything that will help prepare for our meeting.", eventTypePage,
question: "multiselect", placeholderText: "Please share anything that will help prepare for our meeting.",
fillText: "Test Multi Select question and checkbox group question (only multiselect required)", question: "multiselect",
secondQuestion: "checkbox", fillText: "Test Multi Select question and checkbox question (both required)",
options: { ...bookingOptions, isRequired: false }, secondQuestion: "boolean",
}); options: bookingOptions,
await bookingPage.cancelAndRescheduleBooking(eventTypePage);
}); });
await bookingPage.rescheduleBooking(eventTypePage);
await bookingPage.assertBookingRescheduled(eventTypePage);
await bookingPage.cancelBooking(eventTypePage);
await bookingPage.assertBookingCanceled(eventTypePage);
});
test("Multi Select and checkbox not required", async ({ bookingPage }) => {
await bookingPage.addQuestion(
"multiselect",
"multiselect-test",
"multiselect test",
true,
"multiselect test"
);
await bookingPage.addQuestion("boolean", "boolean-test", "boolean test", false);
await bookingPage.updateEventType();
const eventTypePage = await bookingPage.previewEventType();
await bookingPage.selectTimeSlot(eventTypePage);
await bookingPage.fillAndConfirmBooking({
eventTypePage,
placeholderText: "Please share anything that will help prepare for our meeting.",
question: "multiselect",
fillText: "Test Multi Select question and checkbox (only multiselect required)",
secondQuestion: "boolean",
options: { ...bookingOptions, isRequired: false },
});
await bookingPage.rescheduleBooking(eventTypePage);
await bookingPage.assertBookingRescheduled(eventTypePage);
await bookingPage.cancelBooking(eventTypePage);
await bookingPage.assertBookingCanceled(eventTypePage);
});
});
test.describe("Booking With Multi Select Question and Long text Question", () => {
test("Multi Select required and Long text required", async ({ bookingPage }) => {
await bookingPage.addQuestion(
"multiselect",
"multiselect-test",
"multiselect test",
true,
"multiselect test"
);
await bookingPage.addQuestion("textarea", "textarea-test", "textarea test", true, "textarea test");
await bookingPage.updateEventType();
const eventTypePage = await bookingPage.previewEventType();
await bookingPage.selectTimeSlot(eventTypePage);
await bookingPage.fillAndConfirmBooking({
eventTypePage,
placeholderText: "Please share anything that will help prepare for our meeting.",
question: "multiselect",
fillText: "Test Multi Select question and Long Text question (both required)",
secondQuestion: "textarea",
options: bookingOptions,
});
await bookingPage.rescheduleBooking(eventTypePage);
await bookingPage.assertBookingRescheduled(eventTypePage);
await bookingPage.cancelBooking(eventTypePage);
await bookingPage.assertBookingCanceled(eventTypePage);
}); });
test.describe("Booking With Multi Select Question and checkbox Question", () => { test("Multi Select and Long text not required", async ({ bookingPage }) => {
test("Multi Select and checkbox required", async ({ bookingPage }) => { await bookingPage.addQuestion(
await bookingPage.addQuestion( "multiselect",
"multiselect", "multiselect-test",
"multiselect-test", "multiselect test",
"multiselect test", true,
true, "multiselect test"
"multiselect test" );
); await bookingPage.addQuestion("textarea", "textarea-test", "textarea test", false, "textarea test");
await bookingPage.addQuestion("boolean", "boolean-test", "boolean test", true); await bookingPage.updateEventType();
await bookingPage.updateEventType(); const eventTypePage = await bookingPage.previewEventType();
const eventTypePage = await bookingPage.previewEventType(); await bookingPage.selectTimeSlot(eventTypePage);
await bookingPage.selectTimeSlot(eventTypePage); await bookingPage.fillAndConfirmBooking({
await bookingPage.fillAndConfirmBooking({ eventTypePage,
eventTypePage, placeholderText: "Please share anything that will help prepare for our meeting.",
placeholderText: "Please share anything that will help prepare for our meeting.", question: "multiselect",
question: "multiselect", fillText: "Test Multi Select question and Long Text question (only multiselect required)",
fillText: "Test Multi Select question and checkbox question (both required)", secondQuestion: "textarea",
secondQuestion: "boolean", options: { ...bookingOptions, isRequired: false },
options: bookingOptions,
});
await bookingPage.cancelAndRescheduleBooking(eventTypePage);
}); });
test("Multi Select and checkbox not required", async ({ bookingPage }) => { await bookingPage.rescheduleBooking(eventTypePage);
await bookingPage.addQuestion( await bookingPage.assertBookingRescheduled(eventTypePage);
"multiselect", await bookingPage.cancelBooking(eventTypePage);
"multiselect-test", await bookingPage.assertBookingCanceled(eventTypePage);
"multiselect test", });
true, });
"multiselect test"
); test.describe("Booking With Multi Select Question and Multi email Question", () => {
await bookingPage.addQuestion("boolean", "boolean-test", "boolean test", false); test("Multi Select required and Multi email required", async ({ bookingPage }) => {
await bookingPage.updateEventType(); await bookingPage.addQuestion(
const eventTypePage = await bookingPage.previewEventType(); "multiselect",
await bookingPage.selectTimeSlot(eventTypePage); "multiselect-test",
await bookingPage.fillAndConfirmBooking({ "multiselect test",
eventTypePage, true,
placeholderText: "Please share anything that will help prepare for our meeting.", "multiselect test"
question: "multiselect", );
fillText: "Test Multi Select question and checkbox (only multiselect required)", await bookingPage.addQuestion(
secondQuestion: "boolean", "multiemail",
options: { ...bookingOptions, isRequired: false }, "multiemail-test",
}); "multiemail test",
await bookingPage.cancelAndRescheduleBooking(eventTypePage); true,
"multiemail test"
);
await bookingPage.updateEventType();
const eventTypePage = await bookingPage.previewEventType();
await bookingPage.selectTimeSlot(eventTypePage);
await bookingPage.fillAndConfirmBooking({
eventTypePage,
placeholderText: "Please share anything that will help prepare for our meeting.",
question: "multiselect",
fillText: "Test Multi Select question and Multi Email question (both required)",
secondQuestion: "multiemail",
options: bookingOptions,
}); });
await bookingPage.rescheduleBooking(eventTypePage);
await bookingPage.assertBookingRescheduled(eventTypePage);
await bookingPage.cancelBooking(eventTypePage);
await bookingPage.assertBookingCanceled(eventTypePage);
}); });
test.describe("Booking With Multi Select Question and Long text Question", () => { test("Multi Select and Multi email not required", async ({ bookingPage }) => {
test("Multi Select and Long text required", async ({ bookingPage }) => { await bookingPage.addQuestion(
await bookingPage.addQuestion( "multiselect",
"multiselect", "multiselect-test",
"multiselect-test", "multiselect test",
"multiselect test", true,
true, "multiselect test"
"multiselect test" );
); await bookingPage.addQuestion(
await bookingPage.addQuestion("textarea", "textarea-test", "textarea test", true, "textarea test"); "multiemail",
await bookingPage.updateEventType(); "multiemail-test",
const eventTypePage = await bookingPage.previewEventType(); "multiemail test",
await bookingPage.selectTimeSlot(eventTypePage); false,
await bookingPage.fillAndConfirmBooking({ "multiemail test"
eventTypePage, );
placeholderText: "Please share anything that will help prepare for our meeting.", await bookingPage.updateEventType();
question: "multiselect", const eventTypePage = await bookingPage.previewEventType();
fillText: "Test Multi Select question and Long Text question (both required)", await bookingPage.selectTimeSlot(eventTypePage);
secondQuestion: "textarea", await bookingPage.fillAndConfirmBooking({
options: bookingOptions, eventTypePage,
}); placeholderText: "Please share anything that will help prepare for our meeting.",
await bookingPage.cancelAndRescheduleBooking(eventTypePage); question: "multiselect",
fillText: "Test Multi Select question and Multi Email question (only multiselect required)",
secondQuestion: "multiemail",
options: { ...bookingOptions, isRequired: false },
}); });
await bookingPage.rescheduleBooking(eventTypePage);
await bookingPage.assertBookingRescheduled(eventTypePage);
await bookingPage.cancelBooking(eventTypePage);
await bookingPage.assertBookingCanceled(eventTypePage);
});
});
test("Multi Select and Long text not required", async ({ bookingPage }) => { test.describe("Booking With Multi Select Question and Phone Question", () => {
await bookingPage.addQuestion( test("Multi Select required and multiselect text required", async ({ bookingPage }) => {
"multiselect", await bookingPage.addQuestion(
"multiselect-test", "multiselect",
"multiselect test", "multiselect-test",
true, "multiselect test",
"multiselect test" true,
); "multiselect test"
await bookingPage.addQuestion("textarea", "textarea-test", "textarea test", false, "textarea test"); );
await bookingPage.updateEventType(); await bookingPage.addQuestion("phone", "phone-test", "phone test", true, "phone test");
const eventTypePage = await bookingPage.previewEventType(); await bookingPage.updateEventType();
await bookingPage.selectTimeSlot(eventTypePage); const eventTypePage = await bookingPage.previewEventType();
await bookingPage.fillAndConfirmBooking({ await bookingPage.selectTimeSlot(eventTypePage);
eventTypePage, await bookingPage.fillAndConfirmBooking({
placeholderText: "Please share anything that will help prepare for our meeting.", eventTypePage,
question: "multiselect", placeholderText: "Please share anything that will help prepare for our meeting.",
fillText: "Test Multi Select question and Long Text question (only multiselect required)", question: "multiselect",
secondQuestion: "textarea", fillText: "Test Multi Select question and Phone question (both required)",
options: { ...bookingOptions, isRequired: false }, secondQuestion: "phone",
}); options: bookingOptions,
await bookingPage.cancelAndRescheduleBooking(eventTypePage);
}); });
await bookingPage.rescheduleBooking(eventTypePage);
await bookingPage.assertBookingRescheduled(eventTypePage);
await bookingPage.cancelBooking(eventTypePage);
await bookingPage.assertBookingCanceled(eventTypePage);
}); });
test.describe("Booking With Multi Select Question and Multi email Question", () => { test("Multi Select and multiselect text not required", async ({ bookingPage }) => {
const bookingOptions = { hasPlaceholder: true, isRequired: true }; await bookingPage.addQuestion(
test("Multi Select and Multi email required", async ({ bookingPage }) => { "multiselect",
await bookingPage.addQuestion( "multiselect-test",
"multiselect", "multiselect test",
"multiselect-test", true,
"multiselect test", "multiselect test"
true, );
"multiselect test" await bookingPage.addQuestion("multiselect", "multiselect-test", "multiselect test", false);
); await bookingPage.updateEventType();
await bookingPage.addQuestion( const eventTypePage = await bookingPage.previewEventType();
"multiemail", await bookingPage.selectTimeSlot(eventTypePage);
"multiemail-test", await bookingPage.fillAndConfirmBooking({
"multiemail test", eventTypePage,
true, placeholderText: "Please share anything that will help prepare for our meeting.",
"multiemail test" question: "multiselect",
); fillText: "Test Multi Select question and Multi Select question (only multiselect required)",
await bookingPage.updateEventType(); secondQuestion: "multiselect",
const eventTypePage = await bookingPage.previewEventType(); options: { ...bookingOptions, isRequired: false },
await bookingPage.selectTimeSlot(eventTypePage);
await bookingPage.fillAndConfirmBooking({
eventTypePage,
placeholderText: "Please share anything that will help prepare for our meeting.",
question: "multiselect",
fillText: "Test Multi Select question and Multi Email question (both required)",
secondQuestion: "multiemail",
options: bookingOptions,
});
await bookingPage.cancelAndRescheduleBooking(eventTypePage);
}); });
await bookingPage.rescheduleBooking(eventTypePage);
await bookingPage.assertBookingRescheduled(eventTypePage);
await bookingPage.cancelBooking(eventTypePage);
await bookingPage.assertBookingCanceled(eventTypePage);
});
});
test("Multi Select and Multi email not required", async ({ bookingPage }) => { test.describe("Booking With Multi Select Question and Number Question", () => {
await bookingPage.addQuestion( test("Multi Select required and Number required", async ({ bookingPage }) => {
"multiselect", await bookingPage.addQuestion(
"multiselect-test", "multiselect",
"multiselect test", "multiselect-test",
true, "multiselect test",
"multiselect test" true,
); "multiselect test"
await bookingPage.addQuestion( );
"multiemail", await bookingPage.addQuestion("number", "number-test", "number test", true, "number test");
"multiemail-test", await bookingPage.updateEventType();
"multiemail test", const eventTypePage = await bookingPage.previewEventType();
false, await bookingPage.selectTimeSlot(eventTypePage);
"multiemail test" await bookingPage.fillAndConfirmBooking({
); eventTypePage,
await bookingPage.updateEventType(); placeholderText: "Please share anything that will help prepare for our meeting.",
const eventTypePage = await bookingPage.previewEventType(); question: "multiselect",
await bookingPage.selectTimeSlot(eventTypePage); fillText: "Test Multi Select question and Number question (both required)",
await bookingPage.fillAndConfirmBooking({ secondQuestion: "number",
eventTypePage, options: bookingOptions,
placeholderText: "Please share anything that will help prepare for our meeting.",
question: "multiselect",
fillText: "Test Multi Select question and Multi Email question (only multiselect required)",
secondQuestion: "multiemail",
options: { ...bookingOptions, isRequired: false },
});
await bookingPage.cancelAndRescheduleBooking(eventTypePage);
}); });
await bookingPage.rescheduleBooking(eventTypePage);
await bookingPage.assertBookingRescheduled(eventTypePage);
await bookingPage.cancelBooking(eventTypePage);
await bookingPage.assertBookingCanceled(eventTypePage);
}); });
test.describe("Booking With Multi Select Question and Phone Question", () => { test("Multi Select and Number not required", async ({ bookingPage }) => {
test("Multi Select and multiselect text required", async ({ bookingPage }) => { await bookingPage.addQuestion(
await bookingPage.addQuestion( "multiselect",
"multiselect", "multiselect-test",
"multiselect-test", "multiselect test",
"multiselect test", true,
true, "multiselect test"
"multiselect test" );
); await bookingPage.addQuestion("number", "number-test", "number test", false, "number test");
await bookingPage.addQuestion("phone", "phone-test", "phone test", true, "phone test"); await bookingPage.updateEventType();
await bookingPage.updateEventType(); const eventTypePage = await bookingPage.previewEventType();
const eventTypePage = await bookingPage.previewEventType(); await bookingPage.selectTimeSlot(eventTypePage);
await bookingPage.selectTimeSlot(eventTypePage); await bookingPage.fillAndConfirmBooking({
await bookingPage.fillAndConfirmBooking({ eventTypePage,
eventTypePage, placeholderText: "Please share anything that will help prepare for our meeting.",
placeholderText: "Please share anything that will help prepare for our meeting.", question: "multiselect",
question: "multiselect", fillText: "Test Multi Select question and Number question (only multiselect required)",
fillText: "Test Multi Select question and Phone question (both required)", secondQuestion: "number",
secondQuestion: "phone", options: { ...bookingOptions, isRequired: false },
options: bookingOptions,
});
await bookingPage.cancelAndRescheduleBooking(eventTypePage);
}); });
await bookingPage.rescheduleBooking(eventTypePage);
await bookingPage.assertBookingRescheduled(eventTypePage);
await bookingPage.cancelBooking(eventTypePage);
await bookingPage.assertBookingCanceled(eventTypePage);
});
});
test("Multi Select and multiselect text not required", async ({ bookingPage }) => { test.describe("Booking With Multi Select Question and Radio group Question", () => {
await bookingPage.addQuestion( test("Multi Select required and Radio group required", async ({ bookingPage }) => {
"multiselect", await bookingPage.addQuestion(
"multiselect-test", "multiselect",
"multiselect test", "multiselect-test",
true, "multiselect test",
"multiselect test" true,
); "multiselect test"
await bookingPage.addQuestion("multiselect", "multiselect-test", "multiselect test", false); );
await bookingPage.updateEventType(); await bookingPage.addQuestion("radio", "radio-test", "radio test", true);
const eventTypePage = await bookingPage.previewEventType(); await bookingPage.updateEventType();
await bookingPage.selectTimeSlot(eventTypePage); const eventTypePage = await bookingPage.previewEventType();
await bookingPage.fillAndConfirmBooking({ await bookingPage.selectTimeSlot(eventTypePage);
eventTypePage, await bookingPage.fillAndConfirmBooking({
placeholderText: "Please share anything that will help prepare for our meeting.", eventTypePage,
question: "multiselect", placeholderText: "Please share anything that will help prepare for our meeting.",
fillText: "Test Multi Select question and Multi Select question (only multiselect required)", question: "multiselect",
secondQuestion: "multiselect", fillText: "Test Multi Select question and Radio question (both required)",
options: { ...bookingOptions, isRequired: false }, secondQuestion: "radio",
}); options: bookingOptions,
await bookingPage.cancelAndRescheduleBooking(eventTypePage);
}); });
await bookingPage.rescheduleBooking(eventTypePage);
await bookingPage.assertBookingRescheduled(eventTypePage);
await bookingPage.cancelBooking(eventTypePage);
await bookingPage.assertBookingCanceled(eventTypePage);
}); });
test.describe("Booking With Multi Select Question and Number Question", () => { test("Multi Select and Radio group not required", async ({ bookingPage }) => {
test("Multi Select and Number required", async ({ bookingPage }) => { await bookingPage.addQuestion(
await bookingPage.addQuestion( "multiselect",
"multiselect", "multiselect-test",
"multiselect-test", "multiselect test",
"multiselect test", true,
true, "multiselect test"
"multiselect test" );
); await bookingPage.addQuestion("radio", "radio-test", "radio test", false);
await bookingPage.addQuestion("number", "number-test", "number test", true, "number test"); await bookingPage.updateEventType();
await bookingPage.updateEventType(); const eventTypePage = await bookingPage.previewEventType();
const eventTypePage = await bookingPage.previewEventType(); await bookingPage.selectTimeSlot(eventTypePage);
await bookingPage.selectTimeSlot(eventTypePage); await bookingPage.fillAndConfirmBooking({
await bookingPage.fillAndConfirmBooking({ eventTypePage,
eventTypePage, placeholderText: "Please share anything that will help prepare for our meeting.",
placeholderText: "Please share anything that will help prepare for our meeting.", question: "multiselect",
question: "multiselect", fillText: "Test Multi Select question and Radio question (only multiselect required)",
fillText: "Test Multi Select question and Number question (both required)", secondQuestion: "radio",
secondQuestion: "number", options: { ...bookingOptions, isRequired: false },
options: bookingOptions,
});
await bookingPage.cancelAndRescheduleBooking(eventTypePage);
}); });
await bookingPage.rescheduleBooking(eventTypePage);
await bookingPage.assertBookingRescheduled(eventTypePage);
await bookingPage.cancelBooking(eventTypePage);
await bookingPage.assertBookingCanceled(eventTypePage);
});
});
test("Multi Select and Number not required", async ({ bookingPage }) => { test.describe("Booking With Multi Select Question and select Question", () => {
await bookingPage.addQuestion( test("Multi Select required and select required", async ({ bookingPage }) => {
"multiselect", await bookingPage.addQuestion(
"multiselect-test", "multiselect",
"multiselect test", "multiselect-test",
true, "multiselect test",
"multiselect test" true,
); "multiselect test"
await bookingPage.addQuestion("number", "number-test", "number test", false, "number test"); );
await bookingPage.updateEventType(); await bookingPage.addQuestion("select", "select-test", "select test", true, "select test");
const eventTypePage = await bookingPage.previewEventType(); await bookingPage.updateEventType();
await bookingPage.selectTimeSlot(eventTypePage); const eventTypePage = await bookingPage.previewEventType();
await bookingPage.fillAndConfirmBooking({ await bookingPage.selectTimeSlot(eventTypePage);
eventTypePage, await bookingPage.fillAndConfirmBooking({
placeholderText: "Please share anything that will help prepare for our meeting.", eventTypePage,
question: "multiselect", placeholderText: "Please share anything that will help prepare for our meeting.",
fillText: "Test Multi Select question and Number question (only multiselect required)", question: "multiselect",
secondQuestion: "number", fillText: "Test Multi Select question and Select question (both required)",
options: { ...bookingOptions, isRequired: false }, secondQuestion: "select",
}); options: bookingOptions,
await bookingPage.cancelAndRescheduleBooking(eventTypePage);
}); });
await bookingPage.rescheduleBooking(eventTypePage);
await bookingPage.assertBookingRescheduled(eventTypePage);
await bookingPage.cancelBooking(eventTypePage);
await bookingPage.assertBookingCanceled(eventTypePage);
}); });
test.describe("Booking With Multi Select Question and Radio group Question", () => { test("Multi Select and select not required", async ({ bookingPage }) => {
test("Multi Select and Radio group required", async ({ bookingPage }) => { await bookingPage.addQuestion(
await bookingPage.addQuestion( "multiselect",
"multiselect", "multiselect-test",
"multiselect-test", "multiselect test",
"multiselect test", true,
true, "multiselect test"
"multiselect test" );
); await bookingPage.addQuestion("select", "select-test", "select test", false, "select test");
await bookingPage.addQuestion("radio", "radio-test", "radio test", true); await bookingPage.updateEventType();
await bookingPage.updateEventType(); const eventTypePage = await bookingPage.previewEventType();
const eventTypePage = await bookingPage.previewEventType(); await bookingPage.selectTimeSlot(eventTypePage);
await bookingPage.selectTimeSlot(eventTypePage); await bookingPage.fillAndConfirmBooking({
await bookingPage.fillAndConfirmBooking({ eventTypePage,
eventTypePage, placeholderText: "Please share anything that will help prepare for our meeting.",
placeholderText: "Please share anything that will help prepare for our meeting.", question: "multiselect",
question: "multiselect", fillText: "Test Multi Select question and Select question (only multiselect required)",
fillText: "Test Multi Select question and Radio question (both required)", secondQuestion: "select",
secondQuestion: "radio", options: { ...bookingOptions, isRequired: false },
options: bookingOptions,
});
await bookingPage.cancelAndRescheduleBooking(eventTypePage);
}); });
await bookingPage.rescheduleBooking(eventTypePage);
await bookingPage.assertBookingRescheduled(eventTypePage);
await bookingPage.cancelBooking(eventTypePage);
await bookingPage.assertBookingCanceled(eventTypePage);
});
});
test("Multi Select and Radio group not required", async ({ bookingPage }) => { test.describe("Booking With Multi Select Question and Short text question", () => {
await bookingPage.addQuestion( test("Multi Select required and Short text required", async ({ bookingPage }) => {
"multiselect", await bookingPage.addQuestion(
"multiselect-test", "multiselect",
"multiselect test", "multiselect-test",
true, "multiselect test",
"multiselect test" true,
); "multiselect test"
await bookingPage.addQuestion("radio", "radio-test", "radio test", false); );
await bookingPage.updateEventType(); await bookingPage.addQuestion("text", "text-test", "text test", true, "text test");
const eventTypePage = await bookingPage.previewEventType(); await bookingPage.updateEventType();
await bookingPage.selectTimeSlot(eventTypePage); const eventTypePage = await bookingPage.previewEventType();
await bookingPage.fillAndConfirmBooking({ await bookingPage.selectTimeSlot(eventTypePage);
eventTypePage, await bookingPage.fillAndConfirmBooking({
placeholderText: "Please share anything that will help prepare for our meeting.", eventTypePage,
question: "multiselect", placeholderText: "Please share anything that will help prepare for our meeting.",
fillText: "Test Multi Select question and Radio question (only multiselect required)", question: "multiselect",
secondQuestion: "radio", fillText: "Test Multi Select question and Text question (both required)",
options: { ...bookingOptions, isRequired: false }, secondQuestion: "text",
}); options: bookingOptions,
await bookingPage.cancelAndRescheduleBooking(eventTypePage);
}); });
await bookingPage.rescheduleBooking(eventTypePage);
await bookingPage.assertBookingRescheduled(eventTypePage);
await bookingPage.cancelBooking(eventTypePage);
await bookingPage.assertBookingCanceled(eventTypePage);
}); });
test.describe("Booking With Multi Select Question and select Question", () => { test("Multi Select and Short text not required", async ({ bookingPage }) => {
test("Multi Select and select required", async ({ bookingPage }) => { await bookingPage.addQuestion(
await bookingPage.addQuestion( "multiselect",
"multiselect", "multiselect-test",
"multiselect-test", "multiselect test",
"multiselect test", true,
true, "multiselect test"
"multiselect test" );
); await bookingPage.addQuestion("text", "text-test", "text test", false, "text test");
await bookingPage.addQuestion("select", "select-test", "select test", true, "select test"); await bookingPage.updateEventType();
await bookingPage.updateEventType(); const eventTypePage = await bookingPage.previewEventType();
const eventTypePage = await bookingPage.previewEventType(); await bookingPage.selectTimeSlot(eventTypePage);
await bookingPage.selectTimeSlot(eventTypePage); await bookingPage.fillAndConfirmBooking({
await bookingPage.fillAndConfirmBooking({ eventTypePage,
eventTypePage, placeholderText: "Please share anything that will help prepare for our meeting.",
placeholderText: "Please share anything that will help prepare for our meeting.", question: "multiselect",
question: "multiselect", fillText: "Test Multi Select question and Text question (only multiselect required)",
fillText: "Test Multi Select question and Select question (both required)", secondQuestion: "text",
secondQuestion: "select", options: { ...bookingOptions, isRequired: false },
options: bookingOptions,
});
await bookingPage.cancelAndRescheduleBooking(eventTypePage);
});
test("Multi Select and select not required", async ({ bookingPage }) => {
await bookingPage.addQuestion(
"multiselect",
"multiselect-test",
"multiselect test",
true,
"multiselect test"
);
await bookingPage.addQuestion("select", "select-test", "select test", false, "select test");
await bookingPage.updateEventType();
const eventTypePage = await bookingPage.previewEventType();
await bookingPage.selectTimeSlot(eventTypePage);
await bookingPage.fillAndConfirmBooking({
eventTypePage,
placeholderText: "Please share anything that will help prepare for our meeting.",
question: "multiselect",
fillText: "Test Multi Select question and Select question (only multiselect required)",
secondQuestion: "select",
options: { ...bookingOptions, isRequired: false },
});
await bookingPage.cancelAndRescheduleBooking(eventTypePage);
});
});
test.describe("Booking With Multi Select Question and Short text question", () => {
const bookingOptions = { hasPlaceholder: true, isRequired: true };
test("Multi Select and Short text required", async ({ bookingPage }) => {
await bookingPage.addQuestion(
"multiselect",
"multiselect-test",
"multiselect test",
true,
"multiselect test"
);
await bookingPage.addQuestion("text", "text-test", "text test", true, "text test");
await bookingPage.updateEventType();
const eventTypePage = await bookingPage.previewEventType();
await bookingPage.selectTimeSlot(eventTypePage);
await bookingPage.fillAndConfirmBooking({
eventTypePage,
placeholderText: "Please share anything that will help prepare for our meeting.",
question: "multiselect",
fillText: "Test Multi Select question and Text question (both required)",
secondQuestion: "text",
options: bookingOptions,
});
await bookingPage.cancelAndRescheduleBooking(eventTypePage);
});
test("Multi Select and Short text not required", async ({ bookingPage }) => {
await bookingPage.addQuestion(
"multiselect",
"multiselect-test",
"multiselect test",
true,
"multiselect test"
);
await bookingPage.addQuestion("text", "text-test", "text test", false, "text test");
await bookingPage.updateEventType();
const eventTypePage = await bookingPage.previewEventType();
await bookingPage.selectTimeSlot(eventTypePage);
await bookingPage.fillAndConfirmBooking({
eventTypePage,
placeholderText: "Please share anything that will help prepare for our meeting.",
question: "multiselect",
fillText: "Test Multi Select question and Text question (only multiselect required)",
secondQuestion: "text",
options: { ...bookingOptions, isRequired: false },
});
await bookingPage.cancelAndRescheduleBooking(eventTypePage);
}); });
await bookingPage.rescheduleBooking(eventTypePage);
await bookingPage.assertBookingRescheduled(eventTypePage);
await bookingPage.cancelBooking(eventTypePage);
await bookingPage.assertBookingCanceled(eventTypePage);
}); });
}); });
}); });