5555 SubjectScreeningSummaryPage ,
5656)
5757from pages .logout .log_out_page import LogoutPage
58- from pages .base_page import BasePage
5958from pages .screening_subject_search .advance_fobt_screening_episode_page import (
6059 AdvanceFOBTScreeningEpisodePage ,
6160)
@@ -172,11 +171,11 @@ def test_scenario_8(page: Page) -> None:
172171 # When I process the open "S9" letter batch for my subject
173172 # Then my subject has been updated as follows:
174173 batch_processing (
175- page ,
176- "S9" ,
177- "Invitation & Test Kit (FIT)" ,
178- "S10 - Invitation & Test Kit Sent" ,
179- True ,
174+ page = page ,
175+ batch_type = "S9" ,
176+ batch_description = "Invitation & Test Kit (FIT)" ,
177+ latest_event_status = "S10 - Invitation & Test Kit Sent" ,
178+ run_timed_events = True ,
180179 )
181180
182181 # When I log my subject's latest unlogged FIT kit
@@ -223,22 +222,22 @@ def test_scenario_8(page: Page) -> None:
223222 # When I process the open "A183 - Practitioner Clinic 1st Appointment" letter batch for my subject
224223 # Then my subject has been updated as follows:
225224 batch_processing (
226- page ,
227- "A183" ,
228- "Practitioner Clinic 1st Appointment" ,
229- "A25 - 1st Colonoscopy Assessment Appointment Booked, letter sent" ,
225+ page = page ,
226+ batch_type = "A183" ,
227+ batch_description = "Practitioner Clinic 1st Appointment" ,
228+ latest_event_status = "A25 - 1st Colonoscopy Assessment Appointment Booked, letter sent" ,
230229 )
231230
232231 # And there is a "A183" letter batch for my subject with the exact title "GP Result (Abnormal)"
233232 batch_processing (
234- page ,
235- "A183" ,
236- "GP Result (Abnormal)" ,
237- "A25 - 1st Colonoscopy Assessment Appointment Booked, letter sent" ,
233+ page = page ,
234+ batch_type = "A183" ,
235+ batch_description = "GP Result (Abnormal)" ,
236+ latest_event_status = "A25 - 1st Colonoscopy Assessment Appointment Booked, letter sent" ,
238237 )
239238
240239 # When I switch users to BCSS "England" as user role "Screening Centre Manager"
241- switch_user (page , "Screening Centre Manager" )
240+ UserTools . switch_user (page , "Screening Centre Manager" )
242241
243242 # When I view the subject
244243 screening_subject_page_searcher .navigate_to_subject_summary_page (page , nhs_no )
@@ -310,7 +309,7 @@ def test_scenario_8(page: Page) -> None:
310309 subject_assertion (nhs_no , criteria )
311310
312311 # When I switch users to BCSS "England" as user role "Hub Manager"
313- switch_user (page , "Hub Manager" , "BCS01" )
312+ UserTools . switch_user (page , "Hub Manager" , "BCS01" )
314313
315314 # And I process the open "A183 - GP Result (Abnormal)" letter batch for my subject
316315 # NOTE LEAVE COMMENTED - Subject is already at A172 DNA Diagnostic Test (line 313)
@@ -328,7 +327,9 @@ def test_scenario_8(page: Page) -> None:
328327 # subject_assertion(nhs_no, criteria)
329328
330329 # When I switch users to BCSS "England" as user role "Screening Centre Manager" (and remember session)
331- user_role = switch_user (page , "Screening Centre Manager" , remember_user = True )
330+ user_role = UserTools .switch_user (
331+ page , "Screening Centre Manager" , remember_user = True
332+ )
332333
333334 # And I view the subject
334335 screening_subject_page_searcher .navigate_to_subject_summary_page (page , nhs_no )
@@ -371,19 +372,19 @@ def test_scenario_8(page: Page) -> None:
371372 # When I process the open "A397" letter batch for my subject
372373 # Then my subject has been updated as follows:
373374 batch_processing (
374- page ,
375- "A397" ,
376- "Discharge from screening round - no contact (letter to patient)" ,
377- "A391 - Patient Discharge Letter Printed - No Patient Contact" ,
375+ page = page ,
376+ batch_type = "A397" ,
377+ batch_description = "Discharge from screening round - no contact (letter to patient)" ,
378+ latest_event_status = "A391 - Patient Discharge Letter Printed - No Patient Contact" ,
378379 )
379380
380381 # And there is a "A391" letter batch for my subject with the exact title "Discharge from screening round - no contact (letter to GP)"
381382 # When I process the open "A391 - Discharge from screening round - no contact (letter to GP)" letter batch for my subject
382383 batch_processing (
383- page ,
384- "A391" ,
385- "Discharge from screening round - no contact (letter to GP)" ,
386- "A351 - GP Discharge Letter Printed - No Patient Contact" ,
384+ page = page ,
385+ batch_type = "A391" ,
386+ batch_description = "Discharge from screening round - no contact (letter to GP)" ,
387+ latest_event_status = "A351 - GP Discharge Letter Printed - No Patient Contact" ,
387388 )
388389
389390 # Then my subject has been updated as follows:
@@ -419,7 +420,7 @@ def test_scenario_8(page: Page) -> None:
419420 screening_subject_page_searcher .navigate_to_subject_summary_page (page , nhs_no )
420421
421422 # And I reopen the subject's episode for "Reopen to Reschedule Diagnostic Test"
422- # SubjectScreeningSummaryPage(page).click_reopen_fobt_screening_episode_button()
423+ SubjectScreeningSummaryPage (page ).click_reopen_fobt_screening_episode_button ()
423424 ReopenFOBTScreeningEpisodePage (
424425 page
425426 ).click_reopen_to_reschedule_diagnostic_test_button ()
@@ -632,7 +633,9 @@ def test_scenario_8(page: Page) -> None:
632633
633634 # And I set the practitioner appointment date to "today"
634635 # And I book the earliest available post investigation appointment on this date
635- book_post_investigation_appointment (page , "The Royal Hospital (Wolverhampton)" , 1 )
636+ book_post_investigation_appointment (
637+ page , "The Royal Hospital (Wolverhampton)" , 1 , "12:00"
638+ )
636639
637640 # Then my subject has been updated as follows:
638641 criteria = {
@@ -645,10 +648,10 @@ def test_scenario_8(page: Page) -> None:
645648 # Then my subject has been updated as follows:
646649 # | Latest event status | A415 Post-investigation Appointment Invitation Letter Printed |
647650 batch_processing (
648- page ,
649- "A410" ,
650- "Post-Investigation Appointment Invitation Letter" ,
651- "A415 - Post-investigation Appointment Invitation Letter Printed" ,
651+ page = page ,
652+ batch_type = "A410" ,
653+ batch_description = "Post-Investigation Appointment Invitation Letter" ,
654+ latest_event_status = "A415 - Post-investigation Appointment Invitation Letter Printed" ,
652655 )
653656
654657 # When I view the subject
@@ -681,10 +684,10 @@ def test_scenario_8(page: Page) -> None:
681684 # Then my subject has been updated as follows:
682685 # | Latest event status | A395 Refer Another Diagnostic Test |
683686 batch_processing (
684- page ,
685- "A430" ,
686- "Result Letters Following Post-investigation Appointment" ,
687- "A395 - Refer Another Diagnostic Test" ,
687+ page = page ,
688+ batch_type = "A430" ,
689+ batch_description = "Result Letters Following Post-investigation Appointment" ,
690+ latest_event_status = "A395 - Refer Another Diagnostic Test" ,
688691 )
689692
690693 # When I view the subject
@@ -919,10 +922,10 @@ def test_scenario_8(page: Page) -> None:
919922 # # When I process the open "A318" letter batch for my subject
920923 # # Then my subject has been updated as follows:
921924 batch_processing (
922- page ,
923- "A318" ,
924- "Result Letters - No Post-investigation Appointment" ,
925- "A380 - Failed Diagnostic Test - Refer Another" ,
925+ page = page ,
926+ batch_type = "A318" ,
927+ batch_description = "Result Letters - No Post-investigation Appointment" ,
928+ latest_event_status = "A380 - Failed Diagnostic Test - Refer Another" ,
926929 )
927930
928931 # When I view the subject
@@ -945,10 +948,10 @@ def test_scenario_8(page: Page) -> None:
945948 # # When I process the open "A397" letter batch for my subject
946949 # # Then my subject has been updated as follows:
947950 batch_processing (
948- page ,
949- "A397" ,
950- "Discharge from screening round - no contact (letter to patient)" ,
951- "A391 - Patient Discharge Letter Printed - No Patient Contact" ,
951+ page = page ,
952+ batch_type = "A397" ,
953+ batch_description = "Discharge from screening round - no contact (letter to patient)" ,
954+ latest_event_status = "A391 - Patient Discharge Letter Printed - No Patient Contact" ,
952955 )
953956
954957 # # When I receive an SSPI update to change their date of birth to "73" years old
@@ -963,10 +966,10 @@ def test_scenario_8(page: Page) -> None:
963966 # And there is a "A391" letter batch for my subject with the exact title "Discharge from screening round - no contact (letter to GP)"
964967 # When I process the open "A391 - Discharge from screening round - no contact (letter to GP)" letter batch for my subject
965968 batch_processing (
966- page ,
967- "A391" ,
968- "Discharge from screening round - no contact (letter to GP)" ,
969- "A351 - GP Discharge Letter Printed - No Patient Contact" ,
969+ page = page ,
970+ batch_type = "A391" ,
971+ batch_description = "Discharge from screening round - no contact (letter to GP)" ,
972+ latest_event_status = "A351 - GP Discharge Letter Printed - No Patient Contact" ,
970973 )
971974
972975 # Then my subject has been updated as follows:
@@ -1000,20 +1003,4 @@ def test_scenario_8(page: Page) -> None:
10001003 }
10011004 subject_assertion (nhs_no , criteria , user_role )
10021005
1003-
1004- # Helper Methods
1005- def switch_user (
1006- page , role : str , bcss_code : str = "BCS001" , remember_user : bool = False
1007- ):
1008- """
1009- Logs out the current user, navigates to the login page, and logs in as the specified role.
1010-
1011- Args:
1012- page: Playwright page object.
1013- role (str): The user role to log in as (e.g., "Screening Centre Manager").
1014- bcss_code (str): The BCSS code to use in the login string (default is "BCS001").
1015- remember_user (bool): Whether to remember the user session (default is False).
1016- """
1017- LogoutPage (page ).log_out (close_page = False )
1018- BasePage (page ).go_to_log_in_page ()
1019- return UserTools .user_login (page , f"{ role } at { bcss_code } " , remember_user )
1006+ LogoutPage (page ).log_out ()
0 commit comments