Skip to content

Commit 07b4d8b

Browse files
C20250512 (#144)
* MAV 853 updates * MAV_909 updates
1 parent f6b91fc commit 07b4d8b

File tree

11 files changed

+50
-9
lines changed

11 files changed

+50
-9
lines changed

libs/mavis_constants.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ class test_data_file_paths:
105105
COHORTS_FULL_NAME: Final[str] = "COHORTS_FULL_NAME"
106106
COHORTS_MAV_927_PERF: Final[str] = "COHORTS_MAV_927_PERF"
107107
COHORTS_MAV_909: Final[str] = "COHORTS_MAV_909"
108+
COHORTS_MAV_853: Final[str] = "COHORTS_MAV_853"
108109

109110

110111
class report_headers:

pages/pg_children.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class pg_children:
2424
LNK_CLEAR_FILTERS: Final[str] = "Clear filters"
2525
LNK_ACTIVITY_LOG: Final[str] = "Activity log"
2626
LNK_CHILD_RECORD: Final[str] = "Child record"
27-
LNK_CHILD_MAV_853: Final[str] = "MAV_853, Mav_853"
27+
LNK_CHILD_MAV_853: Final[str] = "MAV_853, MAV_853"
2828
LNK_VACCS_DETAILS_MAV_853: Final[str] = "Gardasil 9 (HPV)"
2929
LNK_CHILD_CHANGE_NHSNO: Final[str] = "CHANGENHSNO, CHANGENHSNO"
3030
LNK_EDIT_CHILD_RECORD: Final[str] = "Edit child record"

pages/pg_programmes.py

Lines changed: 29 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,11 @@ class pg_programmes:
6262
RDO_REPORT_SYSTMONE: Final[str] = "SystmOne"
6363
LBL_DUPLICATE_REVIEW_MESSAGE: Final[str] = "1 duplicate record needs review"
6464
LNK_REVIEW: Final[str] = "Review"
65+
RDO_USE_DUPLICATE: Final[str] = "Use duplicate record"
66+
RDO_KEEP_EXISTING: Final[str] = "Keep previously uploaded record"
67+
RDO_KEEP_BOTH: Final[str] = "Keep both records"
68+
BTN_RESOLVE_DUPLICATE: Final[str] = "Resolve duplicate"
69+
LBL_RECORD_UPDATED: Final[str] = "Record updated"
6570

6671
def click_hpv(self):
6772
self.po.act(locator=self.LNK_HPV, action=framework_actions.CLICK_LINK)
@@ -280,6 +285,27 @@ def verify_mav_965(self):
280285
self.sessions_page.record_vaccs_for_child(child_name=self.LNK_MAV_965_CHILD, programme_name=programmes.TDIPV)
281286

282287
def verify_mav_909(self):
288+
"""
289+
Steps to reproduce:
290+
Find a patient in Year 8 and remove them from cohort using the button
291+
Upload a cohort list with their first name, surname, URN, date of birth and postcode
292+
293+
Scenario 1
294+
Duplicate review is not flagged
295+
296+
Expected result:
297+
The child is added back into the cohort, and in all the relevant sessions
298+
Actual Result:
299+
Server error page and user cannot bring the child back into the cohort
300+
301+
Scenario 2
302+
The import screen flags for duplicate review, and user clicks "Review" next to the child's name
303+
304+
Expected result:
305+
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.
306+
Actual Result:
307+
Server error page and user cannot bring the child back into the cohort
308+
"""
283309
self.dashboard_page.go_to_dashboard()
284310
self.dashboard_page.click_children()
285311
self.children_page.remove_child_from_cohort(child_name=self.LNK_MAV_909_CHILD)
@@ -290,6 +316,6 @@ def verify_mav_909(self):
290316
locator=self.LBL_MAIN, property=element_properties.TEXT, expected_value=self.LBL_DUPLICATE_REVIEW_MESSAGE
291317
)
292318
self.po.act(locator=self.LNK_REVIEW, action=framework_actions.CLICK_LINK)
293-
self.po.verify(
294-
locator=self.LBL_MAIN, property=element_properties.TEXT, expected_value="!Not provided"
295-
) # NHS number for Existing Record
319+
self.po.act(locator=self.RDO_USE_DUPLICATE, action=framework_actions.RADIO_BUTTON_SELECT)
320+
self.po.act(locator=self.BTN_RESOLVE_DUPLICATE, action=framework_actions.CLICK_BUTTON)
321+
self.po.verify(locator=self.LBL_MAIN, property=element_properties.TEXT, expected_value=self.LBL_RECORD_UPDATED)

test_data/cohorts/i_mav_853.csv

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
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
2+
MAV_853,MAV_853,,2009-01-09,<<SCHOOL_1_URN>>,9755237070,Addr1,Add2,City,AA1 1AA,Parent1,Dad,[email protected],,Parent2,Mum,[email protected],,9

test_data/cohorts/i_mav_909.csv

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
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
2-
MAV_909,MAV_909,,20111221,<<SCHOOL_1_URN>>,<<NHS_NO>>,Addr1,Add2,City,AA1 1AA,Parent1,Dad,[email protected],,Parent2,Mum,[email protected],,8
2+
MAV_909,MAV_909,,<<DOB_YEAR_8>>,<<SCHOOL_1_URN>>,,Addr1,Add2,City,AA1 1AA,Parent1,Dad,[email protected],,Parent2,Mum,[email protected],,8

test_data/cohorts/o_mav_853.csv

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
1 child

test_data/file_mapping.csv

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,5 +45,6 @@ COHORTS_CONFLICTING_GILLICK,test_data/cohorts/i_conflicting_gillick.csv,test_dat
4545
COHORTS_FULL_NAME,test_data/cohorts/i_full_name.csv,test_data/cohorts/o_full_name.csv,cohortfullname
4646
COHORTS_MAV_927_PERF,test_data/cohorts/i_mav_927_perf.csv,test_data/cohorts/o_mav_927_perf.csv,cohortmav927perf
4747
COHORTS_MAV_909,test_data/cohorts/i_mav_909.csv,test_data/cohorts/o_mav_909.csv,cohortmav909
48+
COHORTS_MAV_853,test_data/cohorts/i_mav_853.csv,test_data/cohorts/o_mav_853.csv,cohortmav853
4849
CLASS_MOVES_CONFIRM_IGNORE,test_data/class_list/i_moves_1.csv,test_data/class_list/o_moves_1.csv,classmoves1
4950
CLASS_MOVES_UNKNOWN_HOMESCHOOLED,test_data/class_list/i_moves_2.csv,test_data/class_list/o_moves_2.csv,classmoves2

test_data/vaccs/i_mav_853.csv

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
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
2-
P_HPV_Gardasil9,<<ORG_CODE>>,<<SCHOOL_1_URN>>,<<SCHOOL_1_NAME>>,<<NHS_NO>>,Mav_853,MAV_853,2010-08-12,Male,DN9 1PB,<<VACCS_DATE>>,Gardasil9,AutoBatch1,20301231,Left Thigh,1,Y,1,,,[email protected],Clinic,00:01,,<<SESSION_ID>>,HPV
2+
P_HPV_Gardasil9,<<ORG_CODE>>,<<SCHOOL_1_URN>>,<<SCHOOL_1_NAME>>,9755237070,MAV_853,MAV_853,2009-01-09,Male,DN9 1PB,<<VACCS_DATE>>,Gardasil9,AutoBatch1,20301231,Left Thigh,1,Y,1,,,[email protected],Clinic,00:01,,<<SESSION_ID>>,HPV

tests/test_05_programmes.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,6 @@ def test_cohorts_empty_file(self, setup_cohort_upload_and_reports):
137137

138138
@pytest.mark.cohorts
139139
@pytest.mark.order(506)
140-
# @pytest.mark.skip(reason="Test under construction")
141140
def test_cohorts_readd_to_cohort(self, setup_cohort_upload_and_reports): # MAV-909
142141
self.programmes_page.upload_cohorts(file_paths=test_data_file_paths.COHORTS_MAV_909)
143142
self.programmes_page.verify_mav_909()

tests/test_07_children.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,14 @@
22

33
from libs.generic_constants import fixture_scope
44
from libs.mavis_constants import test_data_file_paths
5-
from pages import pg_children, pg_dashboard, pg_import_records, pg_login, pg_sessions
5+
from pages import (
6+
pg_children,
7+
pg_dashboard,
8+
pg_import_records,
9+
pg_login,
10+
pg_programmes,
11+
pg_sessions,
12+
)
613

714

815
class Test_Children:
@@ -11,6 +18,7 @@ class Test_Children:
1118
children_page = pg_children.pg_children()
1219
sessions_page = pg_sessions.pg_sessions()
1320
import_records_page = pg_import_records.pg_import_records()
21+
programmes_page = pg_programmes.pg_programmes()
1422

1523
@pytest.fixture(scope=fixture_scope.FUNCTION, autouse=False)
1624
def setup_tests(self, start_mavis: None):
@@ -63,6 +71,9 @@ def setup_mav_853(self, setup_tests: None):
6371
self.sessions_page.click_school1()
6472
self.sessions_page.save_session_id_from_offline_excel()
6573
self.dashboard_page.go_to_dashboard()
74+
self.dashboard_page.click_programmes()
75+
self.programmes_page.upload_cohorts(file_paths=test_data_file_paths.COHORTS_MAV_853)
76+
self.dashboard_page.go_to_dashboard()
6677
self.dashboard_page.click_import_records()
6778
self.import_records_page.click_import_records()
6879
self.import_records_page.import_vaccination_records(file_paths=test_data_file_paths.VACCS_MAV_853)

0 commit comments

Comments
 (0)