Skip to content

Commit c94f5a7

Browse files
committed
Merge branch 'main' of github.com:mozilla/fx-desktop-qa-automation
2 parents 854aff1 + a94db14 commit c94f5a7

File tree

4 files changed

+84
-17
lines changed

4 files changed

+84
-17
lines changed
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: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,21 @@
11
{
22
"tests": [
3-
"test_demo_ad_address_data_captured_in_doorhanger_and_stored.py",
4-
"test_demo_ad_autofill_name_org.py",
5-
"test_demo_ad_autofill_phone_email.py",
6-
"test_demo_ad_doorhanger_shown_on_valid_address_submission.py",
7-
"test_demo_ad_email_phone_captured_in_doorhanger_and_stored.py",
8-
"test_demo_ad_name_org_captured_in_doorhanger_and_stored.py",
9-
"test_demo_ad_yellow_highlight.py",
10-
"test_demo_cc_add_new_credit_card.py",
11-
"test_demo_cc_clear_form.py",
12-
"test_demo_cc_doorhanger_data_is_stored_in_about_prefs.py",
13-
"test_demo_cc_doorhanger_shown_on_valid_credit_card_submission.py",
14-
"test_demo_cc_dropdown_presence.py",
15-
"test_demo_ad_verify_new_address_added.py",
16-
"test_demo_ad_yellow_highlight_phone_email.py"
3+
"test_demo_ad_address_data_captured_in_doorhanger_and_stored.py",
4+
"test_demo_ad_autofill_name_org.py",
5+
"test_demo_ad_autofill_phone_email.py",
6+
"test_demo_ad_doorhanger_shown_on_valid_address_submission.py",
7+
"test_demo_ad_email_phone_captured_in_doorhanger_and_stored.py",
8+
"test_demo_ad_name_org_captured_in_doorhanger_and_stored.py",
9+
"test_demo_ad_verify_new_address_added.py",
10+
"test_demo_cc_add_new_credit_card.py",
11+
"test_demo_cc_clear_form.py",
12+
"test_demo_cc_doorhanger_data_is_stored_in_about_prefs.py",
13+
"test_demo_cc_doorhanger_shown_on_valid_credit_card_submission.py",
14+
"test_demo_cc_dropdown-presence.py",
15+
"test_demo_cc_yellow_highlight.py",
16+
"test_demo_ad_yellow_highlight_name_org.py",
17+
"test_demo_ad_yellow_highlight_address.py",
18+
"test_demo_ad_yellow_highlight_phone_email.py"
19+
1720
]
1821
}

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)