Skip to content

Commit 3602a2e

Browse files
Merge pull request #838 from NHSDigital/2831-different-performer
2831 different performer
2 parents 8555fba + bbb95ba commit 3602a2e

File tree

3 files changed

+31
-2
lines changed

3 files changed

+31
-2
lines changed

mavis/test/data/fhir_immunization_template.json.template

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,10 @@
9090
]
9191
},
9292
"actor": {
93+
"identifier": {
94+
"system": "https://fhir.nhs.uk/Id/ods-organization-code",
95+
"value": "R1L"
96+
},
9397
"display": "Test Nurse"
9498
}
9599
},

mavis/test/pages/children/child_record_page.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import time
2+
from datetime import timedelta
23

34
from playwright.sync_api import Page, expect
45

@@ -32,6 +33,10 @@ def __init__(self, page: Page) -> None:
3233
self.archive_child_record_link = self.page.get_by_role(
3334
"link", name="Archive child record"
3435
)
36+
self.vaccination_record_link = self.page.get_by_role(
37+
"link",
38+
name=(get_current_datetime() - timedelta(days=1)).strftime("%-d %B %Y"),
39+
)
3540

3641
@step("Click on {2} session for programme")
3742
def click_session_for_programme(
@@ -87,3 +92,7 @@ def click_archive_child_record(self) -> None:
8792

8893
def check_child_is_unarchived(self) -> None:
8994
expect(self.archive_child_record_link).to_be_visible()
95+
96+
@step("Click on Vaccination record link")
97+
def click_vaccination_record_link(self) -> None:
98+
self.vaccination_record_link.click()

tests/test_imms_sync.py

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,17 @@
33
import pytest
44
from playwright.sync_api import expect
55

6+
from mavis.test.annotations import issue
67
from mavis.test.constants import DeliverySite, Programme, Vaccine
78
from mavis.test.helpers.imms_api_helper import ImmsApiHelper
89
from mavis.test.helpers.sidekiq_helper import SidekiqHelper
910
from mavis.test.pages import ChildrenSearchPage, DashboardPage
11+
from mavis.test.pages.children.child_record_page import ChildRecordPage
1012
from mavis.test.pages.log_in_page import LogInPage
1113
from mavis.test.pages.start_page import StartPage
14+
from mavis.test.pages.vaccination_record.vaccination_record_page import (
15+
VaccinationRecordPage,
16+
)
1217
from mavis.test.utils import get_current_datetime
1318

1419
pytestmark = pytest.mark.imms_api
@@ -29,6 +34,7 @@ def setup_session_for_flu(setup_session_and_batches_with_fixed_child):
2934
return setup_session_and_batches_with_fixed_child(Programme.FLU)
3035

3136

37+
@issue("MAV-2831")
3238
def test_create_imms_record_then_verify_on_children_page(
3339
imms_api_helper,
3440
page,
@@ -47,7 +53,11 @@ def test_create_imms_record_then_verify_on_children_page(
4753
2. Verify the record was created successfully
4854
3. Navigate to MAVIS login page
4955
4. Log in as a nurse
50-
5. Verify the child created via IMMS API is visible in MAVIS children page
56+
5. Navigate to the children page
57+
6. Search for the child associated with the vaccination record
58+
Verification:
59+
- The child appears in the search results on the children page
60+
- The vaccination record details match those created via the IMMS API
5161
"""
5262
child = children[Programme.FLU][0]
5363
school = schools[Programme.FLU][0]
@@ -79,5 +89,11 @@ def test_create_imms_record_then_verify_on_children_page(
7989

8090
# Verify the child appears in search results
8191
child_card_locator = ChildrenSearchPage(page).search.get_patient_card_locator(child)
82-
expect(child_card_locator).to_be_visible()
8392
expect(child_card_locator).to_contain_text("FluVaccinated")
93+
94+
ChildrenSearchPage(page).search.click_child(child)
95+
ChildRecordPage(page).click_vaccination_record_link()
96+
VaccinationRecordPage(page).expect_vaccination_details("Outcome", "Vaccinated")
97+
VaccinationRecordPage(page).expect_vaccination_details(
98+
"Source", "External source such as GP practice"
99+
)

0 commit comments

Comments
 (0)