Compare commits

...

33 Commits

Author SHA1 Message Date
GitStart-Cal.com 377ccaa7e5
Merge branch 'main' into testE2E-timezone 2024-01-09 17:24:40 +05:45
gitstart-calcom 054115e37e Change way to grab element 2024-01-08 22:35:38 +00:00
gitstart-calcom 612ef2678c Merge commit 'fcc50c1d0f90d77253455e7caadab383a35ebefb' into testE2E-timezone 2024-01-08 22:35:07 +00:00
Keith Williams 858678b9ae
Merge branch 'main' into testE2E-timezone 2024-01-05 17:57:19 -03:00
GitStart-Cal.com f03743eee4
Merge branch 'main' into testE2E-timezone 2023-11-30 23:26:14 +05:45
GitStart-Cal.com 0ad9e3fabb
Merge branch 'main' into testE2E-timezone 2023-11-29 22:04:23 +05:45
GitStart-Cal.com 50e60ea670
Update timezone.e2e.ts 2023-11-28 18:00:19 -03:00
gitstart-calcom dc663b0eac Refactor 2023-11-28 19:46:15 +00:00
gitstart-calcom 6430ee40e5 Merge commit 'f19a1926b452bb6934d7887bbad3a42f9b7f5344' into testE2E-timezone 2023-11-28 19:45:48 +00:00
GitStart-Cal.com de2d40b129
Merge branch 'main' into testE2E-timezone 2023-11-24 00:22:49 +05:45
GitStart-Cal.com 0752d9d264
Merge branch 'main' into testE2E-timezone 2023-11-23 19:05:06 +05:45
GitStart-Cal.com 457dfa645d
Merge branch 'main' into testE2E-timezone 2023-11-23 09:01:59 +05:45
GitStart-Cal.com 7288366b7d
Merge branch 'main' into testE2E-timezone 2023-11-23 00:02:45 +05:45
GitStart-Cal.com 3c64bc3500
Merge branch 'main' into testE2E-timezone 2023-11-09 10:24:58 +05:45
GitStart-Cal.com cb5a56a840
Merge branch 'main' into testE2E-timezone 2023-11-07 19:14:23 +05:45
GitStart-Cal.com 5d48e4a2ca
Merge branch 'main' into testE2E-timezone 2023-11-03 20:54:16 +05:45
Keith Williams 6d05adc324
Merge branch 'main' into testE2E-timezone 2023-11-03 11:12:43 -03:00
GitStart-Cal.com ff84d4ae9a
Merge branch 'main' into testE2E-timezone 2023-11-03 17:59:16 +05:45
GitStart-Cal.com 4c9461937b
Merge branch 'main' into testE2E-timezone 2023-11-03 05:51:00 +05:45
GitStart-Cal.com d7a90ba64b
Merge branch 'main' into testE2E-timezone 2023-11-01 02:38:21 +05:45
GitStart-Cal.com 73728d2fe7
Merge branch 'main' into testE2E-timezone 2023-10-30 20:51:56 +05:45
GitStart-Cal.com 55a8d345e8
Merge branch 'main' into testE2E-timezone 2023-10-26 13:42:13 +00:00
GitStart-Cal.com c332f0bbcb
Merge branch 'main' into testE2E-timezone 2023-10-25 13:57:59 +00:00
GitStart-Cal.com 51165289fa
Merge branch 'main' into testE2E-timezone 2023-10-24 22:10:35 +00:00
GitStart-Cal.com 50773e7602
Merge branch 'main' into testE2E-timezone 2023-10-24 20:53:54 +00:00
gitstart-calcom 42ffaaedb1 add changes 2023-10-24 20:37:21 +00:00
GitStart-Cal.com 41b4c48921
Merge branch 'main' into testE2E-timezone 2023-10-10 12:08:23 +00:00
gitstart-calcom bd57353dd6 FIx failing tests 2023-10-09 21:25:40 +00:00
gitstart-calcom e8214b6e92 FIx failing tests 2023-10-09 20:31:32 +00:00
gitstart-calcom bca1fffd23 Merge commit '6c8c3de87c08ae63d04b2b4bc1049bd35eac19fe' into testE2E-timezone 2023-10-09 20:31:03 +00:00
GitStart-Cal.com 9a711cb7e9
Merge branch 'main' into testE2E-timezone 2023-10-09 17:16:00 +00:00
GitStart-Cal.com cb55ce6cc6
Merge branch 'main' into testE2E-timezone 2023-10-06 16:58:56 +00:00
gitstart-calcom 1965f24241 Add E2E tests for timezones 2023-10-06 16:20:49 +00:00
2 changed files with 123 additions and 2 deletions

View File

@ -0,0 +1,41 @@
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 page.goto("/event-types");
// Create a new event type
await bookingPage.createRegularEventType("15 min test timezone");
// Schedule a booking changing the timezone to America/New_York
const bookingSchedulingPage = await bookingPage.previewEventType();
await bookingPage.selectTimezone("America/New York", bookingSchedulingPage);
await bookingPage.assertRightTimezone("America/New York", bookingSchedulingPage);
await bookingPage.selectTimeSlot(bookingSchedulingPage);
// Check if the correct timezone is displayed and if the meeting was scheduled successfully
await bookingPage.assertRightTimezone("America/New York", bookingSchedulingPage, {
inConfirmationPage: true,
shouldConfirmBooking: true,
});
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);
// Cancel the meeting in upcoming bookings page
await bookingPage.cancelUpcomingBooking("15 min test timezone", bookingSchedulingPage);
await bookingPage.assertBookingCanceled(bookingSchedulingPage);
// Delete the event-type
await bookingPage.goToEventTypePage(bookingSchedulingPage);
await bookingPage.deleteEventType("15 min test timezone", bookingSchedulingPage);
});
});

View File

@ -192,8 +192,14 @@ const goToNextMonthIfNoAvailabilities = async (eventTypePage: Page) => {
export function createBookingPageFixture(page: Page) {
return {
goToEventTypePage: async (page: Page) => {
page.goto("/event-types");
},
goToEventType: async (eventType: string) => {
await page.getByRole("link", { name: eventType }).click();
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();
@ -253,7 +259,6 @@ export function createBookingPageFixture(page: Page) {
clickReschedule: async () => {
await page.getByText("Reschedule").click();
},
selectFirstAvailableTime: async () => {
await page.getByTestId("time").first().click();
},
@ -387,5 +392,80 @@ export function createBookingPageFixture(page: Page) {
await scheduleSuccessfullyPage.waitFor({ state: "visible" });
await expect(scheduleSuccessfullyPage).toBeVisible();
},
selectTimezoneInSettings: async (name: string, settingsPage: Page) => {
await settingsPage.locator("#timezone svg").click();
name.includes(" ") && (name = name.replace(" ", "_"));
await settingsPage.getByTestId(`select-option-${name}`).click();
await settingsPage.getByRole("button", { name: "Update" }).click();
await settingsPage.getByRole("button", { name: "Don't update" }).click();
},
assertRightTimezone: async (
timezone: string,
bookingSchedulingPage: Page,
options?: { inConfirmationPage: boolean; shouldConfirmBooking?: boolean }
) => {
if (options?.inConfirmationPage) {
await expect(bookingSchedulingPage.getByText("America/New_York")).toBeVisible();
if (options.shouldConfirmBooking) {
await bookingSchedulingPage.getByTestId("confirm-book-button").click();
await expect(bookingSchedulingPage.getByTestId("cancel")).toBeVisible();
}
} else {
await expect(
bookingSchedulingPage
.locator("div")
.filter({ hasText: `${timezone}` })
.nth(1)
).toBeVisible();
}
},
checkUpdateTimezone: async () => {
if (await page.getByRole("button", { name: "Update timezone" }).isVisible()) {
page.getByRole("button", { name: "Update timezone" }).click();
}
},
createRegularEventType: async (name: string) => {
await page.getByTestId("new-event-type").click();
await page.getByPlaceholder("Quick Chat").click();
await page.getByPlaceholder("Quick Chat").fill(`${name}`);
await page.getByRole("button", { name: "Continue" }).dblclick();
await page.getByTestId("update-eventtype").click();
},
selectTimezone: async (timezone: string, bookingSchedulingPage: Page) => {
await bookingSchedulingPage.locator("span").filter({ hasText: "/" }).locator("svg").first().click();
timezone.includes(" ") && (timezone = timezone.replace(" ", "_"));
await bookingSchedulingPage.getByTestId(`select-option-${timezone}`).click();
},
assertCorrectTimezoneInGlobeButton: async (timezone: string, page?: Page) => {
await page?.getByRole("link", { name: "m - " }).first().hover();
await page?.getByRole("link", { name: "m - " }).first().getByRole("button").click();
timezone.includes(" ") && (timezone = timezone.replace(" ", "_"));
page !== undefined && (await expect(page?.getByText("timezone").first()).toBeVisible());
},
deleteEventType: async (bookingName: string, page?: Page) => {
await page
?.getByRole("link", { name: `${bookingName}` })
.first()
.click();
await page
?.locator("header")
.filter({ hasText: `${bookingName}Save` })
.getByRole("button")
.nth(2)
.click();
await page?.getByRole("button", { name: "Yes, delete" }).click();
page !== undefined && (await expect(page?.getByTestId("toast-success")).toBeVisible());
},
cancelUpcomingBooking: async (bookingName: string, page?: Page) => {
await page?.getByRole("link", { name: "Bookings" }).click();
await page
?.getByRole("row", {
name: ` ${bookingName} between Pro Example and Pro Example You and Pro Example Cancel Edit`,
})
.getByTestId("cancel")
.first()
.click();
await page?.getByTestId("confirm_cancel").click();
},
};
}