@@ -10,12 +10,12 @@ def __init__(self, page: Page):
1010 super ().__init__ (page )
1111 self .page = page
1212 # Book Appointment - page locators
13- self .screening_center_dropdown = page .locator ("#UI_NEW_SCREENING_CENTRE" )
14- self .site_dropdown = page .locator ("#UI_NEW_SITE" )
15- self .appointment_time_radio_button = page .locator (
16- page . get_by_role ( "radio" , name = "UI_NEW_SLOT_SELECTION_ID" )
13+ self .screening_center_dropdown = self . page .locator ("#UI_NEW_SCREENING_CENTRE" )
14+ self .site_dropdown = self . page .locator ("#UI_NEW_SITE" )
15+ self .appointment_time_radio_button = self . page .get_by_role (
16+ "radio" , name = "UI_NEW_SLOT_SELECTION_ID"
1717 )
18- self .save_button = page .get_by_role ("button" , name = "Save" )
18+ self .save_button = self . page .get_by_role ("button" , name = "Save" )
1919 self .appointments_table = TableUtils (self .page , "#displayRS" )
2020 self .current_month_displayed = self .page .locator ("#MONTH_AND_YEAR" )
2121
@@ -46,4 +46,7 @@ def appointment_booked_confirmation_is_displayed(self, message: str) -> None:
4646
4747 def get_current_month_displayed (self ) -> str :
4848 """Returns the current month displayed in the calendar."""
49- return self .current_month_displayed .text_content ()
49+ current_month_displayed_content = self .current_month_displayed .text_content ()
50+ if current_month_displayed_content is None :
51+ raise ValueError ("Current month displayed is 'None'" )
52+ return current_month_displayed_content
0 commit comments