From 842574dc06b55ae937273f6da1a63a3524219137 Mon Sep 17 00:00:00 2001 From: "chinmay.mudholkar1@nhs.net" Date: Mon, 12 May 2025 14:46:08 +0100 Subject: [PATCH 1/2] MAV 853 updates --- libs/mavis_constants.py | 1 + pages/pg_children.py | 2 +- pages/pg_programmes.py | 3 --- test_data/cohorts/i_mav_853.csv | 2 ++ test_data/cohorts/o_mav_853.csv | 1 + test_data/file_mapping.csv | 1 + test_data/vaccs/i_mav_853.csv | 2 +- tests/test_07_children.py | 13 ++++++++++++- utils/001_cleanup.py | 2 +- 9 files changed, 20 insertions(+), 7 deletions(-) create mode 100644 test_data/cohorts/i_mav_853.csv create mode 100644 test_data/cohorts/o_mav_853.csv diff --git a/libs/mavis_constants.py b/libs/mavis_constants.py index c9d6136ab85..33835340b9a 100644 --- a/libs/mavis_constants.py +++ b/libs/mavis_constants.py @@ -105,6 +105,7 @@ class test_data_file_paths: COHORTS_FULL_NAME: Final[str] = "COHORTS_FULL_NAME" COHORTS_MAV_927_PERF: Final[str] = "COHORTS_MAV_927_PERF" COHORTS_MAV_909: Final[str] = "COHORTS_MAV_909" + COHORTS_MAV_853: Final[str] = "COHORTS_MAV_853" class report_headers: diff --git a/pages/pg_children.py b/pages/pg_children.py index 5d031c6482d..6bdae8874ad 100644 --- a/pages/pg_children.py +++ b/pages/pg_children.py @@ -24,7 +24,7 @@ class pg_children: LNK_CLEAR_FILTERS: Final[str] = "Clear filters" LNK_ACTIVITY_LOG: Final[str] = "Activity log" LNK_CHILD_RECORD: Final[str] = "Child record" - LNK_CHILD_MAV_853: Final[str] = "MAV_853, Mav_853" + LNK_CHILD_MAV_853: Final[str] = "MAV_853, MAV_853" LNK_VACCS_DETAILS_MAV_853: Final[str] = "Gardasil 9 (HPV)" LNK_CHILD_CHANGE_NHSNO: Final[str] = "CHANGENHSNO, CHANGENHSNO" LNK_EDIT_CHILD_RECORD: Final[str] = "Edit child record" diff --git a/pages/pg_programmes.py b/pages/pg_programmes.py index 2f15bbffcfa..fc2aaa58fcc 100644 --- a/pages/pg_programmes.py +++ b/pages/pg_programmes.py @@ -290,6 +290,3 @@ def verify_mav_909(self): locator=self.LBL_MAIN, property=element_properties.TEXT, expected_value=self.LBL_DUPLICATE_REVIEW_MESSAGE ) self.po.act(locator=self.LNK_REVIEW, action=framework_actions.CLICK_LINK) - self.po.verify( - locator=self.LBL_MAIN, property=element_properties.TEXT, expected_value="!Not provided" - ) # NHS number for Existing Record diff --git a/test_data/cohorts/i_mav_853.csv b/test_data/cohorts/i_mav_853.csv new file mode 100644 index 00000000000..8587201afe5 --- /dev/null +++ b/test_data/cohorts/i_mav_853.csv @@ -0,0 +1,2 @@ +CHILD_FIRST_NAME,CHILD_LAST_NAME,CHILD_COMMON_NAME,CHILD_DATE_OF_BIRTH,CHILD_SCHOOL_URN,CHILD_NHS_NUMBER,CHILD_ADDRESS_LINE_1,CHILD_ADDRESS_LINE_2,CHILD_TOWN,CHILD_POSTCODE,PARENT_1_NAME,PARENT_1_RELATIONSHIP,PARENT_1_EMAIL,PARENT_1_PHONE,PARENT_2_NAME,PARENT_2_RELATIONSHIP,PARENT_2_EMAIL,PARENT_2_PHONE,CHILD_YEAR_GROUP +MAV_853,MAV_853,,2009-01-09,<>,9755237070,Addr1,Add2,City,AA1 1AA,Parent1,Dad,dad1@example.com,,Parent2,Mum,mum1@example.com,,9 diff --git a/test_data/cohorts/o_mav_853.csv b/test_data/cohorts/o_mav_853.csv new file mode 100644 index 00000000000..2e55e42df6b --- /dev/null +++ b/test_data/cohorts/o_mav_853.csv @@ -0,0 +1 @@ +1 child diff --git a/test_data/file_mapping.csv b/test_data/file_mapping.csv index f77b5b65c0f..475525655bc 100644 --- a/test_data/file_mapping.csv +++ b/test_data/file_mapping.csv @@ -45,5 +45,6 @@ COHORTS_CONFLICTING_GILLICK,test_data/cohorts/i_conflicting_gillick.csv,test_dat COHORTS_FULL_NAME,test_data/cohorts/i_full_name.csv,test_data/cohorts/o_full_name.csv,cohortfullname COHORTS_MAV_927_PERF,test_data/cohorts/i_mav_927_perf.csv,test_data/cohorts/o_mav_927_perf.csv,cohortmav927perf COHORTS_MAV_909,test_data/cohorts/i_mav_909.csv,test_data/cohorts/o_mav_909.csv,cohortmav909 +COHORTS_MAV_853,test_data/cohorts/i_mav_853.csv,test_data/cohorts/o_mav_853.csv,cohortmav853 CLASS_MOVES_CONFIRM_IGNORE,test_data/class_list/i_moves_1.csv,test_data/class_list/o_moves_1.csv,classmoves1 CLASS_MOVES_UNKNOWN_HOMESCHOOLED,test_data/class_list/i_moves_2.csv,test_data/class_list/o_moves_2.csv,classmoves2 diff --git a/test_data/vaccs/i_mav_853.csv b/test_data/vaccs/i_mav_853.csv index 1f84a9ae8a7..6d9afe15376 100644 --- a/test_data/vaccs/i_mav_853.csv +++ b/test_data/vaccs/i_mav_853.csv @@ -1,2 +1,2 @@ TEST_DESC_IGNORED,ORGANISATION_CODE,SCHOOL_URN,SCHOOL_NAME,NHS_NUMBER,PERSON_FORENAME,PERSON_SURNAME,PERSON_DOB,PERSON_GENDER_CODE,PERSON_POSTCODE,DATE_OF_VACCINATION,VACCINE_GIVEN,BATCH_NUMBER,BATCH_EXPIRY_DATE,ANATOMICAL_SITE,DOSE_SEQUENCE,VACCINATED,CARE_SETTING,PERFORMING_PROFESSIONAL_FORENAME,PERFORMING_PROFESSIONAL_SURNAME,PERFORMING_PROFESSIONAL_EMAIL,CLINIC_NAME,TIME_OF_VACCINATION,REASON_NOT_VACCINATED,SESSION_ID,PROGRAMME -P_HPV_Gardasil9,<>,<>,<>,<>,Mav_853,MAV_853,2010-08-12,Male,DN9 1PB,<>,Gardasil9,AutoBatch1,20301231,Left Thigh,1,Y,1,,,nurse.joy@example.com,Clinic,00:01,,<>,HPV +P_HPV_Gardasil9,<>,<>,<>,9755237070,MAV_853,MAV_853,2009-01-09,Male,DN9 1PB,<>,Gardasil9,AutoBatch1,20301231,Left Thigh,1,Y,1,,,nurse.joy@example.com,Clinic,00:01,,<>,HPV diff --git a/tests/test_07_children.py b/tests/test_07_children.py index dc59a4920c0..303e7af411a 100644 --- a/tests/test_07_children.py +++ b/tests/test_07_children.py @@ -2,7 +2,14 @@ from libs.generic_constants import fixture_scope from libs.mavis_constants import test_data_file_paths -from pages import pg_children, pg_dashboard, pg_import_records, pg_login, pg_sessions +from pages import ( + pg_children, + pg_dashboard, + pg_import_records, + pg_login, + pg_programmes, + pg_sessions, +) class Test_Children: @@ -11,6 +18,7 @@ class Test_Children: children_page = pg_children.pg_children() sessions_page = pg_sessions.pg_sessions() import_records_page = pg_import_records.pg_import_records() + programmes_page = pg_programmes.pg_programmes() @pytest.fixture(scope=fixture_scope.FUNCTION, autouse=False) def setup_tests(self, start_mavis: None): @@ -63,6 +71,9 @@ def setup_mav_853(self, setup_tests: None): self.sessions_page.click_school1() self.sessions_page.save_session_id_from_offline_excel() self.dashboard_page.go_to_dashboard() + self.dashboard_page.click_programmes() + self.programmes_page.upload_cohorts(file_paths=test_data_file_paths.COHORTS_MAV_853) + self.dashboard_page.go_to_dashboard() self.dashboard_page.click_import_records() self.import_records_page.click_import_records() self.import_records_page.import_vaccination_records(file_paths=test_data_file_paths.VACCS_MAV_853) diff --git a/utils/001_cleanup.py b/utils/001_cleanup.py index 12b0ede52a7..f83565e26b4 100644 --- a/utils/001_cleanup.py +++ b/utils/001_cleanup.py @@ -1,6 +1,6 @@ import os -# This script is to be used manually before any commits in new code to avoid committing any reports or working files. +# This script is designed to be run manually to clear down the 'working', 'reports' and 'screenshots' directories. folders_to_clean = ["working", "reports", "screenshots"] From 36bef3db5a80f6db9a5caf9ab51aeb2eed79da80 Mon Sep 17 00:00:00 2001 From: "chinmay.mudholkar1@nhs.net" Date: Mon, 12 May 2025 16:54:13 +0100 Subject: [PATCH 2/2] MAV_909 updates --- pages/pg_programmes.py | 29 +++++++++++++++++++++++++++++ test_data/cohorts/i_mav_909.csv | 2 +- tests/test_05_programmes.py | 1 - 3 files changed, 30 insertions(+), 2 deletions(-) diff --git a/pages/pg_programmes.py b/pages/pg_programmes.py index fc2aaa58fcc..d7736cae541 100644 --- a/pages/pg_programmes.py +++ b/pages/pg_programmes.py @@ -62,6 +62,11 @@ class pg_programmes: RDO_REPORT_SYSTMONE: Final[str] = "SystmOne" LBL_DUPLICATE_REVIEW_MESSAGE: Final[str] = "1 duplicate record needs review" LNK_REVIEW: Final[str] = "Review" + RDO_USE_DUPLICATE: Final[str] = "Use duplicate record" + RDO_KEEP_EXISTING: Final[str] = "Keep previously uploaded record" + RDO_KEEP_BOTH: Final[str] = "Keep both records" + BTN_RESOLVE_DUPLICATE: Final[str] = "Resolve duplicate" + LBL_RECORD_UPDATED: Final[str] = "Record updated" def click_hpv(self): self.po.act(locator=self.LNK_HPV, action=framework_actions.CLICK_LINK) @@ -280,6 +285,27 @@ def verify_mav_965(self): self.sessions_page.record_vaccs_for_child(child_name=self.LNK_MAV_965_CHILD, programme_name=programmes.TDIPV) def verify_mav_909(self): + """ + Steps to reproduce: + Find a patient in Year 8 and remove them from cohort using the button + Upload a cohort list with their first name, surname, URN, date of birth and postcode + + Scenario 1 + Duplicate review is not flagged + + Expected result: + The child is added back into the cohort, and in all the relevant sessions + Actual Result: + Server error page and user cannot bring the child back into the cohort + + Scenario 2 + The import screen flags for duplicate review, and user clicks "Review" next to the child's name + + Expected result: + System allows you to review the new details against the previous record (before removing from cohort) and lets you choose which record to keep. Once review confirmed, the child is added back into the cohort, and in all the relevant sessions. + Actual Result: + Server error page and user cannot bring the child back into the cohort + """ self.dashboard_page.go_to_dashboard() self.dashboard_page.click_children() self.children_page.remove_child_from_cohort(child_name=self.LNK_MAV_909_CHILD) @@ -290,3 +316,6 @@ def verify_mav_909(self): locator=self.LBL_MAIN, property=element_properties.TEXT, expected_value=self.LBL_DUPLICATE_REVIEW_MESSAGE ) self.po.act(locator=self.LNK_REVIEW, action=framework_actions.CLICK_LINK) + self.po.act(locator=self.RDO_USE_DUPLICATE, action=framework_actions.RADIO_BUTTON_SELECT) + self.po.act(locator=self.BTN_RESOLVE_DUPLICATE, action=framework_actions.CLICK_BUTTON) + self.po.verify(locator=self.LBL_MAIN, property=element_properties.TEXT, expected_value=self.LBL_RECORD_UPDATED) diff --git a/test_data/cohorts/i_mav_909.csv b/test_data/cohorts/i_mav_909.csv index 3fe423afb38..1a40c580ce7 100644 --- a/test_data/cohorts/i_mav_909.csv +++ b/test_data/cohorts/i_mav_909.csv @@ -1,2 +1,2 @@ CHILD_FIRST_NAME,CHILD_LAST_NAME,CHILD_COMMON_NAME,CHILD_DATE_OF_BIRTH,CHILD_SCHOOL_URN,CHILD_NHS_NUMBER,CHILD_ADDRESS_LINE_1,CHILD_ADDRESS_LINE_2,CHILD_TOWN,CHILD_POSTCODE,PARENT_1_NAME,PARENT_1_RELATIONSHIP,PARENT_1_EMAIL,PARENT_1_PHONE,PARENT_2_NAME,PARENT_2_RELATIONSHIP,PARENT_2_EMAIL,PARENT_2_PHONE,CHILD_YEAR_GROUP -MAV_909,MAV_909,,20111221,<>,<>,Addr1,Add2,City,AA1 1AA,Parent1,Dad,dad1@example.com,,Parent2,Mum,mum1@example.com,,8 +MAV_909,MAV_909,,<>,<>,,Addr1,Add2,City,AA1 1AA,Parent1,Dad,dad1@example.com,,Parent2,Mum,mum1@example.com,,8 diff --git a/tests/test_05_programmes.py b/tests/test_05_programmes.py index 1c090ba2a3b..0f1e8c61c94 100644 --- a/tests/test_05_programmes.py +++ b/tests/test_05_programmes.py @@ -137,7 +137,6 @@ def test_cohorts_empty_file(self, setup_cohort_upload_and_reports): @pytest.mark.cohorts @pytest.mark.order(506) - # @pytest.mark.skip(reason="Test under construction") def test_cohorts_readd_to_cohort(self, setup_cohort_upload_and_reports): # MAV-909 self.programmes_page.upload_cohorts(file_paths=test_data_file_paths.COHORTS_MAV_909) self.programmes_page.verify_mav_909()