2121)
2222from pages .fit_test_kits .log_devices_page import LogDevicesPage
2323from pages .fit_test_kits .fit_test_kits_page import FITTestKitsPage
24-
25-
26- # Helper function to navigate to subject profile
27- def navigate_to_subject_summary_page (page , nhs_no : str ) -> None :
28- """
29- Navigates to the subject profile in the UI using the NHS number.
30-
31- Args:
32- page (Page): The Playwright page object.
33- nhs_no (str): The NHS number of the subject to search.
34- """
35- BasePage (page ).click_main_menu_link ()
36- BasePage (page ).go_to_screening_subject_search_page ()
37- screening_subject_page_searcher .search_subject_by_nhs_number (page , nhs_no )
38- logging .info (f"[SUBJECT VIEW] Subject { nhs_no } loaded in UI" )
39-
40-
41- # Helper function to navigate to active batch list
42- def navigate_to_active_batch_list (page : Page ) -> None :
43- """
44- Navigates to the active batch list page in the UI.
45-
46- Args:
47- page (Page): The Playwright page object.
48- """
49- BasePage (page ).click_main_menu_link ()
50- BasePage (page ).go_to_communications_production_page ()
51- CommunicationsProductionPage (page ).go_to_active_batch_list_page ()
24+ from pages .communication_production .batch_list_page import BatchListPage
5225
5326
5427# Helper function to log FIT kit
@@ -128,7 +101,7 @@ def test_scenario_2(page: Page) -> None:
128101 logging .info ("[DB ASSERTIONS COMPLETE] Created subject's details checked in the DB" )
129102
130103 # Navigate to subject summary page in UI
131- navigate_to_subject_summary_page (page , nhs_no )
104+ screening_subject_page_searcher . navigate_to_subject_summary_page (page , nhs_no )
132105 logging .info (f"[SUBJECT VIEW] Subject { nhs_no } loaded in UI" )
133106
134107 # Assert subject details in the UI
@@ -158,7 +131,7 @@ def test_scenario_2(page: Page) -> None:
158131 logging .info ("[DB ASSERTIONS COMPLETE]Updated subject details checked in the DB" )
159132
160133 # Navigate to subject summary page in UI
161- navigate_to_subject_summary_page (page , nhs_no )
134+ screening_subject_page_searcher . navigate_to_subject_summary_page (page , nhs_no )
162135 logging .info (f"[SUBJECT VIEW] Subject { nhs_no } loaded in UI" )
163136
164137 # Assert subject details in the UI
@@ -181,7 +154,7 @@ def test_scenario_2(page: Page) -> None:
181154 logging .info ("[DB ASSERTIONS COMPLETE] Updated subject details checked in the DB" )
182155
183156 # Then there is a "S1" letter batch for my subject with the exact title "Pre-invitation (FIT)"
184- navigate_to_active_batch_list (page )
157+ BatchListPage (page ). navigate_to_active_batch_list_page ( )
185158 ActiveBatchListPage (page ).is_batch_present ("S1 - Pre-invitation (FIT)" )
186159 logging .info ("[UI ASSERTIONS COMPLETE] S1 Letter batch exists" )
187160
@@ -191,15 +164,14 @@ def test_scenario_2(page: Page) -> None:
191164 page , "S1" , "Pre-invitation (FIT)" , "S9 - Pre-invitation Sent" , True
192165 )
193166 logging .info ("[DB ASSERTIONS COMPLETE] Updated subject status checked in the DB" )
167+ logging .info ("[UI ASSERTIONS COMPLETE] Updated subject details checked in the UI" )
194168
195169 # Navigate to subject summary page in UI
196170 # navigate_to_subject_summary_page(page, nhs_no)
197171 # logging.info(f"[SUBJECT VIEW] Subject {nhs_no} loaded in UI")
198172
199173 # Assert subject details in the UI
200174 # summary_page.assert_latest_event_status("S9 - Pre-invitation Sent")
201- # logging.info("[UI ASSERTIONS COMPLETE] Updated subject details checked in the UI")
202- # logging.info("[DEBUG TEST PASSED]")
203175
204176 # When I run Timed Events for my subject
205177 # nhs_df = pd.DataFrame(
@@ -248,7 +220,7 @@ def test_scenario_2(page: Page) -> None:
248220 logging .info ("[DB ASSERTIONS COMPLETE] Updated subject status checked in the DB" )
249221
250222 # Navigate to subject summary page in UI
251- navigate_to_subject_summary_page (page , nhs_no )
223+ screening_subject_page_searcher . navigate_to_subject_summary_page (page , nhs_no )
252224 logging .info (f"[SUBJECT VIEW] Subject { nhs_no } loaded in UI" )
253225
254226 # Assert subject details in the UI
@@ -270,15 +242,15 @@ def test_scenario_2(page: Page) -> None:
270242 logging .info ("[DB ASSERTIONS COMPLETE] Updated subject status checked in the DB" )
271243
272244 # Navigate to subject summary page in UI
273- navigate_to_subject_summary_page (page , nhs_no )
245+ screening_subject_page_searcher . navigate_to_subject_summary_page (page , nhs_no )
274246 logging .info (f"[SUBJECT VIEW] Subject { nhs_no } loaded in UI" )
275247
276248 # Assert subject details in the UI
277249 summary_page .assert_latest_event_status ("S2 - Normal" )
278250 logging .info ("[UI ASSERTIONS COMPLETE] Updated subject details checked in the UI" )
279251
280252 # And there is a "S2" letter batch for my subject with the exact title "Subject Result (Normal)"
281- navigate_to_active_batch_list (page )
253+ BatchListPage (page ). navigate_to_active_batch_list_page ( )
282254 ActiveBatchListPage (page ).is_batch_present ("S2 - Subject Result (Normal)" )
283255 logging .info ("[UI ASSERTIONS COMPLETE] S2 Letter batch exists" )
284256
@@ -302,15 +274,15 @@ def test_scenario_2(page: Page) -> None:
302274 # logging.info("[DB ASSERTIONS COMPLETE] Updated subject status checked in the DB")
303275
304276 # Navigate to subject summary page in UI
305- navigate_to_subject_summary_page (page , nhs_no )
277+ screening_subject_page_searcher . navigate_to_subject_summary_page (page , nhs_no )
306278 logging .info (f"[SUBJECT VIEW] Subject { nhs_no } loaded in UI" )
307279
308280 # Assert subject details in the UI
309281 summary_page .assert_latest_event_status ("S158 - Subject Discharge Sent (Normal)" )
310282 logging .info ("[UI ASSERTIONS COMPLETE] Updated subject details checked in the UI" )
311283
312284 # And there is a "S158" letter batch for my subject with the exact title "GP Result (Normal)"
313- navigate_to_active_batch_list (page )
285+ BatchListPage (page ). navigate_to_active_batch_list_page ( )
314286 ActiveBatchListPage (page ).is_batch_present ("S158 - GP Result (Normal)" )
315287 logging .info ("[UI ASSERTIONS COMPLETE] S158 Letter batch exists" )
316288
@@ -357,7 +329,7 @@ def test_scenario_2(page: Page) -> None:
357329 logging .info ("[DB ASSERTIONS COMPLETE] Updated subject details checked in the DB" )
358330
359331 # Navigate to subject summary page in UI
360- navigate_to_subject_summary_page (page , nhs_no )
332+ screening_subject_page_searcher . navigate_to_subject_summary_page (page , nhs_no )
361333 logging .info (f"[SUBJECT VIEW] Subject { nhs_no } loaded in UI" )
362334
363335 # Assert subject details in the UI
0 commit comments