11import pytest
22from playwright .sync_api import Page , expect
3- from sys import platform
43from pages .base_page import BasePage
54from pages .reports .reports_page import ReportsPage
65from utils .date_time_utils import DateTimeUtils
76from utils .user_tools import UserTools
8- from jproperties import Properties
7+ from utils . load_properties_file import PropertiesFile
98
109
1110@pytest .fixture
12- def tests_properties () -> dict :
13- """
14- Reads the 'bcss_tests.properties' file and populates a 'Properties' object.
15- Returns a dictionary of properties for use in tests.
16-
17- Returns:
18- dict: A dictionary containing the values loaded from the 'bcss_tests.properties' file.
19- """
20- configs = Properties ()
21- if platform == "win32" : # File path from content root is required on Windows OS
22- with open ("tests/bcss_tests.properties" , "rb" ) as read_prop :
23- configs .load (read_prop )
24- elif platform == "darwin" : # Only the filename is required on macOS
25- with open ("bcss_tests.properties" , "rb" ) as read_prop :
26- configs .load (read_prop )
27- return configs .properties
11+ def smokescreen_properties () -> dict :
12+ properties = PropertiesFile ().smokescreen_properties ("smoke" )
13+ return properties
2814
2915
3016@pytest .fixture (scope = "function" , autouse = True )
@@ -204,7 +190,7 @@ def test_failsafe_reports_subjects_ceased_due_to_date_of_birth_changes(
204190
205191
206192def test_failsafe_reports_allocate_sc_for_patient_movements_within_hub_boundaries (
207- page : Page , tests_properties : dict
193+ page : Page , smokescreen_properties : dict
208194) -> None :
209195 """
210196 Confirms 'allocate_sc_for_patient_movements_within_hub_boundaries' page loads,
@@ -247,15 +233,15 @@ def test_failsafe_reports_allocate_sc_for_patient_movements_within_hub_boundarie
247233
248234 # Select another screening centre
249235 set_patients_screening_centre_dropdown .select_option (
250- tests_properties ["coventry_and_warwickshire_bcs_centre" ]
236+ smokescreen_properties ["coventry_and_warwickshire_bcs_centre" ]
251237 )
252238
253239 # Click update
254240 failsafe_report_page .click_reports_pages_update_button ()
255241
256242 # Verify new screening centre has saved
257243 expect (ReportsPage (page ).set_patients_screening_centre_dropdown ).to_have_value (
258- tests_properties ["coventry_and_warwickshire_bcs_centre" ]
244+ smokescreen_properties ["coventry_and_warwickshire_bcs_centre" ]
259245 )
260246
261247
@@ -346,7 +332,7 @@ def test_failsafe_reports_identify_and_link_new_gp(page: Page) -> None:
346332
347333# Operational Reports
348334def test_operational_reports_appointment_attendance_not_updated (
349- page : Page , tests_properties : dict
335+ page : Page , smokescreen_properties : dict
350336) -> None :
351337 """
352338 Confirms 'appointment_attendance_not_updated' page loads,
@@ -375,7 +361,7 @@ def test_operational_reports_appointment_attendance_not_updated(
375361
376362 # Select a screening centre from the drop-down options
377363 set_patients_screening_centre_dropdown .select_option (
378- tests_properties ["coventry_and_warwickshire_bcs_centre" ]
364+ smokescreen_properties ["coventry_and_warwickshire_bcs_centre" ]
379365 )
380366
381367 # Click "Generate Report" button
@@ -447,7 +433,7 @@ def test_operational_reports_demographic_update_inconsistent_with_manual_update(
447433
448434
449435def test_operational_reports_screening_practitioner_6_weeks_availability_not_set_up (
450- page : Page , tests_properties : dict
436+ page : Page , smokescreen_properties : dict
451437) -> None :
452438 """
453439 Confirms 'screening_practitioner_6_weeks_availability_not_set_up_report' page loads,
@@ -474,7 +460,7 @@ def test_operational_reports_screening_practitioner_6_weeks_availability_not_set
474460
475461 # Select a screening centre
476462 set_patients_screening_centre_dropdown .select_option (
477- tests_properties ["coventry_and_warwickshire_bcs_centre" ]
463+ smokescreen_properties ["coventry_and_warwickshire_bcs_centre" ]
478464 )
479465
480466 # Click "Generate Report"
@@ -494,7 +480,7 @@ def test_operational_reports_screening_practitioner_6_weeks_availability_not_set
494480
495481@pytest .mark .only
496482def test_operational_reports_screening_practitioner_appointments (
497- page : Page , tests_properties : dict
483+ page : Page , smokescreen_properties : dict
498484) -> None :
499485 """
500486 Confirms 'screening_practitioner_appointments' page loads,
@@ -523,12 +509,12 @@ def test_operational_reports_screening_practitioner_appointments(
523509
524510 # Select a screening centre
525511 set_patients_screening_centre_dropdown .select_option (
526- tests_properties ["coventry_and_warwickshire_bcs_centre" ]
512+ smokescreen_properties ["coventry_and_warwickshire_bcs_centre" ]
527513 )
528514
529515 # Select a screening practitioner
530516 screening_practitioner_dropdown .select_option (
531- tests_properties ["screening_practitioner_named_another_stubble" ]
517+ smokescreen_properties ["screening_practitioner_named_another_stubble" ]
532518 )
533519
534520 # Click "Generate Report"
0 commit comments