22from playwright .sync_api import Page
33from pages .logout .log_out_page import LogoutPage
44from pages .base_page import BasePage
5+ from pages .screening_practitioner_appointments .appointment_calendar_page import (
6+ AppointmentCalendarPage ,
7+ )
8+ from pages .screening_practitioner_appointments .appointment_detail_page import (
9+ AppointmentDetailPage ,
10+ )
511from pages .screening_practitioner_appointments .screening_practitioner_appointments_page import (
612 ScreeningPractitionerAppointmentsPage ,
713)
14+ from pages .screening_practitioner_appointments .screening_practitioner_day_view_page import (
15+ ScreeningPractitionerDayViewPage ,
16+ )
817from pages .datasets .subject_datasets_page import (
918 SubjectDatasetsPage ,
1019)
3140from pages .screening_subject_search .attend_diagnostic_test_page import (
3241 AttendDiagnosticTestPage ,
3342)
43+ from pages .screening_subject_search .subject_screening_summary_page import (
44+ SubjectScreeningSummaryPage ,
45+ )
46+
47+ from pages .screening_subject_search .contact_with_patient_page import (
48+ ContactWithPatientPage ,
49+ )
50+
3451from utils .user_tools import UserTools
3552from utils .load_properties_file import PropertiesFile
3653from utils .screening_subject_page_searcher import verify_subject_event_status_by_nhs_no
@@ -76,11 +93,13 @@ def test_compartment_5(page: Page, smokescreen_properties: dict) -> None:
7693 AppointmentCalendarPage (page ).select_site_dropdown (
7794 smokescreen_properties ["c5_eng_site" ]
7895 )
96+ # page.get_by_role("link", name="Screening Practitioner").select_option("")
7997
8098 AppointmentCalendarPage (page ).click_view_appointments_on_this_day_button ()
8199 ScreeningPractitionerDayViewPage (page ).click_calendar_button ()
82100 date_from_util = datetime (2025 , 4 , 30 )
83101 CalendarPicker (page ).v1_calender_picker (date_from_util )
102+ # page.locator("#UI_PRACTITIONER_NDV").select_option("")
84103
85104 # Select subject from inital test data util
86105 ScreeningPractitionerDayViewPage (page ).click_patient_link ("DIVIDEND MUZZLE" )
@@ -96,7 +115,7 @@ def test_compartment_5(page: Page, smokescreen_properties: dict) -> None:
96115 # Repeat for x Abnormal patients
97116
98117 # Navigate to the 'Subject Screening Summary' screen for the 1st Abnormal patient
99- nhs_no = "9852356488 " # Test NHS NO for DIVIDEND MUZZLE
118+ nhs_no = "9645516129 " # Test NHS NO for DIVIDEND MUZZLE
100119 verify_subject_event_status_by_nhs_no (
101120 page , nhs_no , "J10 - Attended Colonoscopy Assessment Appointment"
102121 )
@@ -180,31 +199,20 @@ def test_compartment_5(page: Page, smokescreen_properties: dict) -> None:
180199 page
181200 ).click_record_other_post_investigation_contact_button ()
182201
183- # Complete 'Contact Direction', To patient
184- # 'Contact made between patient and', Selects the top option in the dropdown
185- # 'Date of Patient Contact', Today
186- # 'Duration', 01:00
187- # 'Start Time', 11:00
188- # 'End Time', 12:00
189- # 'Discussion Record' TEST AUTOMATION
190- # select 'Outcome' - 'Post-investigation Appointment Not Required' and click 'Save'
191- page .locator ("#UI_DIRECTION" ).select_option (label = "To patient" )
192- page .locator ("#UI_CALLER_ID" ).select_option (index = 0 )
193- page .get_by_role ("button" , name = "Calendar" ).click ()
202+ ContactWithPatientPage (page ).select_direction_dropdown_option ("To patient" )
203+ ContactWithPatientPage (page ).select_caller_id_dropdown_index_option (1 )
204+ ContactWithPatientPage (page ).click_calendar_button ()
194205 CalendarPicker (page ).v1_calender_picker (datetime .today ())
195- page .locator ("#UI_START_TIME" ).click ()
196- page .locator ("#UI_START_TIME" ).fill ("11:00" )
197- page .locator ("#UI_END_TIME" ).click ()
198- page .locator ("#UI_END_TIME" ).fill ("12:00" )
199- page .locator ("#UI_COMMENT_ID" ).click ()
200- page .locator ("#UI_COMMENT_ID" ).fill ("Test Automation" )
201- page .locator ("#UI_OUTCOME" ).select_option (
202- label = "Post-investigation Appointment Not Required"
206+ ContactWithPatientPage (page ).enter_start_time ("11:00" )
207+ ContactWithPatientPage (page ).enter_end_time ("12:00" )
208+ ContactWithPatientPage (page ).enter_discussion_record_text ("Test Automation" )
209+ ContactWithPatientPage (page ).select_outcome_dropdown_option (
210+ "Post-investigation Appointment Not Required"
203211 )
204- page . get_by_role ( "button" , name = "Save" ). click ()
212+ ContactWithPatientPage ( page ). click_save_button ()
205213
206214 verify_subject_event_status_by_nhs_no (
207- page , nhs_no , "A361 - Other Post-investigation Contact Required"
215+ page , nhs_no , "A323 - Post-investigation Appointment NOT Required"
208216 )
209217
210218 # Repeat above for x subjects
0 commit comments