@@ -26,29 +26,32 @@ def verify_element_displayed(self, reference: Union[str, tuple, WebElement]):
2626 @BasePage .context_chrome
2727 def ensure_autofill_dropdown_not_visible (self ):
2828 """
29- Verifies that the autofill dropdown does NOT appear
30- checks if the parent pop up component have children elements before explicit wait .
29+ Verifies that the autofill dropdown does not appear
30+ checks if the parent pop up component has hidden attribute .
3131 """
3232 self .element_exists ("pop-up-component" )
3333 popup_component = self .get_element ("pop-up-component" )
34- if popup_component and len (popup_component .get_attribute ("innerHTML" )) > 1 :
35- self .element_not_visible ("select-form-option" )
34+ if len (popup_component .get_attribute ("innerHTML" )) > 1 :
35+ self .expect_element_attribute_contains (
36+ "pop-up-component-box" , "style" , "0px;"
37+ )
38+ else :
39+ self .expect_element_attribute_contains ("pop-up-component" , "hidden" , "true" )
3640 return self
3741
3842 @BasePage .context_chrome
39- def ensure_autofill_dropdown_visible (self , field_element : WebElement = None ):
43+ def ensure_autofill_dropdown_visible (self ):
4044 """
4145 Verifies that the autofill dropdown appears
42- checks if the parent pop up component have children elements before explicit wait.
43-
44- Arguments:
45- field_element: if field element is given.
46- check whether it is a select element. pass the check if it is.
46+ checks if the parent pop up component has hidden attribute.
4747 """
48- self .element_exists ("pop-up-component" )
49- popup_component = self .get_element ("pop-up-component" )
50- if popup_component :
51- self .element_visible ("select-form-option" )
48+ self .element_clickable ("pop-up-component-box" )
49+ return self
50+
51+ @BasePage .context_chrome
52+ def hover_over_autofill_panel (self ):
53+ self .element_visible ("select-form-option" )
54+ self .hover ("select-form-option" )
5255 return self
5356
5457 # Interaction with popup elements
@@ -103,12 +106,17 @@ def select_nth_element(self, index: int):
103106 Arguments:
104107 index (int): The index of the element to retrieve (1-based)
105108 """
106- self .wait .until (
107- EC .element_to_be_clickable (
108- self .get_element ("select-form-option-by-index" , labels = [str (index )])
109- )
110- )
111- self .get_element ("select-form-option-by-index" , labels = [str (index )]).click ()
109+ self .element_clickable ("pop-up-component-box" )
110+ self .click_on ("select-form-option-by-index" , labels = [str (index )])
111+
112+ @BasePage .context_chrome
113+ def select_autofill_panel (self ):
114+ """
115+ Select the first autofill panel in the autocomplete list.
116+ """
117+ self .element_clickable ("select-form-option-autofill" )
118+ self .click_on ("select-form-option-autofill" )
119+ return self
112120
113121 @BasePage .context_chrome
114122 def get_primary_value (self , element : WebElement ) -> str :
0 commit comments