@@ -186,6 +186,12 @@ def __init__(
186186 self .archived_records_checkbox = self .page .get_by_role (
187187 "checkbox" , name = "Archived records"
188188 )
189+ self .send_clinic_invitations_link = self .page .get_by_role (
190+ "link" , name = "Send clinic invitations"
191+ )
192+ self .send_clinic_invitations_button = self .page .get_by_role (
193+ "button" , name = "Send clinic invitations"
194+ )
189195
190196 def __get_display_formatted_date (self , date_to_format : str ) -> str :
191197 _parsed_date = datetime .strptime (date_to_format , "%Y%m%d" )
@@ -373,6 +379,14 @@ def click_on_update_results(self):
373379 def fill_notes (self , notes : str ):
374380 self .notes_textbox .fill (notes )
375381
382+ @step ("Click Send clinic invitations" )
383+ def click_send_clinic_invitations_link (self ):
384+ self .send_clinic_invitations_link .click ()
385+
386+ @step ("Click Send clinic invitations" )
387+ def click_send_clinic_invitations_button (self ):
388+ self .send_clinic_invitations_button .click ()
389+
376390 @step ("Click on Record a new consent response" )
377391 def click_record_a_new_consent_response (self ):
378392 # temporary wait before clicking the button to prevent errors
@@ -651,13 +665,21 @@ def verify_scheduled_date(self, message: str):
651665 self .click_continue_link ()
652666
653667 def schedule_a_valid_session (
654- self , location : str , programme_group : str , for_today : bool = False
668+ self ,
669+ location : str ,
670+ programme_group : str ,
671+ for_today : bool = False ,
672+ yesterday : bool = False ,
655673 ):
656- _future_date = (
657- get_offset_date (offset_days = 0 )
658- if for_today
659- else get_offset_date (offset_days = 10 )
660- )
674+ # scheduling a session for yesterday is a temporary measure for the rollover period
675+ # this will be disallowed in the future
676+ if yesterday :
677+ offset_days = - 1
678+ elif for_today :
679+ offset_days = 0
680+ else :
681+ offset_days = 10
682+ _future_date = get_offset_date (offset_days = offset_days )
661683 _expected_message = f"Session dates{ self .__get_display_formatted_date (date_to_format = _future_date )} "
662684 self .click_session_for_programme_group (location , programme_group )
663685 self .__schedule_session (on_date = _future_date )
0 commit comments