88from pages .screening_subject_search .subject_screening_summary import (
99 SubjectScreeningSummary ,
1010)
11+ from pages .screening_subject_search .advance_fobt_screening_episode_page import (
12+ AdvanceFOBTScreeningEpisode ,
13+ )
1114from utils .user_tools import UserTools
1215from utils .load_properties_file import PropertiesFile
1316from utils .screening_subject_page_searcher import verify_subject_event_status_by_nhs_no
@@ -101,26 +104,24 @@ def test_compartment_5(page: Page, smokescreen_properties: dict) -> None:
101104 # On the Subject Screening Summary click on the 'Advance FOBT Screening Episode' button and then click on the 'Suitable for Endoscopic Test' button
102105 # Click OK after message
103106 page .get_by_role ("button" , name = "Advance FOBT Screening Episode" ).click ()
104- page .once ("dialog" , lambda dialog : dialog .accept ())
105- page .get_by_role ("button" , name = "Suitable for Endoscopic Test" ).click ()
107+ AdvanceFOBTScreeningEpisode (page ).click_suitable_for_escopic_test_button ()
106108
107109 # Enter a 'First Offered Appointment Date' (enter a date after the attended appt)
108- page . get_by_role ( "button" , name = "Calendar" ). click ()
110+ AdvanceFOBTScreeningEpisode ( page ). click_calendar_button ()
109111 CalendarPicker (page ).v1_calender_picker (datetime .today ())
110112
111113 # Select 'Colonoscopy' from the 'Type of Test' from the drop down list
112- page . locator ( "#UI_EXT_TEST_TYPE_2233" ). select_option ( label = "Colonoscopy" )
114+ AdvanceFOBTScreeningEpisode ( page ). select_test_type_dropdown_option ( "Colonoscopy" )
113115
114116 # Click the 'Invite for Diagnostic Test >>' button
115117 # Click 'OK'
116- page .once ("dialog" , lambda dialog : dialog .accept ())
117- page .get_by_role ("button" , name = "Invite for Diagnostic Test >>" ).click ()
118+ AdvanceFOBTScreeningEpisode (page ).click_invite_for_diagnostic_test_button ()
118119 SubjectScreeningSummary (page ).verify_latest_event_status_value (
119120 "A59 - Invited for Diagnostic Test"
120121 )
121122
122123 # Click 'Attend Diagnostic Test' button
123- page . get_by_role ( "button" , name = "Attend Diagnostic Test" ). click ()
124+ AdvanceFOBTScreeningEpisode ( page ). click_attend_diagnostic_test_button ()
124125
125126 # Select Colonoscopy from drop down list. Enter the actual appointment date as today's date and select 'Save'
126127 page .locator ("#UI_CONFIRMED_TYPE_OF_TEST" ).select_option (label = "Colonoscopy" )
@@ -140,16 +141,15 @@ def test_compartment_5(page: Page, smokescreen_properties: dict) -> None:
140141
141142 # Click 'Other Post-investigation Contact Required' button
142143 # Click 'OK'
143- page .once ("dialog" , lambda dialog : dialog .accept ())
144- page .get_by_role ("button" , name = "Other Post-investigation" ).click ()
145- expect (
146- page .get_by_role (
147- "cell" , name = "A361 - Other Post-investigation Contact Required" , exact = True
148- )
149- ).to_be_visible ()
144+ AdvanceFOBTScreeningEpisode (page ).click_other_post_investigation_button ()
145+ AdvanceFOBTScreeningEpisode (page ).verify_latest_event_status_value (
146+ "A361 - Other Post-investigation Contact Required"
147+ )
150148
151149 # Select 'Record other post-investigation contact' button
152- page .get_by_role ("button" , name = "Record other post-" ).click ()
150+ AdvanceFOBTScreeningEpisode (
151+ page
152+ ).click_record_other_post_investigation_contact_button ()
153153
154154 # Complete 'Contact Direction', To patient
155155 # 'Contact made between patient and', Selects the top option in the dropdown
0 commit comments