Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions libs/mavis_constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion pages/pg_children.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
32 changes: 29 additions & 3 deletions pages/pg_programmes.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand All @@ -290,6 +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.verify(
locator=self.LBL_MAIN, property=element_properties.TEXT, expected_value="!Not provided"
) # NHS number for Existing Record
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)
2 changes: 2 additions & 0 deletions test_data/cohorts/i_mav_853.csv
Original file line number Diff line number Diff line change
@@ -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,<<SCHOOL_1_URN>>,9755237070,Addr1,Add2,City,AA1 1AA,Parent1,Dad,[email protected],,Parent2,Mum,[email protected],,9
2 changes: 1 addition & 1 deletion test_data/cohorts/i_mav_909.csv
Original file line number Diff line number Diff line change
@@ -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,<<SCHOOL_1_URN>>,<<NHS_NO>>,Addr1,Add2,City,AA1 1AA,Parent1,Dad,[email protected],,Parent2,Mum,[email protected],,8
MAV_909,MAV_909,,<<DOB_YEAR_8>>,<<SCHOOL_1_URN>>,,Addr1,Add2,City,AA1 1AA,Parent1,Dad,[email protected],,Parent2,Mum,[email protected],,8
1 change: 1 addition & 0 deletions test_data/cohorts/o_mav_853.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1 child
1 change: 1 addition & 0 deletions test_data/file_mapping.csv
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion test_data/vaccs/i_mav_853.csv
Original file line number Diff line number Diff line change
@@ -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,<<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
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
1 change: 0 additions & 1 deletion tests/test_05_programmes.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
13 changes: 12 additions & 1 deletion tests/test_07_children.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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):
Expand Down Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion utils/001_cleanup.py
Original file line number Diff line number Diff line change
@@ -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"]


Expand Down
Loading