@@ -178,7 +178,6 @@ def test_failsafe_reports_subjects_ceased_due_to_date_of_birth_changes(page: Pag
178178 BasePage (page ).bowel_cancer_screening_ntsh_page_title_contains_text ("Subject Demographic" )
179179
180180
181- @pytest .mark .only
182181def test_failsafe_reports_allocate_sc_for_patient_movements_within_hub_boundaries (page : Page ,
183182 tests_properties : dict ) -> None :
184183 """
@@ -191,6 +190,7 @@ def test_failsafe_reports_allocate_sc_for_patient_movements_within_hub_boundarie
191190
192191 report_timestamp_element = page .locator ("b" )
193192 nhs_number_link = page .locator ("//*[@id='listReportDataTable']/tbody/tr[3]/td[1]" )
193+ set_patients_screening_centre_dropdown = page .locator ("#cboScreeningCentre" )
194194
195195 # Go to failsafe reports page
196196 ReportsPage (page ).go_to_failsafe_reports_page ()
@@ -216,13 +216,14 @@ def test_failsafe_reports_allocate_sc_for_patient_movements_within_hub_boundarie
216216 BasePage (page ).bowel_cancer_screening_ntsh_page_title_contains_text ("Set Patient's Screening Centre" )
217217
218218 # Select another screening centre
219- page . locator ( "#cboScreeningCentre" ) .select_option (tests_properties ["coventry_and_warwickshire_bcs_centre" ])
219+ set_patients_screening_centre_dropdown .select_option (tests_properties ["coventry_and_warwickshire_bcs_centre" ])
220220
221221 # Click update
222222 ReportsPage (page ).click_reports_pages_update_button ()
223223
224224 # Verify new screening centre has saved
225- expect (page .locator ("#cboScreeningCentre" )).to_have_value (tests_properties ["coventry_and_warwickshire_bcs_centre" ])
225+ expect (set_patients_screening_centre_dropdown ).to_have_value (
226+ tests_properties ["coventry_and_warwickshire_bcs_centre" ])
226227
227228
228229def test_failsafe_reports_allocate_sc_for_patient_movements_into_your_hub (page : Page ) -> None :
@@ -302,7 +303,7 @@ def test_failsafe_reports_identify_and_link_new_gp(page: Page) -> None:
302303
303304
304305# Operational Reports
305- def test_operational_reports_appointment_attendance_not_updated (page : Page ) -> None :
306+ def test_operational_reports_appointment_attendance_not_updated (page : Page , tests_properties : dict ) -> None :
306307 """
307308 Confirms 'appointment_attendance_not_updated' page loads,
308309 a SC can be selected from the dropdown
@@ -311,9 +312,9 @@ def test_operational_reports_appointment_attendance_not_updated(page: Page) -> N
311312 an appointment record can be opened from here
312313 """
313314
314- coventry_and_warwickshire_bcs_centre = "23643"
315315 nhs_number_link = page .locator ("#listReportDataTable > tbody > tr:nth-child(3) > td:nth-child(1) > a" )
316316 report_timestamp_element = page .locator ("b" )
317+ set_patients_screening_centre_dropdown = page .get_by_label ("Screening Centre" )
317318
318319 # Go to operational reports page
319320 ReportsPage (page ).go_to_operational_reports_page ()
@@ -325,7 +326,7 @@ def test_operational_reports_appointment_attendance_not_updated(page: Page) -> N
325326 BasePage (page ).bowel_cancer_screening_ntsh_page_title_contains_text ("Appointment Attendance Not Updated" )
326327
327328 # Select a screening centre from the drop-down options
328- page . get_by_label ( "Screening Centre" ). select_option (coventry_and_warwickshire_bcs_centre )
329+ set_patients_screening_centre_dropdown . select_option (tests_properties [ " coventry_and_warwickshire_bcs_centre" ] )
329330
330331 # Click "Generate Report" button
331332 ReportsPage (page ).click_generate_report_button ()
@@ -383,15 +384,16 @@ def test_operational_reports_demographic_update_inconsistent_with_manual_update(
383384 BasePage (page ).bowel_cancer_screening_page_title_contains_text ("Demographic Update Inconsistent With Manual Update" )
384385
385386
386- def test_operational_reports_screening_practitioner_6_weeks_availability_not_set_up (page : Page ) -> None :
387+ def test_operational_reports_screening_practitioner_6_weeks_availability_not_set_up (page : Page ,
388+ tests_properties : dict ) -> None :
387389 """
388390 Confirms 'screening_practitioner_6_weeks_availability_not_set_up_report' page loads,
389391 a SC can be selected
390392 the 'generate report' and 'refresh' buttons work as expected and
391393 the timestamp updates to current date and time when refreshed
392394 """
393395
394- coventry_and_warwickshire_bcs_centre = "23643"
396+ set_patients_screening_centre_dropdown = page . get_by_label ( "Screening Centre" )
395397 report_generated_timestamp_element = page .locator ("#displayGenerateDate" )
396398
397399 # Go to operational reports page
@@ -405,7 +407,7 @@ def test_operational_reports_screening_practitioner_6_weeks_availability_not_set
405407 "Screening Practitioner 6 Weeks Availability Not Set Up" )
406408
407409 # Select a screening centre
408- page . get_by_label ( "Screening Centre" ). select_option (coventry_and_warwickshire_bcs_centre )
410+ set_patients_screening_centre_dropdown . select_option (tests_properties [ " coventry_and_warwickshire_bcs_centre" ] )
409411
410412 # Click "Generate Report"
411413 ReportsPage (page ).click_generate_report_button ()
@@ -421,18 +423,18 @@ def test_operational_reports_screening_practitioner_6_weeks_availability_not_set
421423 report_timestamp = DateTimeUtils .report_timestamp_date_format ()
422424 expect (report_generated_timestamp_element ).to_contain_text (report_timestamp )
423425
424-
425- def test_operational_reports_screening_practitioner_appointments (page : Page ) -> None :
426+ @ pytest . mark . only
427+ def test_operational_reports_screening_practitioner_appointments (page : Page , tests_properties : dict ) -> None :
426428 """
427429 Confirms 'screening_practitioner_appointments' page loads,
428430 a SC and Screening Practitioner can be selected
429431 the 'generate report' button works as expected and
430432 the timestamp updates to current date and time when refreshed
431433 """
432434
433- coventry_and_warwickshire_bcs_centre = "23643"
434- screening_practitioner_named_another_stubble = "1982"
435- generate_report_button = page .locator ("#submitThisForm" ) # The locator appears to be unique to this button
435+ set_patients_screening_centre_dropdown = page . get_by_label ( "Screening Centre" )
436+ screening_practitioner_dropdown = page . locator ( "#A_C_NURSE" )
437+ generate_report_button = page .locator ("#submitThisForm" ) # The locator appears to be unique to this generate report button
436438 report_timestamp_element = page .locator ("b" )
437439
438440 # Go to operational reports page
@@ -445,10 +447,10 @@ def test_operational_reports_screening_practitioner_appointments(page: Page) ->
445447 BasePage (page ).bowel_cancer_screening_ntsh_page_title_contains_text ("Screening Practitioner Appointments" )
446448
447449 # Select a screening centre
448- page . get_by_label ( "Screening Centre" ). select_option (coventry_and_warwickshire_bcs_centre )
450+ set_patients_screening_centre_dropdown . select_option (tests_properties [ " coventry_and_warwickshire_bcs_centre" ] )
449451
450452 # Select a screening practitioner
451- page . locator ( "#A_C_NURSE" ). select_option (screening_practitioner_named_another_stubble )
453+ screening_practitioner_dropdown . select_option (tests_properties [ " screening_practitioner_named_another_stubble" ] )
452454
453455 # Click "Generate Report"
454456 generate_report_button .click ()
0 commit comments