Skip to content

Commit 5c1aeca

Browse files
authored
Merge pull request #491 from mozilla/Hani/clear_from_address_fields
Hani/l10n ad - clear from address fields
2 parents 74e28af + 90e551d commit 5c1aeca

File tree

2 files changed

+45
-1
lines changed

2 files changed

+45
-1
lines changed
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
import pytest
2+
from selenium.webdriver import Firefox
3+
4+
from modules.browser_object_autofill_popup import AutofillPopup
5+
from modules.page_object_autofill import AddressFill
6+
from modules.util import Utilities
7+
8+
9+
@pytest.fixture()
10+
def test_case():
11+
return "2888565"
12+
13+
14+
def test_demo_ad_clear_address_fields(
15+
driver: Firefox,
16+
region: str,
17+
address_autofill: AddressFill,
18+
util: Utilities,
19+
autofill_popup: AutofillPopup
20+
):
21+
"""
22+
C2888565 - Verify clear functionality after selecting an entry from address fields
23+
"""
24+
# Create fake data and fill it in
25+
address_autofill.open()
26+
address_autofill_data = util.fake_autofill_data(region)
27+
address_autofill.save_information_basic(address_autofill_data)
28+
29+
# Click the "Save" button
30+
autofill_popup.click_doorhanger_button("save")
31+
32+
# List of field labels to be autofilled and verified
33+
fields_to_test = [
34+
"street-address",
35+
"address-level2",
36+
"address-level1", # This will be skipped for DE/FR
37+
"postal-code",
38+
"country"
39+
]
40+
41+
# Loop through each field and perform the autofill test
42+
for field in fields_to_test:
43+
address_autofill.clear_and_verify(autofill_popup, field, address_autofill_data)

l10n_CM/region/Unified.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
"test_demo_ad_yellow_highlight_address.py",
2222
"test_demo_ad_clear_name_org.py",
2323
"test_demo_ad_yellow_highlight_phone_email.py",
24-
"test_demo_ad_clear_name_org.py"
24+
"test_demo_ad_clear_name_org.py",
25+
"test_demo_ad_clear_address_fields.py"
2526
]
2627
}

0 commit comments

Comments
 (0)