diff --git a/.github/workflows/MAVIS_TEST.yml b/.github/workflows/MAVIS_TEST.yml index 457a7da26b0..a42732c14e7 100644 --- a/.github/workflows/MAVIS_TEST.yml +++ b/.github/workflows/MAVIS_TEST.yml @@ -45,6 +45,7 @@ jobs: # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics - name: Test with pytest + continue-on-error: true env: HEADLESS: ${{ vars.HEADLESS }} CAPTURE_SCREENSHOTS: ${{ vars.CAPTURE_SCREENSHOTS }} @@ -57,18 +58,24 @@ jobs: TEST_USERNAME: ${{ secrets.TEST_USERNAME }} API_TOKEN: ${{ secrets.API_TOKEN }} run: | - echo "Starting tests on Chromium" + echo "::group::Chromium" pytest --browser_or_device chromium - echo "Starting tests on Chrome" + echo "::endgroup::" + echo "::group::Chrome" pytest --browser_or_device chrome - echo "Starting tests on Firefox" + echo "::endgroup::" + echo "::group::Firefox" pytest --browser_or_device firefox - echo "Starting tests on iPhone 12" + echo "::endgroup::" + echo "::group::iPhone 12" pytest -m mobile --browser_or_device iphone_12 - echo "Starting tests on iPhone 11" + echo "::endgroup::" + echo "::group::iPhone 11" pytest -m mobile --browser_or_device iphone_11 - echo "Starting tests on Pixel 5" + echo "::endgroup::" + echo "::group::Pixel 5" pytest -m mobile --browser_or_device pixel_5 + echo "::endgroup::" - name: Upload report uses: actions/upload-artifact@v4 with: diff --git a/pages/pg_dashboard.py b/pages/pg_dashboard.py index b07c1dd6c7a..9facafe6416 100644 --- a/pages/pg_dashboard.py +++ b/pages/pg_dashboard.py @@ -12,7 +12,8 @@ class pg_dashboard: LNK_CHILDREN = f"heading{escape_characters.SEPARATOR}Children" LNK_NOTICES = f"heading{escape_characters.SEPARATOR}Important Notices" LNK_ORGANISATION = f"heading{escape_characters.SEPARATOR}Your organisation" - LNK_DASHBOARD = "Manage vaccinations in schools" + LNK_NHS_LOGO = "Manage vaccinations in schools" + LNK_GUIDE = "Service guidance (opens in a" def click_programmes(self): self.po.perform_action(locator=self.LNK_PROGRAMMES, action=actions.CLICK_LINK) @@ -34,7 +35,7 @@ def click_your_organisation(self): def go_to_dashboard(self): wait(timeout=wait_time.MIN) # Scripts sometimes error out without this wait when called as a teardown action - self.po.perform_action(locator=self.LNK_DASHBOARD, action=actions.CLICK_LINK) + self.po.perform_action(locator=self.LNK_NHS_LOGO, action=actions.CLICK_LINK) def verify_all_expected_links(self): self.po.verify(locator=self.LNK_PROGRAMMES, property=object_properties.VISIBILITY, value=True, exact=True) @@ -48,3 +49,9 @@ def verify_all_expected_links(self): value=True, exact=True, ) + self.po.verify( + locator=self.LNK_GUIDE, + property=object_properties.HREF, + value="https://guide.manage-vaccinations-in-schools.nhs.uk/", + exact=True, + ) diff --git a/pages/pg_sessions.py b/pages/pg_sessions.py index 7574f1e7fd4..094665fb827 100644 --- a/pages/pg_sessions.py +++ b/pages/pg_sessions.py @@ -235,6 +235,26 @@ def __delete_sessions(self): chain_locator=True, ) + def edit_session(self, to_date: str): + _day = to_date[-2:] + _month = to_date[4:6] + _year = to_date[:4] + self.po.perform_action(locator=self.LNK_EDIT_SESSION, action=actions.CLICK_LINK) + self.po.perform_action(locator=self.LNK_CHANGE_SESSION_DATES, action=actions.CLICK_LINK) + self.po.perform_action(locator=self.TXT_DAY, action=actions.FILL, value=_day) + self.po.perform_action(locator=self.TXT_MONTH, action=actions.FILL, value=_month) + self.po.perform_action(locator=self.TXT_YEAR, action=actions.FILL, value=_year) + self.po.perform_action(locator=self.LNK_CONTINUE, action=actions.CLICK_BUTTON) + self.po.perform_action(locator=self.LNK_CONTINUE, action=actions.CLICK_LINK) + self.po.verify( + locator="locator('div').filter(has_text=re.compile(r'^Session datesNot provided$')).get_by_role('definition')", + property=object_properties.VISIBILITY, + value=False, + exact=False, + by_test_id=False, + chain_locator=True, + ) + def verify_triage_updated(self): self.po.verify( locator=self.LBL_PARAGRAPH, @@ -319,12 +339,6 @@ def update_triage_outcome_consent_refused(self, file_paths): self.click_child_full_name() self.click_get_consent_responses() self.consent_page.service_refuse_consent() - # self.dashboard_page.go_to_dashboard() - # self.dashboard_page.click_sessions() - # self.click_scheduled() - # self.click_school1() - # self.click_record_vaccinations() - # self.click_could_not_vaccinate() self.click_consent_refused() self.click_child_full_name() self.click_activity_log() @@ -338,6 +352,14 @@ def schedule_a_valid_session(self, for_today: bool = False): self.schedule_session(future_date=_future_date) self.verify_scheduled_date(message=_expected_message) + def edit_a_session_to_today(self): + _future_date = get_offset_date(offset_days=0) + self.click_scheduled() + self.click_school1() + self.edit_session(to_date=_future_date) + # _expected_message = f"Session dates {self.__get_display_formatted_date(date_to_format=_future_date)}" + # self.verify_scheduled_date(message=_expected_message) + def delete_all_sessions(self): self.click_scheduled() self.click_school1() diff --git a/pytest.ini b/pytest.ini index d35a3efa9ed..cb98b1f808c 100644 --- a/pytest.ini +++ b/pytest.ini @@ -21,6 +21,7 @@ markers = consent cohorts childlist + classlist vaccsbatch rav bugs diff --git a/test_data/hpv/i_dup_1.csv b/test_data/hpv/i_dup_1.csv index 88e7a9511db..a72e614842c 100644 --- a/test_data/hpv/i_dup_1.csv +++ b/test_data/hpv/i_dup_1.csv @@ -1,2 +1,3 @@ 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 P_Gardasil9,R1L,142181,Bohunt School Wokingham,9000000000,ChildFirst1,ChildLast1,20100811,Male,DN9 1PB,<>,Gardasil9,AutoBatch1,20301231,Left Thigh,1,Y,1,,,nurse.joy@example.com,Clinic,00:01, +P_Gardasil9,R1L,142181,Bohunt School Wokingham,9000000000,ChildFirst1,ChildLast1,20100811,Male,DN9 1PB,<>,Gardasil9,AutoBatch1,20301231,Left Thigh,1,Y,1,,,nurse.joy@example.com,Clinic,00:01, diff --git a/test_data/hpv/i_hist_negative.csv b/test_data/hpv/i_hist_negative.csv index d95440991d3..bf6ab4177a4 100644 --- a/test_data/hpv/i_hist_negative.csv +++ b/test_data/hpv/i_hist_negative.csv @@ -23,6 +23,8 @@ N_EmptyBatchNumber,R1L,142181,Bohunt School Wokingham,<>,<>,<>,<>,<>,20100228,Female,DN9 1PB,<>,Gardasil9,Batch1,,left thigh,1,Y,1,,,nurse.joy@example.com,Clinic,00:01, N_EmptyAnatomicalSite,R1L,142181,Bohunt School Wokingham,<>,<>,<>,20100228,Female,DN9 1PB,<>,Gardasil9,Batch1,20301231,,1,Y,1,,,nurse.joy@example.com,Clinic,00:01, N_InvalidAnatomicalSite,R1L,142181,Bohunt School Wokingham,<>,<>,<>,20100228,Female,DN9 1PB,<>,Gardasil9,Batch1,20301231,Nasal,1,Y,1,,,nurse.joy@example.com,Clinic,00:01, +N_InvalidAnatomicalSite,R1L,142181,Bohunt School Wokingham,<>,<>,<>,20100228,Female,DN9 1PB,<>,Gardasil9,Batch1,20301231,Left Buttock,1,Y,1,,,nurse.joy@example.com,Clinic,00:01, +N_InvalidAnatomicalSite,R1L,142181,Bohunt School Wokingham,<>,<>,<>,20100228,Female,DN9 1PB,<>,Gardasil9,Batch1,20301231,Right Buttock,1,Y,1,,,nurse.joy@example.com,Clinic,00:01, N_EmptyDoseSeq,R1L,142181,Bohunt School Wokingham,<>,<>,<>,20100228,Female,DN9 1PB,<>,Gardasil9,Batch1,20301231,left thigh,,Y,1,,,nurse.joy@example.com,Clinic,00:01, N_InvalidDoseSeq,R1L,142181,Bohunt School Wokingham,<>,<>,<>,20100228,Female,DN9 1PB,<>,Gardasil9,Batch1,20301231,left thigh,10,Y,1,,,nurse.joy@example.com,Clinic,00:01, N_EmptyCareSetting,R1L,142181,Bohunt School Wokingham,<>,<>,<>,20100228,Female,DN9 1PB,<>,Gardasil9,Batch1,20301231,left thigh,1,Y,,,,nurse.joy@example.com,Clinic,00:01, diff --git a/test_data/hpv/o_dup_1.csv b/test_data/hpv/o_dup_1.csv new file mode 100644 index 00000000000..03d7f9c38a6 --- /dev/null +++ b/test_data/hpv/o_dup_1.csv @@ -0,0 +1,3 @@ +Completed +0 previously imported records were omitted +2 vaccination records diff --git a/test_data/hpv/o_hist_negative.csv b/test_data/hpv/o_hist_negative.csv index a034794a020..77656027391 100644 --- a/test_data/hpv/o_hist_negative.csv +++ b/test_data/hpv/o_hist_negative.csv @@ -21,9 +21,9 @@ Row 20 VACCINE_GIVEN: Enter a valid vaccine, eg Gardasil9. Row 21 BATCH_NUMBER: Enter a batch number. Row 22 BATCH_EXPIRY_DATE: Enter a batch expiry date. Row 23 ANATOMICAL_SITE: Enter an anatomical site. -Row 25 DOSE_SEQUENCE: The dose sequence number cannot be greater than 3. Enter a dose sequence number, for example, 1, 2 or 3. -Row 26 DOSE_SEQUENCE: must be less than or equal to 3 -Row 27 CARE_SETTING: Enter a care setting. -Row 32 TIME_OF_VACCINATION: Enter a time in the correct format -Row 34 VACCINATED: You need to record whether the child was vaccinated or not. Enter ‘Y’ or ‘N’ in the ‘vaccinated’ column.BATCH_EXPIRY_DATE: must be blankBATCH_NUMBER: must be blankANATOMICAL_SITE: must be blankREASON_NOT_VACCINATED: Enter a valid reasonVACCINE_GIVEN: must be blank -Row 35 CARE_SETTING: Enter a valid care setting. +Row 27 DOSE_SEQUENCE: The dose sequence number cannot be greater than 3. Enter a dose sequence number, for example, 1, 2 or 3. +Row 28 DOSE_SEQUENCE: must be less than or equal to 3 +Row 29 CARE_SETTING: Enter a care setting. +Row 34 TIME_OF_VACCINATION: Enter a time in the correct format +Row 36 VACCINATED: You need to record whether the child was vaccinated or not. Enter ‘Y’ or ‘N’ in the ‘vaccinated’ column.BATCH_EXPIRY_DATE: must be blankBATCH_NUMBER: must be blankANATOMICAL_SITE: must be blankREASON_NOT_VACCINATED: Enter a valid reasonVACCINE_GIVEN: must be blank +Row 37 CARE_SETTING: Enter a valid care setting. diff --git a/tests/test_02_sessions.py b/tests/test_02_sessions.py index 6a7cff9fa23..b0299d8abea 100644 --- a/tests/test_02_sessions.py +++ b/tests/test_02_sessions.py @@ -28,11 +28,16 @@ def test_reg_create_valid_session(self): self.sessions_page.schedule_a_valid_session() @pytest.mark.sessions - @pytest.mark.order(202) + @pytest.mark.order(201) + def test_reg_edit_session(self): + self.sessions_page.edit_a_session_to_today() + + @pytest.mark.sessions + @pytest.mark.order(203) def test_reg_delete_all_sessions(self): self.sessions_page.delete_all_sessions() @pytest.mark.sessions - @pytest.mark.order(203) + @pytest.mark.order(204) def test_reg_create_invalid_session(self): self.sessions_page.create_invalid_session()