Skip to content

Commit 74e121a

Browse files
testing further
1 parent e4a45f0 commit 74e121a

File tree

4 files changed

+20
-25
lines changed

4 files changed

+20
-25
lines changed

l10n_CM/constants/fnac/FR/fnac_cc.json

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,5 @@
1313
"3181324d-01b3-4665-bdd9-5de4be475336",
1414
"bc2807a3-960e-4071-9cf0-5713b340911a"
1515
],
16-
"skipped": [
17-
"test_demo_cc_1_dropdown.py",
18-
"test_demo_cc_2_preview.py",
19-
"test_demo_cc_3_autofill.py",
20-
"test_demo_cc_5_clear.py"
21-
]
16+
"skipped": []
2217
}

modules/browser_object_autofill_popup.py

Lines changed: 12 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,13 @@ def ensure_autofill_dropdown_not_visible(self):
3131
checks if the parent pop up component has hidden attribute.
3232
"""
3333
self.element_exists("pop-up-component")
34-
self.expect_element_attribute_contains("pop-up-component", "hidden", "true")
34+
popup_component = self.get_element("pop-up-component")
35+
if len(popup_component.get_attribute("innerHTML")) > 1:
36+
self.expect_element_attribute_contains(
37+
"pop-up-component-box", "style", "0px;"
38+
)
39+
else:
40+
self.expect_element_attribute_contains("pop-up-component", "hidden", "true")
3541
return self
3642

3743
@BasePage.context_chrome
@@ -40,15 +46,7 @@ def ensure_autofill_dropdown_visible(self):
4046
Verifies that the autofill dropdown appears
4147
checks if the parent pop up component has hidden attribute.
4248
"""
43-
self.expect(
44-
lambda _: len(
45-
self.get_element("pop-up-component").get_attribute("innerHTML")
46-
)
47-
> 1
48-
)
49-
assert self.get_element("pop-up-component").get_attribute("hidden") is None, (
50-
"Pop up autofill panel hidden."
51-
)
49+
self.element_clickable("pop-up-component-box")
5250
return self
5351

5452
@BasePage.context_chrome
@@ -109,19 +107,16 @@ def select_nth_element(self, index: int):
109107
Arguments:
110108
index (int): The index of the element to retrieve (1-based)
111109
"""
112-
self.wait.until(
113-
EC.element_to_be_clickable(
114-
self.get_element("select-form-option-by-index", labels=[str(index)])
115-
)
116-
)
117-
self.get_element("select-form-option-by-index", labels=[str(index)]).click()
110+
self.element_clickable("select-form-option-by-index", labels=[str(index)])
111+
self.click_on("select-form-option-by-index", labels=[str(index)])
118112

119113
@BasePage.context_chrome
120114
def select_autofill_panel(self):
121115
"""
122116
Select the first autofill panel in the autocomplete list.
123117
"""
124-
self.get_element("select-form-option-autofill").click()
118+
self.element_clickable("select-form-option-autofill")
119+
self.click_on("select-form-option-autofill")
125120
return self
126121

127122
@BasePage.context_chrome

modules/data/autofill_popup.components.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,11 @@
4343
"doNotCache"
4444
]
4545
},
46+
"pop-up-component-box": {
47+
"selectorData": "#PopupAutoComplete richlistbox",
48+
"strategy": "css",
49+
"groups": []
50+
},
4651
"select-form-option": {
4752
"selectorData": "#PopupAutoComplete .autocomplete-richlistitem",
4853
"strategy": "css",

modules/page_object_autofill.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -523,7 +523,7 @@ def sanitize_preview_data(self, field, value, region):
523523
value = self.util.normalize_regional_phone_numbers(value, region)
524524
return value
525525

526-
def select_autofill_option(self, field, index: int = 1):
526+
def select_autofill_option(self, field):
527527
"""
528528
Presses the autofill panel that pops up after you double-click an input field
529529
@@ -537,7 +537,7 @@ def select_autofill_option(self, field, index: int = 1):
537537
autofill_field.clear()
538538
self.double_click("form-field", labels=[field])
539539
self.autofill_popup.ensure_autofill_dropdown_visible()
540-
self.autofill_popup.select_nth_element(index)
540+
self.autofill_popup.select_autofill_panel()
541541
else:
542542
logging.info(f"Field: {field} is a select element. No autofill option.")
543543
return self

0 commit comments

Comments
 (0)