@@ -26,29 +26,32 @@ def verify_element_displayed(self, reference: Union[str, tuple, WebElement]):
26
26
@BasePage .context_chrome
27
27
def ensure_autofill_dropdown_not_visible (self ):
28
28
"""
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 .
31
31
"""
32
32
self .element_exists ("pop-up-component" )
33
33
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" )
36
40
return self
37
41
38
42
@BasePage .context_chrome
39
- def ensure_autofill_dropdown_visible (self , field_element : WebElement = None ):
43
+ def ensure_autofill_dropdown_visible (self ):
40
44
"""
41
45
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.
47
47
"""
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" )
52
55
return self
53
56
54
57
# Interaction with popup elements
@@ -103,12 +106,17 @@ def select_nth_element(self, index: int):
103
106
Arguments:
104
107
index (int): The index of the element to retrieve (1-based)
105
108
"""
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
112
120
113
121
@BasePage .context_chrome
114
122
def get_primary_value (self , element : WebElement ) -> str :
0 commit comments