@@ -167,11 +167,11 @@ def fill_nhs_no_for_child(self, child: Child, nhs_no: str) -> None:
167167 def click_invite_to_community_clinic (self ) -> None :
168168 self .invite_to_community_clinic_button .click ()
169169
170- def expect_text_in_main (self , text : str ) -> None :
171- expect (self .page .get_by_role ("main" )).to_contain_text (text )
170+ def expect_vaccination_details (self , key : str , value : str ) -> None :
171+ detail_key = self .page .locator (".nhsuk-summary-list__key" , has_text = key )
172+ detail_value = detail_key .locator ("xpath=following-sibling::*[1]" )
172173
173- def expect_text_in_heading (self , text : str ) -> None :
174- expect (self .page .get_by_role ("heading" )).to_contain_text (text )
174+ expect (detail_value ).to_contain_text (value )
175175
176176 def expect_text_in_alert (self , text : str ) -> None :
177177 expect (self .page .get_by_role ("alert" )).to_contain_text (text )
@@ -214,12 +214,18 @@ def verify_activity_log_for_created_or_matched_child(
214214
215215 self .click_record_for_child (child )
216216 self .click_activity_log ()
217- self .expect_text_in_main ("Consent given" )
218- self .expect_text_in_main (f"Added to the session at { location } " )
217+ self .expect_activity_log_header ("Consent given" )
218+ self .expect_activity_log_header (f"Added to the session at { location } " , any = True )
219219
220220 # FIXME: Update this text when MAVIS-1896/MAV-253 is closed
221221 self .check_log_updates_with_match ()
222222
223+ def expect_activity_log_header (self , header : str , any : bool = False ):
224+ if any :
225+ expect (self .page .get_by_role ("heading" , name = header ).first ).to_be_visible ()
226+ else :
227+ expect (self .page .get_by_role ("heading" , name = header )).to_be_visible ()
228+
223229 def archive_child_record (self ):
224230 self .click_archive_child_record ()
225231 self .click_imported_in_error ()
0 commit comments