diff --git a/libs/constants.py b/libs/constants.py index 8229fd56766..49a080eec00 100644 --- a/libs/constants.py +++ b/libs/constants.py @@ -123,7 +123,6 @@ class test_data_file_paths: COHORTS_INVALID_STRUCTURE: Final[str] = "COHORTS_INVALID_STRUCTURE" COHORTS_EMPTY_FILE: Final[str] = "COHORTS_EMPTY_FILE" COHORTS_HEADER_ONLY: Final[str] = "COHORTS_HEADER_ONLY" - COHORTS_NO_APPROVAL: Final[str] = "COHORTS_NO_APPROVAL" CHILD_POSITIVE: Final[str] = "CHILD_POSITIVE" CHILD_NEGATIVE: Final[str] = "CHILD_NEGATIVE" CHILD_INVALID_STRUCTURE: Final[str] = "CHILD_INVALID_STRUCTURE" @@ -134,3 +133,5 @@ class test_data_file_paths: CLASS_INVALID_STRUCTURE: Final[str] = "CLASS_INVALID_STRUCTURE" CLASS_EMPTY_FILE: Final[str] = "CLASS_EMPTY_FILE" CLASS_HEADER_ONLY: Final[str] = "CLASS_HEADER_ONLY" + COHORTS_NO_APPROVAL: Final[str] = "COHORTS_NO_APPROVAL" + VACCS_HPV_DOSE_TWO: Final[str] = "VACCS_HPV_DOSE_TWO" diff --git a/pages/pg_programmes.py b/pages/pg_programmes.py index 5ed6e6517fa..ca88ca3064d 100644 --- a/pages/pg_programmes.py +++ b/pages/pg_programmes.py @@ -11,6 +11,7 @@ class pg_programmes: LNK_HPV = "HPV" LNK_IMPORTS = "Imports" + LNK_VACCINATIONS = "Vaccinations" LNK_COHORTS = "Cohorts" LNK_IMPORT_CHILD_RECORDS = "Import child records" LNK_IMPORT_RECORDS = "Import records" @@ -22,6 +23,11 @@ class pg_programmes: LBL_IMPORT_STARTED = "Import processing started" LBL_PARAGRAPH = "paragraph" LBL_MAIN = "main" + LNK_DOSE2_CHILD = "Dose2 Dose2" + LNK_CHANGE_OUTCOME = "Change   outcome" + RDO_THEY_REFUSED_IT = "They refused it" + BTN_EDIT_VACCINATION_RECORD = "Edit vaccination record" + BTN_SAVE_CHANGES = "Save changes" def click_hpv(self): self.po.perform_action(locator=self.LNK_HPV, action=actions.CLICK_LINK) @@ -29,9 +35,15 @@ def click_hpv(self): def click_imports(self): self.po.perform_action(locator=self.LNK_IMPORTS, action=actions.CLICK_LINK) + def click_vaccinations(self): + self.po.perform_action(locator=self.LNK_VACCINATIONS, action=actions.CLICK_LINK, exact=True) + def click_cohorts(self): self.po.perform_action(locator=self.LNK_COHORTS, action=actions.CLICK_LINK) + def click_edit_vaccination_record(self): + self.po.perform_action(locator=self.BTN_EDIT_VACCINATION_RECORD, action=actions.CLICK_BUTTON) + def click_import_records(self): self.po.perform_action(locator=self.LNK_IMPORT_RECORDS, action=actions.CLICK_LINK) @@ -76,6 +88,9 @@ def click_uploaded_file_datetime(self): def record_upload_time(self): self.upload_time = get_link_formatted_date_time() + def click_dose2_child(self): + self.po.perform_action(locator=self.LNK_DOSE2_CHILD, action=actions.CLICK_LINK) + def verify_upload_output(self, file_path: str): _expected_errors = self.tdo.get_expected_errors(file_path=file_path) if _expected_errors is not None: @@ -156,3 +171,19 @@ def upload_invalid_hpv_child_records(self, file_paths: str): self.choose_file_child_records(file_path=_input_file_path) self.click_continue() self.verify_upload_output(file_path=_output_file_path) + + def edit_dose_to_not_given(self): + self.click_hpv() + self.click_vaccinations() + self.click_dose2_child() + self.click_edit_vaccination_record() + self.po.perform_action(locator=self.LNK_CHANGE_OUTCOME, action=actions.CLICK_LINK) + self.po.perform_action(locator=self.RDO_THEY_REFUSED_IT, action=actions.RADIO_BUTTON_SELECT) + self.click_continue() + self.po.perform_action(locator=self.BTN_SAVE_CHANGES, action=actions.CLICK_BUTTON) + self.po.verify( + locator=self.LBL_MAIN, + property=object_properties.TEXT, + value="!Sorry, there’s a problem with the service", + exact=False, + ) diff --git a/pages/pg_school_moves.py b/pages/pg_school_moves.py index 03a8001118a..50913d98016 100644 --- a/pages/pg_school_moves.py +++ b/pages/pg_school_moves.py @@ -31,3 +31,6 @@ def ignore_school_move(self): self.po.perform_action(locator=self.BTN_UPDATE_SCHOOL, action=actions.CLICK_BUTTON) _success_message = "’s school move ignored" self.po.verify(locator=self.LBL_PARAGRAPH, property=object_properties.TEXT, value=_success_message) + + def upload_new_student_to_closed_session(self): + pass diff --git a/test_data/ParentalConsent.xlsx b/test_data/ParentalConsent.xlsx index 1672fed5a47..9037eca81e0 100644 Binary files a/test_data/ParentalConsent.xlsx and b/test_data/ParentalConsent.xlsx differ diff --git a/test_data/file_mapping.csv b/test_data/file_mapping.csv index fc366d2ecb3..5848a2196c1 100644 --- a/test_data/file_mapping.csv +++ b/test_data/file_mapping.csv @@ -13,7 +13,6 @@ COHORTS_NEGATIVE,test_data/cohorts/i_negative.csv,test_data/cohorts/o_negative.c COHORTS_INVALID_STRUCTURE,test_data/cohorts/i_invalid_structure.csv,test_data/cohorts/o_invalid_structure.csv,cohort COHORTS_EMPTY_FILE,test_data/cohorts/i_empty.csv,test_data/cohorts/o_empty.csv,cohort COHORTS_HEADER_ONLY,test_data/cohorts/i_header_only.csv,test_data/cohorts/o_header_only.csv,cohort -COHORTS_NO_APPROVAL,test_data/cohorts/i_no_consent.csv,,cohort CHILD_POSITIVE,test_data/child/i_positive.csv,test_data/child/o_positive.csv,child CHILD_NEGATIVE,test_data/child/i_negative.csv,test_data/child/o_negative.csv,child CHILD_INVALID_STRUCTURE,test_data/child/i_invalid_structure.csv,test_data/child/o_invalid_structure.csv,child @@ -24,3 +23,5 @@ CLASS_NEGATIVE,test_data/class_list/i_negative.csv,test_data/class_list/o_negati CLASS_INVALID_STRUCTURE,test_data/class_list/i_invalid_structure.csv,test_data/class_list/o_invalid_structure.csv,class CLASS_EMPTY_FILE,test_data/class_list/i_empty.csv,test_data/class_list/o_empty.csv,class CLASS_HEADER_ONLY,test_data/class_list/i_header_only.csv,test_data/class_list/o_header_only.csv,class +COHORTS_NO_APPROVAL,test_data/cohorts/i_no_consent.csv,,cohort +VACCS_HPV_DOSE_TWO,test_data/hpv/i_dose_two.csv,,hpv diff --git a/test_data/hpv/i_dose_two.csv b/test_data/hpv/i_dose_two.csv new file mode 100644 index 00000000000..ef16dab7ef4 --- /dev/null +++ b/test_data/hpv/i_dose_two.csv @@ -0,0 +1,2 @@ +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 +R1L,142181,Bohunt School Wokingham,<>,Dose2,Dose2,20100228,Female,DN9 1PB,<>,Gardasil9,Batch1,20301231,left thigh,2,Y,1,,,nurse.joy@example.com,Clinic,00:01, diff --git a/tests/test_07_record_a_vaccine_using_ui.py b/tests/test_07_record_a_vaccine_using_ui.py index 5bc9e56d05f..e81e277820d 100644 --- a/tests/test_07_record_a_vaccine_using_ui.py +++ b/tests/test_07_record_a_vaccine_using_ui.py @@ -1,15 +1,16 @@ import pytest from libs.constants import test_data_file_paths -from pages import pg_dashboard, pg_login, pg_sessions +from pages import pg_dashboard, pg_login, pg_programmes, pg_sessions class Test_Record_a_Vaccine_Using_UI: login_page = pg_login.pg_login() dashboard_page = pg_dashboard.pg_dashboard() sessions_page = pg_sessions.pg_sessions() + programmes_page = pg_programmes.pg_programmes() - @pytest.fixture(scope="function", autouse=True) + @pytest.fixture(scope="function") def setup_tests(self, start_mavis: None): self.login_page.login_as_nurse() self.dashboard_page.click_sessions() @@ -24,10 +25,28 @@ def setup_tests(self, start_mavis: None): @pytest.mark.rav @pytest.mark.order(701) - def test_rav_triage_positive(self): + def test_rav_triage_positive(self, setup_tests): self.sessions_page.update_triage_outcome_positive(file_paths=test_data_file_paths.COHORTS_POSITIVE) @pytest.mark.rav @pytest.mark.order(702) - def test_rav_triage_consent_refused(self): + def test_rav_triage_consent_refused(self, setup_tests): self.sessions_page.update_triage_outcome_consent_refused(file_paths=test_data_file_paths.COHORTS_POSITIVE) + + @pytest.mark.rav + @pytest.mark.order(703) + @pytest.mark.skip(reason="Development in progress") + def test_rav_edit_dose_to_not_given(self, start_mavis): + self.login_page.login_as_nurse() + self.dashboard_page.click_sessions() + self.sessions_page.schedule_a_valid_session(for_today=True) + self.dashboard_page.go_to_dashboard() + self.dashboard_page.click_programmes() + self.programmes_page.upload_hpv_vaccination_records(file_paths=test_data_file_paths.VACCS_HPV_DOSE_TWO) + self.dashboard_page.go_to_dashboard() + self.dashboard_page.click_programmes() + self.programmes_page.edit_dose_to_not_given() # MAVIS-1729 + self.dashboard_page.go_to_dashboard() + self.dashboard_page.click_sessions() + self.sessions_page.delete_all_sessions() + self.login_page.logout_of_mavis() diff --git a/tests/test_11_school_moves.py b/tests/test_11_school_moves.py index 507915f92cd..177adba2ccf 100644 --- a/tests/test_11_school_moves.py +++ b/tests/test_11_school_moves.py @@ -41,3 +41,9 @@ def test_school_moves_update_school_movers(self): self.dashboard_page.go_to_dashboard() self.dashboard_page.click_school_moves() self.school_moves_page.ignore_school_move() + + @pytest.mark.schoolmoves + @pytest.mark.order(1103) + @pytest.mark.skip(reason="Under construction") + def test_school_moves_new_student_to_closed_session(self): + self.school_moves_page.upload_new_student_to_closed_session()