diff --git a/mavis/test/data/fhir_immunization_template.json.template b/mavis/test/data/fhir_immunization_template.json.template index 895a8829208..042cf3616d5 100644 --- a/mavis/test/data/fhir_immunization_template.json.template +++ b/mavis/test/data/fhir_immunization_template.json.template @@ -90,6 +90,10 @@ ] }, "actor": { + "identifier": { + "system": "https://fhir.nhs.uk/Id/ods-organization-code", + "value": "R1L" + }, "display": "Test Nurse" } }, diff --git a/mavis/test/pages/children/child_record_page.py b/mavis/test/pages/children/child_record_page.py index e4d03eaa6a8..471bc72619c 100644 --- a/mavis/test/pages/children/child_record_page.py +++ b/mavis/test/pages/children/child_record_page.py @@ -1,4 +1,5 @@ import time +from datetime import timedelta from playwright.sync_api import Page, expect @@ -32,6 +33,10 @@ def __init__(self, page: Page) -> None: self.archive_child_record_link = self.page.get_by_role( "link", name="Archive child record" ) + self.vaccination_record_link = self.page.get_by_role( + "link", + name=(get_current_datetime() - timedelta(days=1)).strftime("%-d %B %Y"), + ) @step("Click on {2} session for programme") def click_session_for_programme( @@ -87,3 +92,7 @@ def click_archive_child_record(self) -> None: def check_child_is_unarchived(self) -> None: expect(self.archive_child_record_link).to_be_visible() + + @step("Click on Vaccination record link") + def click_vaccination_record_link(self) -> None: + self.vaccination_record_link.click() diff --git a/tests/test_imms_sync.py b/tests/test_imms_sync.py index 5221992b008..7f9b1ddf01f 100644 --- a/tests/test_imms_sync.py +++ b/tests/test_imms_sync.py @@ -3,12 +3,17 @@ import pytest from playwright.sync_api import expect +from mavis.test.annotations import issue from mavis.test.constants import DeliverySite, Programme, Vaccine from mavis.test.helpers.imms_api_helper import ImmsApiHelper from mavis.test.helpers.sidekiq_helper import SidekiqHelper from mavis.test.pages import ChildrenSearchPage, DashboardPage +from mavis.test.pages.children.child_record_page import ChildRecordPage from mavis.test.pages.log_in_page import LogInPage from mavis.test.pages.start_page import StartPage +from mavis.test.pages.vaccination_record.vaccination_record_page import ( + VaccinationRecordPage, +) from mavis.test.utils import get_current_datetime pytestmark = pytest.mark.imms_api @@ -29,6 +34,7 @@ def setup_session_for_flu(setup_session_and_batches_with_fixed_child): return setup_session_and_batches_with_fixed_child(Programme.FLU) +@issue("MAV-2831") def test_create_imms_record_then_verify_on_children_page( imms_api_helper, page, @@ -47,7 +53,11 @@ def test_create_imms_record_then_verify_on_children_page( 2. Verify the record was created successfully 3. Navigate to MAVIS login page 4. Log in as a nurse - 5. Verify the child created via IMMS API is visible in MAVIS children page + 5. Navigate to the children page + 6. Search for the child associated with the vaccination record + Verification: + - The child appears in the search results on the children page + - The vaccination record details match those created via the IMMS API """ child = children[Programme.FLU][0] school = schools[Programme.FLU][0] @@ -79,5 +89,11 @@ def test_create_imms_record_then_verify_on_children_page( # Verify the child appears in search results child_card_locator = ChildrenSearchPage(page).search.get_patient_card_locator(child) - expect(child_card_locator).to_be_visible() expect(child_card_locator).to_contain_text("FluVaccinated") + + ChildrenSearchPage(page).search.click_child(child) + ChildRecordPage(page).click_vaccination_record_link() + VaccinationRecordPage(page).expect_vaccination_details("Outcome", "Vaccinated") + VaccinationRecordPage(page).expect_vaccination_details( + "Source", "External source such as GP practice" + )