@@ -219,46 +219,53 @@ def record_contact_close_episode_no_contact(self) -> None:
219219
220220 Steps:
221221 - Clicks the 'Record Contact with Patient' button
222- - Selects 'To patient' as the direction
222+ - Selects direction and contact type
223+ - Picks a calendar date
223224 - Fills start time, end time, and duration
224225 - Enters a note
226+ - Selects 'Patient Contacted' as 'No'
225227 - Selects the outcome 'Close Episode - No Contact'
226228 - Clicks the save button
227229 """
228- logging .info (
229- "[CONTACT RECORD] Starting contact recording flow with outcome: Close Episode - No Contact"
230- )
230+ logging .info ("[CONTACT RECORD] Starting contact recording flow with outcome: Close Episode - No Contact" )
231231
232232 # Step 1: Click 'Record Contact with Patient' button
233- self .page .get_by_role ("button" , name = "Record Contact with Patient" ).click ()
234- logging .info ("[CONTACT RECORD] Navigated to contact recording screen" )
235-
236- # Step 2: Select 'To patient' from direction dropdown
237- self .page .locator ("#UI_DIRECTION" ).select_option (label = "To patient" )
238- logging .info ("[CONTACT RECORD] Selected direction: To patient" )
239-
240- # Step 3: Enter time details
241- self .page .locator ("#UI_START_TIME" ).fill ("09:00" )
242- self .page .locator ("#UI_END_TIME" ).fill ("09:10" )
233+ # self.page.get_by_role("button", name="Record Contact with Patient").click()
234+ # logging.info("[CONTACT RECORD] Navigated to contact recording screen")
235+
236+ # Step 2: Select direction and contact type
237+ self .page .get_by_label ("Contact Direction" ).select_option ("20159" )
238+ self .page .get_by_label ("Contact made between patient" ).select_option ("1171" )
239+ logging .info ("[CONTACT RECORD] Selected direction and contact type" )
240+
241+ # Step 3: Pick calendar date
242+ self .page .get_by_role ("button" , name = "Calendar" ).click ()
243+ self .page .get_by_role ("cell" , name = "19" , exact = True ).click ()
244+ logging .info ("[CONTACT RECORD] Selected calendar date: 19" )
245+
246+ # Step 4: Enter time details
247+ self .page .locator ("#UI_START_TIME" ).fill ("08:00" )
248+ self .page .locator ("#UI_END_TIME" ).fill ("08:10" )
243249 self .page .locator ("#UI_DURATION" ).fill ("10" )
244- logging .info (
245- "[CONTACT RECORD] Entered time details: 09:00–09:10, duration 10 mins"
246- )
250+ logging .info ("[CONTACT RECORD] Entered time details: 08:00–08:10" )
247251
248- # Step 4 : Enter note
249- self .page .locator ( "#UI_COMMENT_ID " ).fill ("automation test note " )
250- logging .info ("[CONTACT RECORD] Entered note: automation test note " )
252+ # Step 5 : Enter note
253+ self .page .get_by_text ( "(up to 500 char) " ).fill ("Automation test record " )
254+ logging .info ("[CONTACT RECORD] Entered note: Automation test record " )
251255
252- # Step 5: Select outcome
253- self .page .locator ("#UI_OUTCOME" ).select_option (
254- label = "Close Episode - No Contact"
255- )
256+ # Step 6: Select 'Patient Contacted' as 'No'
257+ self .page .get_by_label ("Patient Contacted" ).select_option ("N" )
258+ logging .info ("[CONTACT RECORD] Selected 'Patient Contacted': No" )
259+
260+ # Step 7: Select outcome
261+ self .page .get_by_label ("Outcome" ).select_option ("20202" )
256262 logging .info ("[CONTACT RECORD] Selected outcome: Close Episode - No Contact" )
257263
258- # Step 6 : Click save
264+ # Step 8 : Click save
259265 self .page .locator ("input[name='UI_BUTTON_SAVE']" ).click ()
260266 logging .info ("[CONTACT RECORD] Contact recording flow completed successfully" )
261267
268+
262269 def click_not_suitable_for_diagnostic_tests_button (self ) -> None :
263270 """Click the 'Not Suitable for Diagnostic Tests' button."""
264271 self .safe_accept_dialog (self .not_suitable_for_diagnostic_tests_button )
0 commit comments