@@ -4,17 +4,25 @@ import {
44 APPT_AVAILABILITY_PAGE ,
55 APPT_PENDING_BOOKINGS_PAGE ,
66 APPT_BOOKED_BOOKINGS_PAGE ,
7- APPT_DASHBOARD_MONTH_PAGE ,
87 TIMEOUT_1_SECOND ,
8+ TIMEOUT_2_SECONDS ,
99 TIMEOUT_3_SECONDS ,
10- TIMEOUT_60_SECONDS ,
10+ APPT_TIMEZONE_SETTING_PRIMARY ,
1111} from '../const/constants' ;
1212
1313
1414export class AvailabilityPage {
1515 readonly page : Page ;
16- readonly allFutureBookingsOptionText : string = 'All future bookings' ;
16+ readonly saveChangesBtn : Locator ;
17+ readonly savedSuccessfullyText : Locator ;
18+ readonly revertChangesBtn : Locator ;
1719 readonly setAvailabilityText : Locator ;
20+ readonly bookableToggle : Locator ;
21+ readonly bookableToggleContainer : Locator ;
22+ readonly timeZoneText : Locator ;
23+ readonly editTimeZoneBtn : Locator ;
24+ readonly calendarSelect : Locator ;
25+ readonly autoConfirmBookingsCheckBox : Locator ;
1826 readonly customizePerDayCheckBox : Locator ;
1927 readonly allStartTimeInput : Locator ;
2028 readonly allEndTimeInput : Locator ;
@@ -23,12 +31,35 @@ export class AvailabilityPage {
2331 readonly customStartTime3Input : Locator ;
2432 readonly customStartTime4Input : Locator ;
2533 readonly customStartTime5Input : Locator ;
26- readonly saveChangesBtn : Locator ;
27- readonly revertChangesBtn : Locator ;
34+ readonly minNoticeInput : Locator ;
35+ readonly bookingWindowInput : Locator ;
36+ readonly bookingPageDetailsHdr : Locator ;
37+ readonly bookingPageNameInput : Locator ;
38+ readonly bookingPageDescInput : Locator ;
39+ readonly bookingPageMtgLinkInput : Locator ;
40+ readonly bookingPageMtgDur15MinRadio : Locator ;
41+ readonly bookingPageMtgDur30MinRadio : Locator ;
42+ readonly bookingPageLinkHdr : Locator ;
43+ readonly refreshLinkBtn : Locator ;
44+ readonly refreshLinkConfirmTxt : Locator ;
45+ readonly refreshLinkConfirmCancelBtn : Locator ;
46+ readonly shareYourLinkInput : Locator ;
47+ readonly shareLinkCopyBtn : Locator ;
2848
2949 constructor ( page : Page ) {
3050 this . page = page ;
51+ this . saveChangesBtn = this . page . getByRole ( 'button' , { name : 'Save' , exact : true } ) ;
52+ this . savedSuccessfullyText = this . page . getByText ( 'Availability saved successfully' , { exact : true } ) ;
53+ this . revertChangesBtn = this . page . getByRole ( 'button' , { name : 'Revert changes' , exact : true } ) ;
54+
55+ // set your availability section
3156 this . setAvailabilityText = this . page . getByText ( 'Set Your Availability' ) ;
57+ this . bookableToggle = this . page . getByTestId ( 'availability-set-availability-toggle' ) ;
58+ this . bookableToggleContainer = this . page . getByTitle ( 'Activate schedule' ) ;
59+ this . timeZoneText = this . page . getByText ( APPT_TIMEZONE_SETTING_PRIMARY ) ;
60+ this . editTimeZoneBtn = this . page . getByRole ( 'button' , { name : 'Edit' } ) ;
61+ this . calendarSelect = this . page . locator ( 'select[name="calendar"]' ) ;
62+ this . autoConfirmBookingsCheckBox = this . page . getByTestId ( 'availability-automatically-confirm-checkbox' ) ;
3263 this . customizePerDayCheckBox = this . page . getByRole ( 'checkbox' , { name : 'Set custom times for each day' } ) ;
3364 this . allStartTimeInput = this . page . locator ( '#start_time' ) ;
3465 this . allEndTimeInput = this . page . locator ( '#end_time' ) ;
@@ -37,16 +68,33 @@ export class AvailabilityPage {
3768 this . customStartTime3Input = this . page . getByTestId ( 'availability-start-time-3-0-input' ) ;
3869 this . customStartTime4Input = this . page . getByTestId ( 'availability-start-time-4-0-input' ) ;
3970 this . customStartTime5Input = this . page . getByTestId ( 'availability-start-time-5-0-input' ) ;
40- this . saveChangesBtn = this . page . getByTestId ( 'availability-save-changes-btn' ) ;
41- this . revertChangesBtn = this . page . getByRole ( 'button' , { name : 'Revert changes' } ) ;
71+ this . minNoticeInput = this . page . getByRole ( 'radio' , { name : 'instant' } ) ;
72+ this . bookingWindowInput = this . page . getByRole ( 'radio' , { name : '7 days' } ) ;
73+
74+ // booking page details section
75+ this . bookingPageDetailsHdr = this . page . getByRole ( 'heading' , { name : 'Booking Page Details' } ) ;
76+ this . bookingPageNameInput = this . page . locator ( '#pageName' ) ;
77+ this . bookingPageDescInput = this . page . locator ( '#pageDescription' ) ;
78+ this . bookingPageMtgLinkInput = this . page . locator ( '#virtualMeetingLink' ) ;
79+ this . bookingPageMtgDur15MinRadio = this . page . getByText ( '15 Min' ) ;
80+ this . bookingPageMtgDur30MinRadio = this . page . getByText ( '30 Min' ) ;
81+
82+ // booking page link section
83+ this . bookingPageLinkHdr = this . page . getByRole ( 'heading' , { name : 'Booking Page Link' } ) ;
84+ this . refreshLinkBtn = this . page . getByRole ( 'button' , { name : 'Refresh link' } ) ;
85+ this . refreshLinkConfirmTxt = this . page . getByText ( 'Refresh link' , { exact : true } ) ;
86+ this . refreshLinkConfirmCancelBtn = this . page . getByRole ( 'button' , { name : 'Cancel' } ) ;
87+ this . shareYourLinkInput = this . page . locator ( '#shareLink' ) ;
88+ this . shareLinkCopyBtn = this . page . getByRole ( 'button' , { name : 'Copy' , exact : true } ) ;
4289 }
4390
4491 /**
45- * Navigate to the pending bookings page and display all future pending bookings
92+ * Navigate to the availability page
4693 */
4794 async gotoAvailabilityPage ( ) {
48- // go to bookings page and set filter in URL to show pending only
95+ // go to availability page, sometimes takes a bit to load all element values
4996 await this . page . goto ( APPT_AVAILABILITY_PAGE ) ;
97+ await this . page . waitForTimeout ( TIMEOUT_2_SECONDS ) ;
5098 }
5199
52100 /**
0 commit comments