@@ -235,6 +235,26 @@ def __delete_sessions(self):
235235 chain_locator = True ,
236236 )
237237
238+ def edit_session (self , to_date : str ):
239+ _day = to_date [- 2 :]
240+ _month = to_date [4 :6 ]
241+ _year = to_date [:4 ]
242+ self .po .perform_action (locator = self .LNK_EDIT_SESSION , action = actions .CLICK_LINK )
243+ self .po .perform_action (locator = self .LNK_CHANGE_SESSION_DATES , action = actions .CLICK_LINK )
244+ self .po .perform_action (locator = self .TXT_DAY , action = actions .FILL , value = _day )
245+ self .po .perform_action (locator = self .TXT_MONTH , action = actions .FILL , value = _month )
246+ self .po .perform_action (locator = self .TXT_YEAR , action = actions .FILL , value = _year )
247+ self .po .perform_action (locator = self .LNK_CONTINUE , action = actions .CLICK_BUTTON )
248+ self .po .perform_action (locator = self .LNK_CONTINUE , action = actions .CLICK_LINK )
249+ self .po .verify (
250+ locator = "locator('div').filter(has_text=re.compile(r'^Session datesNot provided$')).get_by_role('definition')" ,
251+ property = object_properties .VISIBILITY ,
252+ value = False ,
253+ exact = False ,
254+ by_test_id = False ,
255+ chain_locator = True ,
256+ )
257+
238258 def verify_triage_updated (self ):
239259 self .po .verify (
240260 locator = self .LBL_PARAGRAPH ,
@@ -319,12 +339,6 @@ def update_triage_outcome_consent_refused(self, file_paths):
319339 self .click_child_full_name ()
320340 self .click_get_consent_responses ()
321341 self .consent_page .service_refuse_consent ()
322- # self.dashboard_page.go_to_dashboard()
323- # self.dashboard_page.click_sessions()
324- # self.click_scheduled()
325- # self.click_school1()
326- # self.click_record_vaccinations()
327- # self.click_could_not_vaccinate()
328342 self .click_consent_refused ()
329343 self .click_child_full_name ()
330344 self .click_activity_log ()
@@ -338,6 +352,14 @@ def schedule_a_valid_session(self, for_today: bool = False):
338352 self .schedule_session (future_date = _future_date )
339353 self .verify_scheduled_date (message = _expected_message )
340354
355+ def edit_a_session_to_today (self ):
356+ _future_date = get_offset_date (offset_days = 0 )
357+ _expected_message = f"Session dates { self .__get_display_formatted_date (date_to_format = _future_date )} "
358+ self .click_scheduled ()
359+ self .click_school1 ()
360+ self .edit_session (to_date = _future_date )
361+ # self.verify_scheduled_date(message=_expected_message)
362+
341363 def delete_all_sessions (self ):
342364 self .click_scheduled ()
343365 self .click_school1 ()
0 commit comments