Skip to content

Commit fc9a82b

Browse files
authored
Merge branch 'main' into Hani/clear_from_tel_email
2 parents 709fca3 + c94f5a7 commit fc9a82b

File tree

5 files changed

+75
-5
lines changed

5 files changed

+75
-5
lines changed

.github/workflows/check-devedition.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ jobs:
1212
Check-DevEdition-Version:
1313
runs-on: ubuntu-latest
1414
outputs:
15-
reportable: ${{ steps.reportable.outputs.test }}
15+
win_reportable: ${{ steps.reportable.outputs.win }}
16+
mac_reportable: ${{ steps.reportable.outputs.mac }}
1617
steps:
1718
- name: Checkout repository
1819
uses: actions/checkout@v4
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
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 "2888564"
12+
13+
14+
def test_address_yellow_highlight_address_fields(
15+
driver: Firefox,
16+
region: str,
17+
address_autofill: AddressFill,
18+
util: Utilities,
19+
autofill_popup: AutofillPopup,
20+
):
21+
"""
22+
C2888564 - Verify the yellow highlight appears on autofilled fields for the address fields.
23+
"""
24+
25+
# Instantiate objects
26+
address_autofill_popup = AutofillPopup(driver)
27+
28+
# Create fake data and fill it in
29+
address_autofill.open()
30+
address_autofill_data = util.fake_autofill_data(region)
31+
address_autofill.save_information_basic(address_autofill_data)
32+
33+
# Click the "Save" button
34+
address_autofill_popup.click_doorhanger_button("save")
35+
36+
# Double click inside street address field and select a saved address entry from the dropdown
37+
address_autofill.double_click("form-field", labels=["street-address"])
38+
39+
# Click on the first element from the autocomplete dropdown
40+
first_item = address_autofill_popup.get_nth_element(1)
41+
address_autofill_popup.click_on(first_item)
42+
43+
# Verify the address fields are highlighted
44+
address_autofill.verify_field_yellow_highlights(
45+
region=region,
46+
fields_to_test=[
47+
"street-address",
48+
"address-level2",
49+
"address-level1",
50+
"postal-code",
51+
"country",
52+
],
53+
expected_highlighted_fields=[
54+
"street-address",
55+
"address-level2",
56+
"address-level1",
57+
"postal-code",
58+
"country",
59+
],
60+
)

l10n_CM/Unified/test_demo_ad_yellow_highlight.py renamed to l10n_CM/Unified/test_demo_ad_yellow_highlight_name_org.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ def test_case():
1414
def test_address_yellow_highlight_on_name_organization_fields(
1515
driver: Firefox,
1616
region: str,
17-
util: Utilities,
1817
address_autofill: AddressFill,
18+
util: Utilities,
1919
autofill_popup: AutofillPopup,
2020
):
2121
"""
@@ -30,7 +30,7 @@ def test_address_yellow_highlight_on_name_organization_fields(
3030
# Click the "Save" button
3131
autofill_popup.click_doorhanger_button("save")
3232

33-
# Double click inside phone field and select a saved address entry from the dropdown
33+
# Double click inside name field and select a saved address entry from the dropdown
3434
address_autofill.double_click("form-field", labels=["name"])
3535

3636
# Click on the first element from the autocomplete dropdown

l10n_CM/region/Unified.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@
1414
"test_demo_cc_dropdown_presence.py",
1515
"test_demo_ad_verify_new_address_added.py",
1616
"test_demo_ad_yellow_highlight_phone_email.py",
17-
"test_demo_ad_clear_tel_email.py"
17+
"test_demo_ad_clear_tel_email.py",
18+
"test_demo_cc_dropdown-presence.py",
19+
"test_demo_cc_yellow_highlight.py",
20+
"test_demo_ad_yellow_highlight_name_org.py",
21+
"test_demo_ad_yellow_highlight_address.py"
22+
1823
]
1924
}

modules/page_object_autofill.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -559,11 +559,15 @@ def verify_autofill_data(
559559
)
560560

561561
def verify_field_yellow_highlights(
562-
self, fields_to_test=None, expected_highlighted_fields=None
562+
self, region=None, fields_to_test=None, expected_highlighted_fields=None
563563
):
564564
if fields_to_test is None:
565565
fields_to_test = self.fields # By default, test all address fields
566566

567+
# Skip 'address-level1' if region is DE or FR
568+
if region in ["DE", "FR"] and "address-level1" in fields_to_test:
569+
fields_to_test.remove("address-level1")
570+
567571
return self.verify_field_highlight(
568572
fields_to_test=fields_to_test,
569573
expected_highlighted_fields=expected_highlighted_fields,

0 commit comments

Comments
 (0)