Skip to content

Commit d7bcfc1

Browse files
new flag for region independent tests
1 parent dd2672a commit d7bcfc1

13 files changed

+57
-54
lines changed

l10n_CM/Unified/conftest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
@pytest.fixture()
1313
def region():
14-
return os.environ.get("FX_REGION", "US")
14+
return os.environ.get("FX_REGION", "FR")
1515

1616

1717
@pytest.fixture()

l10n_CM/Unified/test_demo_ad_verify_new_address_added.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ def region():
2020
@pytest.fixture()
2121
def add_prefs(region: str):
2222
return [
23-
("browser.search.region", region),
2423
("extensions.formautofill.creditCards.supportedCountries", region),
2524
("extensions.formautofill.addresses.supported", "on"),
2625
]

l10n_CM/Unified/test_demo_ad_yellow_highlight.py

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,31 +12,30 @@ def test_case():
1212

1313

1414
def test_address_yellow_highlight_on_name_organization_fields(
15-
driver: Firefox, region: str
15+
driver: Firefox,
16+
region: str,
17+
util: Utilities,
18+
address_autofill: AddressFill,
19+
autofill_popup: AutofillPopup,
1620
):
1721
"""
1822
C2888559 - Verify the yellow highlight appears on autofilled fields for name and organization.
1923
"""
2024

21-
# Instantiate objects
22-
address_autofill = AddressFill(driver)
23-
address_autofill_popup = AutofillPopup(driver)
24-
util = Utilities()
25-
2625
# Create fake data and fill it in
2726
address_autofill.open()
2827
address_autofill_data = util.fake_autofill_data(region)
2928
address_autofill.save_information_basic(address_autofill_data)
3029

3130
# Click the "Save" button
32-
address_autofill_popup.click_doorhanger_button("save")
31+
autofill_popup.click_doorhanger_button("save")
3332

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

3736
# Click on the first element from the autocomplete dropdown
38-
first_item = address_autofill_popup.get_nth_element(1)
39-
address_autofill_popup.click_on(first_item)
37+
first_item = autofill_popup.get_nth_element(1)
38+
autofill_popup.click_on(first_item)
4039

4140
# Verify the name and organization fields are highlighted
4241
address_autofill.verify_field_yellow_highlights(

l10n_CM/Unified/test_demo_cc_add_new_credit_card.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ def test_case():
1414

1515
def test_create_new_cc_profile(
1616
driver: Firefox,
17-
region: str,
1817
util: Utilities,
1918
about_prefs_privacy: AboutPrefs,
2019
about_prefs: AboutPrefs,

l10n_CM/Unified/test_demo_cc_doorhanger_data_is_stored_in_about_prefs.py

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,16 @@ def test_case():
1414
return "2886597"
1515

1616

17-
def test_demo_cc_data_captured_in_doorhanger_and_stored(driver: Firefox, region: str):
17+
def test_demo_cc_data_captured_in_doorhanger_and_stored(
18+
driver: Firefox,
19+
credit_card_fill_obj: CreditCardFill,
20+
autofill_popup: AutofillPopup,
21+
util: Utilities,
22+
about_prefs_privacy: AboutPrefs,
23+
):
1824
"""
1925
C2889999 - Verify credit card data is captured in the Capture Doorhanger and stored in about:preferences
2026
"""
21-
22-
# Instantiate objects
23-
credit_card_fill_obj = CreditCardFill(driver)
24-
autofill_popup_obj = AutofillPopup(driver)
25-
util = Utilities()
26-
browser_action_obj = BrowserActions(driver)
27-
2827
# Navigate to page
2928
credit_card_fill_obj.open()
3029

@@ -33,12 +32,12 @@ def test_demo_cc_data_captured_in_doorhanger_and_stored(driver: Firefox, region:
3332
credit_card_fill_obj.fill_credit_card_info(credit_card_sample_data)
3433

3534
# The "Save credit card?" doorhanger is displayed
36-
assert autofill_popup_obj.element_visible("doorhanger-save-button"), (
35+
assert autofill_popup.element_visible("doorhanger-save-button"), (
3736
"Credit card save doorhanger is not visible"
3837
)
3938

4039
# Verify Credit Card Doorhanger Data
41-
doorhanger_text = autofill_popup_obj.get_cc_doorhanger_data("cc-doorhanger-data")
40+
doorhanger_text = autofill_popup.get_cc_doorhanger_data("cc-doorhanger-data")
4241
assert credit_card_sample_data.card_number[-4:] in doorhanger_text, (
4342
f"Expected last 4 digits '{credit_card_sample_data.card_number[-4:]}' but not found."
4443
)
@@ -50,17 +49,18 @@ def test_demo_cc_data_captured_in_doorhanger_and_stored(driver: Firefox, region:
5049
)
5150

5251
# Click the "Save" button using click_doorhanger_button
53-
autofill_popup_obj.click_doorhanger_button("save")
52+
autofill_popup.click_doorhanger_button("save")
5453

5554
# Navigate to about:preferences#privacy => "Autofill" section
56-
about_prefs = AboutPrefs(driver, category="privacy").open()
57-
iframe = about_prefs.get_saved_payments_popup_iframe()
58-
browser_action_obj.switch_to_iframe_context(iframe)
55+
about_prefs_privacy.open()
56+
about_prefs_privacy.switch_to_saved_payments_popup_iframe()
5957

6058
# Get stored values
6159
elements = [
6260
x.strip()
63-
for x in about_prefs.get_element("saved-credit-cards-values").text.split(",")
61+
for x in about_prefs_privacy.get_element(
62+
"saved-credit-cards-values"
63+
).text.split(",")
6464
]
6565

6666
# Validate stored values match expected values

l10n_CM/Unified/test_demo_cc_doorhanger_shown_on_valid_credit_card_submission.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ def test_case():
1313

1414
def test_cc_check_door_hanger_is_displayed(
1515
driver: Firefox,
16-
region: str,
1716
util: Utilities,
1817
autofill_popup: AutofillPopup,
1918
credit_card_fill_obj: CreditCardFill,

l10n_CM/Unified/test_demo_cc_yellow_highlight.py

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -11,27 +11,23 @@ def test_case():
1111
return "2886601"
1212

1313

14-
def test_cc_yellow_highlight(driver: Firefox):
14+
def test_cc_yellow_highlight(
15+
driver: Firefox,
16+
util: Utilities,
17+
about_prefs_privacy: AboutPrefs,
18+
about_prefs: AboutPrefs,
19+
credit_card_fill_obj: CreditCardFill,
20+
autofill_popup: AutofillPopup,
21+
):
1522
"""
1623
C2886601 - Verify the yellow highlight appears on autofilled fields and make sure csv field is not highlighted
1724
"""
1825

19-
# Initialize objects
20-
util = Utilities()
21-
about_prefs = AboutPrefs(driver, category="privacy")
22-
about_prefs_cc_popup = AboutPrefs(driver)
23-
browser_action_obj = BrowserActions(driver)
24-
credit_card_fill_obj = CreditCardFill(driver)
25-
autofill_popup = AutofillPopup(driver)
26-
2726
# Save a credit card in about:preferences
28-
about_prefs.open()
29-
iframe = about_prefs.get_saved_payments_popup_iframe()
30-
browser_action_obj.switch_to_iframe_context(iframe)
27+
about_prefs_privacy.open()
28+
about_prefs_privacy.switch_to_saved_payments_popup_iframe()
3129
credit_card_sample_data = util.fake_credit_card_data()
32-
about_prefs_cc_popup.click_on(
33-
"panel-popup-button", labels=["autofill-manage-add-button"]
34-
)
30+
about_prefs.click_on("panel-popup-button", labels=["autofill-manage-add-button"])
3531
about_prefs.fill_cc_panel_information(credit_card_sample_data)
3632

3733
# Open the credit card fill form and trigger the autofill option

l10n_CM/region/Isolated.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"tests": [
3+
"test_demo_cc_add_new_credit_card.py",
4+
"test_demo_cc_clear_form.py",
5+
"test_demo_cc_doorhanger_data_is_stored_in_about_prefs.py",
6+
"test_demo_cc_doorhanger_shown_on_valid_credit_card_submission.py",
7+
"test_demo_cc_dropdown_presence.py",
8+
"test_demo_cc_yellow_highlight.py"
9+
]
10+
}

l10n_CM/region/US.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
"region": "US",
33
"tests": [
4+
"test_demo_ad_verify_new_address_added.py"
45
]
56
}

0 commit comments

Comments
 (0)