33import pytest
44from playwright .sync_api import expect
55
6+ from mavis .test .annotations import issue
67from mavis .test .constants import DeliverySite , Programme , Vaccine
78from mavis .test .helpers .imms_api_helper import ImmsApiHelper
89from mavis .test .helpers .sidekiq_helper import SidekiqHelper
910from mavis .test .pages import ChildrenSearchPage , DashboardPage
11+ from mavis .test .pages .children .child_record_page import ChildRecordPage
1012from mavis .test .pages .log_in_page import LogInPage
1113from mavis .test .pages .start_page import StartPage
14+ from mavis .test .pages .vaccination_record .vaccination_record_page import (
15+ VaccinationRecordPage ,
16+ )
1217from mavis .test .utils import get_current_datetime
1318
1419pytestmark = 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" )
3238def 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