Skip to content

Commit d5bc62e

Browse files
Merge pull request #37 from NHSDigital:20241128
20241128
2 parents a8b7d77 + 7e08167 commit d5bc62e

File tree

9 files changed

+70
-22
lines changed

9 files changed

+70
-22
lines changed

.github/workflows/MAVIS_TEST.yml

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ jobs:
4545
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
4646
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
4747
- name: Test with pytest
48+
continue-on-error: true
4849
env:
4950
HEADLESS: ${{ vars.HEADLESS }}
5051
CAPTURE_SCREENSHOTS: ${{ vars.CAPTURE_SCREENSHOTS }}
@@ -57,18 +58,24 @@ jobs:
5758
TEST_USERNAME: ${{ secrets.TEST_USERNAME }}
5859
API_TOKEN: ${{ secrets.API_TOKEN }}
5960
run: |
60-
echo "Starting tests on Chromium"
61+
echo "::group::Chromium"
6162
pytest --browser_or_device chromium
62-
echo "Starting tests on Chrome"
63+
echo "::endgroup::"
64+
echo "::group::Chrome"
6365
pytest --browser_or_device chrome
64-
echo "Starting tests on Firefox"
66+
echo "::endgroup::"
67+
echo "::group::Firefox"
6568
pytest --browser_or_device firefox
66-
echo "Starting tests on iPhone 12"
69+
echo "::endgroup::"
70+
echo "::group::iPhone 12"
6771
pytest -m mobile --browser_or_device iphone_12
68-
echo "Starting tests on iPhone 11"
72+
echo "::endgroup::"
73+
echo "::group::iPhone 11"
6974
pytest -m mobile --browser_or_device iphone_11
70-
echo "Starting tests on Pixel 5"
75+
echo "::endgroup::"
76+
echo "::group::Pixel 5"
7177
pytest -m mobile --browser_or_device pixel_5
78+
echo "::endgroup::"
7279
- name: Upload report
7380
uses: actions/upload-artifact@v4
7481
with:

pages/pg_dashboard.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ class pg_dashboard:
1212
LNK_CHILDREN = f"heading{escape_characters.SEPARATOR}Children"
1313
LNK_NOTICES = f"heading{escape_characters.SEPARATOR}Important Notices"
1414
LNK_ORGANISATION = f"heading{escape_characters.SEPARATOR}Your organisation"
15-
LNK_DASHBOARD = "Manage vaccinations in schools"
15+
LNK_NHS_LOGO = "Manage vaccinations in schools"
16+
LNK_GUIDE = "Service guidance (opens in a"
1617

1718
def click_programmes(self):
1819
self.po.perform_action(locator=self.LNK_PROGRAMMES, action=actions.CLICK_LINK)
@@ -34,7 +35,7 @@ def click_your_organisation(self):
3435

3536
def go_to_dashboard(self):
3637
wait(timeout=wait_time.MIN) # Scripts sometimes error out without this wait when called as a teardown action
37-
self.po.perform_action(locator=self.LNK_DASHBOARD, action=actions.CLICK_LINK)
38+
self.po.perform_action(locator=self.LNK_NHS_LOGO, action=actions.CLICK_LINK)
3839

3940
def verify_all_expected_links(self):
4041
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):
4849
value=True,
4950
exact=True,
5051
)
52+
self.po.verify(
53+
locator=self.LNK_GUIDE,
54+
property=object_properties.HREF,
55+
value="https://guide.manage-vaccinations-in-schools.nhs.uk/",
56+
exact=True,
57+
)

pages/pg_sessions.py

Lines changed: 28 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,26 @@ def __delete_sessions(self):
235235
chain_locator=True,
236236
)
237237

238+
def edit_session(self, to_date: str):
239+
_day = to_date[-2:]
240+
_month = to_date[4:6]
241+
_year = to_date[:4]
242+
self.po.perform_action(locator=self.LNK_EDIT_SESSION, action=actions.CLICK_LINK)
243+
self.po.perform_action(locator=self.LNK_CHANGE_SESSION_DATES, action=actions.CLICK_LINK)
244+
self.po.perform_action(locator=self.TXT_DAY, action=actions.FILL, value=_day)
245+
self.po.perform_action(locator=self.TXT_MONTH, action=actions.FILL, value=_month)
246+
self.po.perform_action(locator=self.TXT_YEAR, action=actions.FILL, value=_year)
247+
self.po.perform_action(locator=self.LNK_CONTINUE, action=actions.CLICK_BUTTON)
248+
self.po.perform_action(locator=self.LNK_CONTINUE, action=actions.CLICK_LINK)
249+
self.po.verify(
250+
locator="locator('div').filter(has_text=re.compile(r'^Session datesNot provided$')).get_by_role('definition')",
251+
property=object_properties.VISIBILITY,
252+
value=False,
253+
exact=False,
254+
by_test_id=False,
255+
chain_locator=True,
256+
)
257+
238258
def verify_triage_updated(self):
239259
self.po.verify(
240260
locator=self.LBL_PARAGRAPH,
@@ -319,12 +339,6 @@ def update_triage_outcome_consent_refused(self, file_paths):
319339
self.click_child_full_name()
320340
self.click_get_consent_responses()
321341
self.consent_page.service_refuse_consent()
322-
# self.dashboard_page.go_to_dashboard()
323-
# self.dashboard_page.click_sessions()
324-
# self.click_scheduled()
325-
# self.click_school1()
326-
# self.click_record_vaccinations()
327-
# self.click_could_not_vaccinate()
328342
self.click_consent_refused()
329343
self.click_child_full_name()
330344
self.click_activity_log()
@@ -338,6 +352,14 @@ def schedule_a_valid_session(self, for_today: bool = False):
338352
self.schedule_session(future_date=_future_date)
339353
self.verify_scheduled_date(message=_expected_message)
340354

355+
def edit_a_session_to_today(self):
356+
_future_date = get_offset_date(offset_days=0)
357+
self.click_scheduled()
358+
self.click_school1()
359+
self.edit_session(to_date=_future_date)
360+
# _expected_message = f"Session dates {self.__get_display_formatted_date(date_to_format=_future_date)}"
361+
# self.verify_scheduled_date(message=_expected_message)
362+
341363
def delete_all_sessions(self):
342364
self.click_scheduled()
343365
self.click_school1()

pytest.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ markers =
2121
consent
2222
cohorts
2323
childlist
24+
classlist
2425
vaccsbatch
2526
rav
2627
bugs

test_data/hpv/i_dup_1.csv

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
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
22
P_Gardasil9,R1L,142181,Bohunt School Wokingham,9000000000,ChildFirst1,ChildLast1,20100811,Male,DN9 1PB,<<VACCS_DATE>>,Gardasil9,AutoBatch1,20301231,Left Thigh,1,Y,1,,,[email protected],Clinic,00:01,
3+
P_Gardasil9,R1L,142181,Bohunt School Wokingham,9000000000,ChildFirst1,ChildLast1,20100811,Male,DN9 1PB,<<VACCS_DATE>>,Gardasil9,AutoBatch1,20301231,Left Thigh,1,Y,1,,,[email protected],Clinic,00:01,

test_data/hpv/i_hist_negative.csv

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ N_EmptyBatchNumber,R1L,142181,Bohunt School Wokingham,<<NHS_NO>>,<<FNAME>>,<<LNA
2323
N_EmptyExpiryDate,R1L,142181,Bohunt School Wokingham,<<NHS_NO>>,<<FNAME>>,<<LNAME>>,20100228,Female,DN9 1PB,<<HIST_VACCS_DATE>>,Gardasil9,Batch1,,left thigh,1,Y,1,,,[email protected],Clinic,00:01,
2424
N_EmptyAnatomicalSite,R1L,142181,Bohunt School Wokingham,<<NHS_NO>>,<<FNAME>>,<<LNAME>>,20100228,Female,DN9 1PB,<<HIST_VACCS_DATE>>,Gardasil9,Batch1,20301231,,1,Y,1,,,[email protected],Clinic,00:01,
2525
N_InvalidAnatomicalSite,R1L,142181,Bohunt School Wokingham,<<NHS_NO>>,<<FNAME>>,<<LNAME>>,20100228,Female,DN9 1PB,<<HIST_VACCS_DATE>>,Gardasil9,Batch1,20301231,Nasal,1,Y,1,,,[email protected],Clinic,00:01,
26+
N_InvalidAnatomicalSite,R1L,142181,Bohunt School Wokingham,<<NHS_NO>>,<<FNAME>>,<<LNAME>>,20100228,Female,DN9 1PB,<<HIST_VACCS_DATE>>,Gardasil9,Batch1,20301231,Left Buttock,1,Y,1,,,[email protected],Clinic,00:01,
27+
N_InvalidAnatomicalSite,R1L,142181,Bohunt School Wokingham,<<NHS_NO>>,<<FNAME>>,<<LNAME>>,20100228,Female,DN9 1PB,<<HIST_VACCS_DATE>>,Gardasil9,Batch1,20301231,Right Buttock,1,Y,1,,,[email protected],Clinic,00:01,
2628
N_EmptyDoseSeq,R1L,142181,Bohunt School Wokingham,<<NHS_NO>>,<<FNAME>>,<<LNAME>>,20100228,Female,DN9 1PB,<<HIST_VACCS_DATE>>,Gardasil9,Batch1,20301231,left thigh,,Y,1,,,[email protected],Clinic,00:01,
2729
N_InvalidDoseSeq,R1L,142181,Bohunt School Wokingham,<<NHS_NO>>,<<FNAME>>,<<LNAME>>,20100228,Female,DN9 1PB,<<HIST_VACCS_DATE>>,Gardasil9,Batch1,20301231,left thigh,10,Y,1,,,[email protected],Clinic,00:01,
2830
N_EmptyCareSetting,R1L,142181,Bohunt School Wokingham,<<NHS_NO>>,<<FNAME>>,<<LNAME>>,20100228,Female,DN9 1PB,<<HIST_VACCS_DATE>>,Gardasil9,Batch1,20301231,left thigh,1,Y,,,,[email protected],Clinic,00:01,

test_data/hpv/o_dup_1.csv

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Completed
2+
0 previously imported records were omitted
3+
2 vaccination records

test_data/hpv/o_hist_negative.csv

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ Row 20 VACCINE_GIVEN: Enter a valid vaccine, eg Gardasil9.
2121
Row 21 BATCH_NUMBER: Enter a batch number.
2222
Row 22 BATCH_EXPIRY_DATE: Enter a batch expiry date.
2323
Row 23 ANATOMICAL_SITE: Enter an anatomical site.
24-
Row 25 DOSE_SEQUENCE: The dose sequence number cannot be greater than 3. Enter a dose sequence number, for example, 1, 2 or 3.
25-
Row 26 DOSE_SEQUENCE: must be less than or equal to 3
26-
Row 27 CARE_SETTING: Enter a care setting.
27-
Row 32 TIME_OF_VACCINATION: Enter a time in the correct format
28-
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
29-
Row 35 CARE_SETTING: Enter a valid care setting.
24+
Row 27 DOSE_SEQUENCE: The dose sequence number cannot be greater than 3. Enter a dose sequence number, for example, 1, 2 or 3.
25+
Row 28 DOSE_SEQUENCE: must be less than or equal to 3
26+
Row 29 CARE_SETTING: Enter a care setting.
27+
Row 34 TIME_OF_VACCINATION: Enter a time in the correct format
28+
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
29+
Row 37 CARE_SETTING: Enter a valid care setting.

tests/test_02_sessions.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,16 @@ def test_reg_create_valid_session(self):
2828
self.sessions_page.schedule_a_valid_session()
2929

3030
@pytest.mark.sessions
31-
@pytest.mark.order(202)
31+
@pytest.mark.order(201)
32+
def test_reg_edit_session(self):
33+
self.sessions_page.edit_a_session_to_today()
34+
35+
@pytest.mark.sessions
36+
@pytest.mark.order(203)
3237
def test_reg_delete_all_sessions(self):
3338
self.sessions_page.delete_all_sessions()
3439

3540
@pytest.mark.sessions
36-
@pytest.mark.order(203)
41+
@pytest.mark.order(204)
3742
def test_reg_create_invalid_session(self):
3843
self.sessions_page.create_invalid_session()

0 commit comments

Comments
 (0)