@@ -423,18 +423,13 @@ def test_update_existing_additional_care_note(
423423
424424
425425def test_remove_existing_additional_care_note (
426- page : Page ,
427- note_type_name : str = "Additional Care Note" ,
428- note_type_value : int = 4112 ,
429- note_status = 4100 ,
430- ) -> None :
426+ page : Page , general_properties : dict ) -> None :
431427 """
432428 Test to verify if an existing Additional Care note can be removed for a subject with one Additional Care note.
433429 """
434430 logging .info (
435431 "Starting test: Verify if an existing Additional Care note can be removed for a subject with one Additional Care note"
436432 )
437- logging .info ("Logging in as 'Team Leader at BCS01'." )
438433 # user login
439434 logging .info ("Logging in as 'Team Leader at BCS01'." )
440435 UserTools .user_login (page , "Team Leader at BCS01" )
@@ -444,22 +439,19 @@ def test_remove_existing_additional_care_note(
444439 BasePage (page ).go_to_screening_subject_search_page ()
445440
446441 # Search for the subject by NHS Number.")
447- subjects_df = get_subjects_by_note_count (note_type_value , note_status , 1 )
442+ subjects_df = get_subjects_by_note_count (general_properties [ "additional_care_note_type_value" ], general_properties [ "note_status_active" ] , 1 )
448443 nhs_no = subjects_df ["subject_nhs_number" ].iloc [0 ]
449444 SubjectScreeningPage (page ).fill_nhs_number (nhs_no )
450445 SubjectScreeningPage (page ).select_search_area_option ("07" )
451446 SubjectScreeningPage (page ).click_search_button ()
452447 # Verify subject has additional care notes present
453- logging .info ("Verified: Aadditional care notes are present for the subject." )
454- # logging.info("Verifying that additional care notes are present for the subject.")
455448 logging .info (
456449 f"Verifying that the Additional Care Note is visible for the subject with NHS Number: { nhs_no } ."
457450 )
458- SubjectScreeningSummaryPage (page ).verify_additional_care_note_visible ()
459- logging .info (
460- f"Clicking on the 'Additional Care Note' link for the subject with NHS Number: { nhs_no } ."
451+ SubjectScreeningSummaryPage (page ).verify_note_link_not_present (
452+ general_properties ["additional_care_note_name" ]
461453 )
462-
454+
463455 SubjectScreeningSummaryPage (page ).click_subjects_events_notes ()
464456 SubjectEventsNotes (page ).select_note_type (NotesOptions .ADDITIONAL_CARE_NOTE )
465457 logging .info (
@@ -474,15 +466,11 @@ def test_remove_existing_additional_care_note(
474466 screening_subject_id = int (subjects_df ["screening_subject_id" ].iloc [0 ])
475467 logging .info (f"Screening Subject ID retrieved: { screening_subject_id } " )
476468 type_id = int (subjects_df ["type_id" ].iloc [0 ])
477- # type_id = 4112 # Type ID for Additional Care Notes
478- # note_status = 4100 # Status ID for Active Notes
479- notes_df = get_supporting_notes (screening_subject_id , type_id , note_status )
480- # Filter the DataFrame to only include rows where type_id == 4112
481- filtered_notes_df = notes_df [notes_df ["type_id" ] == note_type_value ]
482- # Verify that the filtered DataFrame is empty
483- if not filtered_notes_df .empty :
469+ notes_df = get_supporting_notes (screening_subject_id , type_id ,general_properties ["note_status_active" ])
470+ # Verify that the DataFrame is not empty
471+ if not notes_df .empty :
484472 pytest .fail (
485- f"Subject has Additional Care Notes. Expected none, but found: { filtered_notes_df } "
473+ f"Subject has Additional Care Notes. Expected none, but found: { notes_df } "
486474 )
487475
488476 logging .info (
@@ -491,11 +479,7 @@ def test_remove_existing_additional_care_note(
491479
492480
493481def test_remove_existing_additional_care_note_for_subject_with_multiple_notes (
494- page : Page ,
495- note_type_name : str = "Additional Care Note" ,
496- note_type_value : int = 4112 ,
497- note_status = 4100 ,
498- note_status_obsolete = 4101 ,
482+ page : Page , general_properties : dict
499483) -> None :
500484 """
501485 Test to verify if an existing Additional Care note can be removed for a subject with multiple Additional Care notes.
@@ -512,10 +496,10 @@ def test_remove_existing_additional_care_note_for_subject_with_multiple_notes(
512496 BasePage (page ).go_to_screening_subject_search_page ()
513497
514498 # Get a subject with multiple additional care notes
515- subjects_df = get_subjects_with_multiple_notes (note_type_value )
499+ subjects_df = get_subjects_with_multiple_notes (general_properties [ "additional_care_note_type_value" ] )
516500 if subjects_df .empty :
517501 logging .info (
518- "No subjects found with multiple Additional Care Notes. Skipping test. "
502+ "No subjects found with multiple Additional Care Notes."
519503 )
520504 pytest .fail ("No subjects found with multiple Additional Care Notes." )
521505 nhs_no = subjects_df ["subject_nhs_number" ].iloc [0 ]
@@ -546,7 +530,7 @@ def test_remove_existing_additional_care_note_for_subject_with_multiple_notes(
546530 logging .info (f"Screening Subject ID retrieved: { screening_subject_id } " )
547531
548532 # Get the notes from the database
549- notes_df = get_supporting_notes (screening_subject_id , note_type_value , note_status )
533+ notes_df = get_supporting_notes (screening_subject_id , general_properties [ "additional_care_note_type_value" ], general_properties [ "note_status_active" ] )
550534 # Loop through the list of active notes and check if the removed note is still present
551535 logging .info (
552536 "Looping through active notes to verify the removed note is not present."
@@ -573,7 +557,7 @@ def test_remove_existing_additional_care_note_for_subject_with_multiple_notes(
573557
574558 # Get the notes from the database
575559 notes_df = get_supporting_notes (
576- screening_subject_id , note_type_value , note_status_obsolete
560+ screening_subject_id , general_properties [ "additional_care_note_type_value" ], general_properties [ " note_status_obsolete" ]
577561 )
578562 # Verify that the removed note is present among obsolete notes
579563 logging .info ("Verifying that the removed note is present among obsolete notes." )
0 commit comments