@@ -116,29 +116,34 @@ def subjects_to_run_for(request: FixtureRequest) -> int:
116116
117117
118118@pytest .fixture (scope = "function" )
119- def setup_org_and_appointments (page : Page , request : FixtureRequest ) -> None :
119+ def setup_org_and_appointments (
120+ page : Page , request : FixtureRequest , general_properties : dict
121+ ) -> None :
120122 """
121123 Ensures required org parameters and appointments are set up.
122124 Only runs once per day per environment, regardless of which test calls it.
123125
124126 This fixture is designed to be used in tests that require a specific setup of the organisation and appointments.
127+
125128 Example usage:
126- @pytest.mark.usefixtures("setup_org_and_appointments")
127- def test_my_function(page: Page):
128- # Your test code here
129129
130- def test_my_function(page: Page, setup_org_and_appointments):
131- # Your test code here
130+ @pytest.mark.usefixtures("setup_org_and_appointments")
131+ def test_my_function(page: Page):
132+ # Your test code here
133+
134+ def test_my_function(page: Page, setup_org_and_appointments):
135+ # Your test code here
132136 """
133- param_12_set_correctly = check_parameter (12 , "23162" , "10" )
134- param_28_set_correctly = check_parameter (28 , "23162" , "07:00" )
135- param_29_set_correctly = check_parameter (29 , "23162" , "20:00" )
137+ org_id = general_properties ["eng_screening_centre_id" ]
138+ param_12_set_correctly = check_parameter (12 , org_id , "10" )
139+ param_28_set_correctly = check_parameter (28 , org_id , "07:00" )
140+ param_29_set_correctly = check_parameter (29 , org_id , "20:00" )
136141 if not param_12_set_correctly :
137- set_org_parameter_value (12 , "10" , "23162" )
142+ set_org_parameter_value (12 , "10" , org_id )
138143 if not param_28_set_correctly :
139- set_org_parameter_value (28 , "07:00" , "23162" )
144+ set_org_parameter_value (28 , "07:00" , org_id )
140145 if not param_29_set_correctly :
141- set_org_parameter_value (29 , "20:00" , "23162" )
146+ set_org_parameter_value (29 , "20:00" , org_id )
142147
143148 base_url = request .config .getoption ("--base-url" )
144149 fixture_name = "setup_org_and_appointments"
0 commit comments