@@ -1189,3 +1189,46 @@ def verify_no_autofill_adaptive_elements(self) -> BasePage:
11891189 "Adaptive history autofill suggestion was not removed after deletion."
11901190 )
11911191 return self
1192+
1193+ @BasePage .context_chrome
1194+ def verify_autofill_adaptive_element (
1195+ self , expected_type : str , expected_url : str
1196+ ) -> BasePage :
1197+ """
1198+ Verify that the adaptive history autofill element has the expected type and URL text.
1199+ This method handles chrome context switching internally.
1200+ Arguments:
1201+ expected_type: Expected type attribute value
1202+ expected_url: Expected URL fragment to be contained in the element text
1203+ """
1204+ autofill_element = self .get_element ("search-result-autofill-adaptive-element" )
1205+ actual_type = autofill_element .get_attribute ("type" )
1206+ actual_text = autofill_element .text
1207+
1208+ assert actual_type == expected_type
1209+ assert expected_url in actual_text
1210+
1211+ return self
1212+
1213+ @BasePage .context_chrome
1214+ def verify_no_autofill_adaptive_elements (self ) -> BasePage :
1215+ """Verify that no adaptive history autofill elements are present."""
1216+ autofill_elements = self .get_elements ("search-result-autofill-adaptive-element" )
1217+ if autofill_elements :
1218+ logging .warning (
1219+ f"Unexpected adaptive autofill elements found: { [el .text for el in autofill_elements ]} "
1220+ )
1221+ assert len (autofill_elements ) == 0 , (
1222+ "Adaptive history autofill suggestion was not removed after deletion."
1223+ )
1224+ return self
1225+
1226+ @BasePage .context_chrome
1227+ def expect_container_label (self , label_expected : str ):
1228+ """
1229+ Verify the container label for user context (container tabs).
1230+ Argument:
1231+ label_expected: The expected label text for the user context container.
1232+ """
1233+ actual_label = self .get_element ("tab-container-label" ).text
1234+ assert actual_label == label_expected
0 commit comments