Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions mavis/test/data/fhir_immunization_template.json.template
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,10 @@
]
},
"actor": {
"identifier": {
"system": "https://fhir.nhs.uk/Id/ods-organization-code",
"value": "R1L"
},
"display": "Test Nurse"
}
},
Expand Down
9 changes: 9 additions & 0 deletions mavis/test/pages/children/child_record_page.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import time
from datetime import timedelta

from playwright.sync_api import Page, expect

Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -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()
20 changes: 18 additions & 2 deletions tests/test_imms_sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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,
Expand All @@ -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]
Expand Down Expand Up @@ -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"
)