This commit is contained in:
gitstart-calcom 2023-11-28 19:46:15 +00:00
parent 6430ee40e5
commit dc663b0eac
2 changed files with 14 additions and 13 deletions

View File

@ -1,12 +1,15 @@
import { login } from "../fixtures/users";
import { test } from "../lib/fixtures";
import { localize } from "../lib/testUtils";
test.describe("Test the timezone behavior in specific cases", () => {
test("Change timezone in booking page", async ({ page, bookingPage }) => {
const backToBookingsText = (await localize("en"))("back_to_bookings");
await login({ username: "pro", email: "pro@example.com", password: "pro" }, page);
await page.goto("/event-types");
await bookingPage.checkUpdateTimezone();
await bookingPage.goToEventTypePage();
await page.goto("/event-types");
// Create a new event type
await bookingPage.createRegularEventType("15 min test timezone");
@ -22,7 +25,7 @@ test.describe("Test the timezone behavior in specific cases", () => {
inConfirmationPage: true,
shouldConfirmBooking: true,
});
await bookingPage.goToEventType("Back to bookings", bookingSchedulingPage);
await bookingPage.goToPage(backToBookingsText, bookingSchedulingPage);
// Check if the icon globe is displayed in the bookings page and if the correct timezone is displayed when we click on it
await bookingPage.assertCorrectTimezoneInGlobeButton("America/New York", bookingSchedulingPage);

View File

@ -191,11 +191,14 @@ const goToNextMonthIfNoAvailabilities = async (eventTypePage: Page) => {
export function createBookingPageFixture(page: Page) {
return {
goToEventTypePage: async (page?: Page) => {
page?.goto("/event-types");
goToEventTypePage: async (page: Page) => {
page.goto("/event-types");
},
goToEventType: async (eventType: string, page?: Page) => {
await page?.getByRole("link", { name: eventType }).first().click();
goToEventType: async (eventType: string) => {
await page.getByRole("link", { name: eventType }).first().click();
},
goToPage: async (pageName: string, page: Page) => {
await page.getByRole("link", { name: pageName }).click();
},
goToTab: async (tabName: string) => {
await page.getByTestId(`vertical-tab-${tabName}`).click();
@ -238,13 +241,8 @@ export function createBookingPageFixture(page: Page) {
clickReschedule: async () => {
await page.getByText("Reschedule").click();
},
navigateToAvailableTimeSlot: async () => {
while (await page.getByRole("button", { name: "View next" }).isVisible()) {
await page.getByRole("button", { name: "View next" }).click();
}
},
selectFirstAvailableTime: async (page?: Page) => {
await page?.getByTestId("time").first().click();
selectFirstAvailableTime: async () => {
await page.getByTestId("time").first().click();
},
fillRescheduleReasonAndConfirm: async () => {