1717from pages .screening_subject_search .record_diagnosis_date_page import (
1818 RecordDiagnosisDatePage ,
1919)
20+ from pages .screening_subject_search .diagnostic_test_outcome_page import (
21+ DiagnosticTestOutcomePage ,OutcomeOfDiagnosticTest
22+ )
2023from pages .datasets .investigation_dataset_page import (
2124 InvestigationDatasetsPage ,
2225 SiteLookupOptions ,
@@ -216,10 +219,9 @@ def after_high_risk_result(page: Page) -> None:
216219 AdvanceFOBTScreeningEpisodePage (page ).click_enter_diagnostic_test_outcome_button ()
217220
218221 # The following code is on the diagnostic test outcome page
219- expect (page .get_by_role ("cell" , name = "High-risk findings" ).nth (1 )).to_be_visible ()
220- page .get_by_label ("Outcome of Diagnostic Test" ).select_option ("20365" )
221- page .get_by_role ("button" , name = "Save" ).click ()
222-
222+ DiagnosticTestOutcomePage (page ).verify_diagnostic_test_outcome ("High-risk findings" )
223+ DiagnosticTestOutcomePage (page ).select_test_outcome_option (OutcomeOfDiagnosticTest .REFER_SURVEILLANCE )
224+ DiagnosticTestOutcomePage (page ).click_save_button ()
223225
224226def after_lnpcp_result (page : Page ) -> None :
225227 InvestigationDatasetsPage (page ).expect_text_to_be_visible ("LNPCP" )
@@ -235,10 +237,9 @@ def after_lnpcp_result(page: Page) -> None:
235237 AdvanceFOBTScreeningEpisodePage (page ).click_enter_diagnostic_test_outcome_button ()
236238
237239 # The following code is on the diagnostic test outcome page
238- expect (page .get_by_role ("cell" , name = "LNPCP" ).nth (1 )).to_be_visible ()
239- page .get_by_label ("Outcome of Diagnostic Test" ).select_option ("20365" )
240- page .get_by_role ("button" , name = "Save" ).click ()
241-
240+ DiagnosticTestOutcomePage (page ).verify_diagnostic_test_outcome ("LNPCP" )
241+ DiagnosticTestOutcomePage (page ).select_test_outcome_option (OutcomeOfDiagnosticTest .REFER_SURVEILLANCE )
242+ DiagnosticTestOutcomePage (page ).click_save_button ()
242243
243244def handover_subject_to_symptomatic_care (page : Page ) -> None :
244245 SubjectScreeningSummaryPage (page ).verify_latest_event_status_value (
@@ -247,7 +248,7 @@ def handover_subject_to_symptomatic_care(page: Page) -> None:
247248 SubjectScreeningSummaryPage (page ).click_advance_fobt_screening_episode_button ()
248249
249250 # The following code is on the advance fobt screening episode page
250- page . get_by_role ( "button" , name = "Handover into Symptomatic Care" ). click ()
251+ AdvanceFOBTScreeningEpisodePage ( page ). click_handover_into_symptomatic_care_button ()
251252
252253 # The following code is on the handover into symptomatic care page
253254 HandoverIntoSymptomaticCarePage (page ).select_referral_dropdown_option ("20445" )
@@ -281,7 +282,7 @@ def test_compartment_6(page: Page, smokescreen_properties: dict) -> None:
281282
282283 # This needs to be repeated for two subjects, one old and one not - High Risk Result
283284 # Older patient
284- nhs_no = "9577049095 "
285+ nhs_no = "9772286785 "
285286 go_to_investigation_datasets_page (page , nhs_no )
286287
287288 # The following code is on the investigation datasets page
@@ -296,7 +297,7 @@ def test_compartment_6(page: Page, smokescreen_properties: dict) -> None:
296297 handover_subject_to_symptomatic_care (page )
297298
298299 # Younger patient
299- nhs_no = "9567180636 "
300+ nhs_no = "9802397318 "
300301 go_to_investigation_datasets_page (page , nhs_no )
301302
302303 # The following code is on the investigation datasets page
@@ -326,7 +327,7 @@ def test_compartment_6(page: Page, smokescreen_properties: dict) -> None:
326327
327328 # This needs to be repeated for two subjects, one old and one not - LNPCP Result
328329 # Older patient
329- nhs_no = "9237051190 "
330+ nhs_no = "9359523194 "
330331 go_to_investigation_datasets_page (page , nhs_no )
331332
332333 # The following code is on the investigation datasets page
@@ -341,7 +342,7 @@ def test_compartment_6(page: Page, smokescreen_properties: dict) -> None:
341342 handover_subject_to_symptomatic_care (page )
342343
343344 # Younger patient
344- nhs_no = "9564243211 "
345+ nhs_no = "9828941813 "
345346 go_to_investigation_datasets_page (page , nhs_no )
346347
347348 # The following code is on the investigation datasets page
@@ -358,7 +359,7 @@ def test_compartment_6(page: Page, smokescreen_properties: dict) -> None:
358359 SubjectScreeningSummaryPage (page ).click_advance_fobt_screening_episode_button ()
359360
360361 # The following code is on the advance fobt screening episode page
361- page . get_by_role ( "button" , name = "Record Diagnosis Date" ). click ()
362+ AdvanceFOBTScreeningEpisodePage ( page ). click_record_diagnosis_date_button ()
362363
363364 # The following code is on the record diagnosis date page
364365 RecordDiagnosisDatePage (page ).enter_date_in_diagnosis_date_field (datetime .today ())
@@ -369,7 +370,7 @@ def test_compartment_6(page: Page, smokescreen_properties: dict) -> None:
369370 )
370371
371372 # This needs to be repeated for 1 subject, age does not matter - Normal Result
372- nhs_no_normal = "9648226105 "
373+ nhs_no_normal = "9852356488 "
373374 go_to_investigation_datasets_page (page , nhs_no_normal )
374375
375376 # The following code is on the investigation datasets page
@@ -396,11 +397,11 @@ def test_compartment_6(page: Page, smokescreen_properties: dict) -> None:
396397 AdvanceFOBTScreeningEpisodePage (page ).click_enter_diagnostic_test_outcome_button ()
397398
398399 # The following code is on the diagnostic test outcome page
399- expect (
400- page . get_by_role ( "cell" , name = " Normal (No Abnormalities"). nth ( 1 )
401- ). to_be_visible ()
402- page . get_by_label ( "Outcome of Diagnostic Test" ). select_option ( "20360" )
403- page . get_by_role ( "button" , name = "Save" ). click ()
400+ DiagnosticTestOutcomePage ( page ). verify_diagnostic_test_outcome (
401+ " Normal (No Abnormalities"
402+ )
403+ DiagnosticTestOutcomePage ( page ). select_test_outcome_option ( OutcomeOfDiagnosticTest . INVESTIGATION_COMPLETE )
404+ DiagnosticTestOutcomePage ( page ). click_save_button ()
404405
405406 SubjectScreeningSummaryPage (page ).verify_latest_event_status_value (
406407 "A318 - Post-investigation Appointment NOT Required - Result Letter Created"
0 commit comments