Compare commits

...

11 Commits

Author SHA1 Message Date
GitStart-Cal.com 0f983d06ba
Merge branch 'main' into teste2e-options 2023-11-24 00:35:00 +05:45
gitstart-calcom 00b7acea09 test: check all advanced options in a regular event-type 2023-11-08 18:15:47 +00:00
gitstart-calcom 2dd58e5590 Merge commit '09fc7e1a4c336683d185337895544e914cead60b' into teste2e-options 2023-11-08 18:15:18 +00:00
gitstart-calcom d4d2fdc6ba add changes 2023-11-07 18:45:16 +00:00
gitstart-calcom f51585d264 Merge commit '5c8abbb3e9ae64ecfd1ad7445c8c7155f2c65a96' into teste2e-options 2023-11-07 18:44:47 +00:00
Morgan Vernay 9407a679bb fix: use localize when getting elements by text 2023-11-07 10:31:19 +02:00
Morgan b9c6baa6bb
Merge branch 'main' into teste2e-options 2023-11-07 10:18:40 +02:00
gitstart-calcom 79b222eb3d add changes 2023-11-06 18:52:35 +00:00
gitstart-calcom 8912423094 add changes 2023-11-06 18:45:48 +00:00
gitstart-calcom 13340af54d Merge commit 'e11cb9e3a59136f72e19200eb2502d50146260a6' into teste2e-options 2023-11-06 18:45:03 +00:00
gitstart-calcom a3712e393e Check all advanced options in 2023-11-05 23:35:27 +00:00
2 changed files with 127 additions and 0 deletions

View File

@ -0,0 +1,24 @@
import { loginUser } from "../fixtures/regularBookings";
import { test } from "../lib/fixtures";
test.describe("Check all advanced options in a regular event-type", () => {
test("Check advanced options in a regular event type", async ({ bookingPage, users }) => {
await loginUser(users);
await bookingPage.goToEventTypesPage();
await bookingPage.goToEventType("30 min");
await bookingPage.goToTab("event_advanced_tab_title");
await bookingPage.checkRequiresBookerEmailVerification();
await bookingPage.checkHideNotes();
await bookingPage.checkRedirectOnBooking();
await bookingPage.checkEnablePrivateUrl();
await bookingPage.toggleOfferSeats();
await bookingPage.checkLockTimezone();
await bookingPage.checkRequiresConfirmation();
await bookingPage.updateEventType();
await bookingPage.goToEventTypesPage();
await bookingPage.checkEventType();
});
});

View File

@ -2,6 +2,7 @@ import { expect, type Page } from "@playwright/test";
import dayjs from "@calcom/dayjs";
import { localize } from "../lib/testUtils";
import type { createUsersFixture } from "./users";
const reschedulePlaceholderText = "Let others know why you need to reschedule";
@ -196,6 +197,9 @@ export function createBookingPageFixture(page: Page) {
goToTab: async (tabName: string) => {
await page.getByTestId(`vertical-tab-${tabName}`).click();
},
goToEventTypesPage: async () => {
await page.goto("/event-types");
},
addQuestion: async (
questionType: string,
identifier: string,
@ -221,6 +225,7 @@ export function createBookingPageFixture(page: Page) {
},
updateEventType: async () => {
await page.getByTestId("update-eventtype").click();
await expect(page.getByRole("button", { name: "event type updated successfully" })).toBeVisible();
},
previewEventType: async () => {
const eventtypePromise = page.waitForEvent("popup");
@ -356,5 +361,103 @@ export function createBookingPageFixture(page: Page) {
await scheduleSuccessfullyPage.waitFor({ state: "visible" });
await expect(scheduleSuccessfullyPage).toBeVisible();
},
checkRequiresConfirmation: async () => {
const requiresConfirmationText = (await localize("en"))("requires_confirmation");
const confirmationSwitch = page
.locator("fieldset")
.filter({
hasText: requiresConfirmationText,
})
.getByRole("switch");
await expect(confirmationSwitch).toBeVisible();
await confirmationSwitch.click();
},
checkRequiresBookerEmailVerification: async () => {
const emailSwitchLabel = (await localize("en"))("requires_booker_email_verification");
const emailSwitch = page
.locator("fieldset")
.filter({
hasText: emailSwitchLabel,
})
.getByRole("switch");
await expect(emailSwitch).toBeVisible();
await emailSwitch.click();
},
checkHideNotes: async () => {
const hideNotesText = (await localize("en"))("disable_notes");
const hideNotesSwitch = page
.locator("fieldset")
.filter({
hasText: hideNotesText,
})
.getByRole("switch");
await expect(hideNotesSwitch).toBeVisible();
await hideNotesSwitch.click();
},
checkRedirectOnBooking: async () => {
const redirectSwitchText = (await localize("en"))("redirect_url_description");
const placeholder = (await localize("en"))("external_redirect_url");
const redirectSwitch = page
.locator("fieldset")
.filter({
hasText: redirectSwitchText,
})
.getByRole("switch");
await expect(redirectSwitch).toBeVisible();
await redirectSwitch.click();
await expect(page.getByPlaceholder(placeholder)).toBeVisible();
await redirectSwitch.click();
},
checkEnablePrivateUrl: async () => {
const urlSwitch = page.getByTestId("hashedLinkCheck");
const privateLinkText = (await localize("en"))("private_link_hint");
await expect(urlSwitch).toBeVisible();
await urlSwitch.click();
await expect(page.locator(`text=${privateLinkText}`)).toBeVisible();
},
toggleOfferSeats: async () => {
const seatSwitch = page.getByTestId("offer-seats-toggle");
const seatSwitchText = (await localize("en"))("number_of_seats");
const shareAttendeeText = (await localize("en"))("show_attendees");
await expect(seatSwitch).toBeVisible();
await seatSwitch.click();
const seatSwitchField = page.getByLabel(seatSwitchText);
await seatSwitchField.fill("3");
await expect(seatSwitchField).toHaveValue("3");
await expect(page.getByLabel(shareAttendeeText)).toBeVisible();
await seatSwitch.click();
},
checkLockTimezone: async () => {
const lockTimezoneText = (await localize("en"))("description_lock_timezone_toggle_on_booking_page");
const lockSwitch = page
.locator("fieldset")
.filter({
hasText: lockTimezoneText,
})
.getByRole("switch");
await expect(lockSwitch).toBeVisible();
},
checkEventType: async () => {
const requiresConfirmationText = (await localize("en"))("requires_confirmation");
await expect(page.locator(`text=${requiresConfirmationText}`)).toBeVisible();
},
};
}