Skip to content

Commit 252c7c3

Browse files
rename and minor change to about_prefs naming
1 parent a2e3355 commit 252c7c3

11 files changed

+65
-79
lines changed

l10n_CM/Unified/conftest.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ def address_autofill(driver):
3838

3939

4040
@pytest.fixture()
41-
def address_autofill_popup(driver):
41+
def autofill_popup(driver):
4242
yield AutofillPopup(driver)
4343

4444

@@ -48,12 +48,12 @@ def util():
4848

4949

5050
@pytest.fixture()
51-
def about_prefs(driver):
51+
def about_prefs_privacy(driver):
5252
yield AboutPrefs(driver, category="privacy")
5353

5454

5555
@pytest.fixture()
56-
def about_prefs_cc_popup(driver):
56+
def about_prefs(driver):
5757
yield AboutPrefs(driver)
5858

5959

l10n_CM/Unified/test_demo_ad_address_data_captured_in_doorhanger_and_stored.py

Lines changed: 12 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ def test_demo_ad_address_data_captured_in_doorhanger_and_stored(
1717
region: str,
1818
address_autofill: AddressFill,
1919
util: Utilities,
20-
address_autofill_popup: AutofillPopup,
21-
about_prefs: AboutPrefs,
20+
autofill_popup: AutofillPopup,
21+
about_prefs_privacy: AboutPrefs,
2222
):
2323
"""
2424
C2888703 - Verify Address data are captured in the Capture Doorhanger and stored in about:preferences
@@ -29,24 +29,20 @@ def test_demo_ad_address_data_captured_in_doorhanger_and_stored(
2929
address_autofill.save_information_basic(address_autofill_data)
3030

3131
# The "Save address?" doorhanger is displayed
32-
address_autofill_popup.element_visible("address-save-doorhanger")
32+
autofill_popup.element_visible("address-save-doorhanger")
3333

3434
# containing Street Address field
3535
expected_street_add = address_autofill_data.street_address
36-
address_autofill_popup.element_has_text(
37-
"address-doorhanger-street", expected_street_add
38-
)
36+
autofill_popup.element_has_text("address-doorhanger-street", expected_street_add)
3937

4038
# containing City field
4139
expected_city = address_autofill_data.address_level_2
42-
address_autofill_popup.element_has_text("address-doorhanger-city", expected_city)
40+
autofill_popup.element_has_text("address-doorhanger-city", expected_city)
4341

4442
expected_state = address_autofill_data.address_level_1
4543
if region not in ["FR", "DE"]:
4644
state_abbreviation = util.get_state_province_abbreviation(expected_state)
47-
address_autofill_popup.element_has_text(
48-
"address-doorhanger-state", state_abbreviation
49-
)
45+
autofill_popup.element_has_text("address-doorhanger-state", state_abbreviation)
5046

5147
# Verify Zip Code field (Different selector for DE/FR)
5248
expected_zip = address_autofill_data.postal_code
@@ -55,23 +51,21 @@ def test_demo_ad_address_data_captured_in_doorhanger_and_stored(
5551
if region in ["FR", "DE"]
5652
else "address-doorhanger-zip"
5753
)
58-
address_autofill_popup.element_has_text(zip_selector, expected_zip)
54+
autofill_popup.element_has_text(zip_selector, expected_zip)
5955

6056
# containing Country field
6157
expected_country = address_autofill_data.country
62-
address_autofill_popup.element_has_text(
63-
"address-doorhanger-country", expected_country
64-
)
58+
autofill_popup.element_has_text("address-doorhanger-country", expected_country)
6559

6660
# Click the "Save" button
67-
address_autofill_popup.click_doorhanger_button("save")
61+
autofill_popup.click_doorhanger_button("save")
6862

6963
# Navigate to about:preferences#privacy => "Autofill" section
70-
about_prefs.open()
71-
about_prefs.switch_to_saved_addresses_popup_iframe()
64+
about_prefs_privacy.open()
65+
about_prefs_privacy.switch_to_saved_addresses_popup_iframe()
7266

7367
# Verify saved addresses
74-
elements = about_prefs.get_elements("saved-addresses-values")
68+
elements = about_prefs_privacy.get_elements("saved-addresses-values")
7569

7670
# Expected values for verification
7771
expected_values = [

l10n_CM/Unified/test_demo_ad_doorhanger_shown_on_valid_address_submission.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,15 @@ def test_address_doorhanger_displayed_after_entering_valid_address(
1616
region: str,
1717
address_autofill: AddressFill,
1818
util: Utilities,
19-
address_autofill_popup: AutofillPopup,
19+
autofill_popup: AutofillPopup,
2020
):
2121
"""
22-
C2886581 - Verify the Capture Doorhanger is displayed after entering valid Address data
22+
C2886581 - Verify the Capture Door hanger is displayed after entering valid Address data
2323
"""
2424
# Create fake data and fill it in
2525
address_autofill.open()
2626
address_autofill_data = util.fake_autofill_data(region)
2727
address_autofill.save_information_basic(address_autofill_data)
2828

29-
# Check "Save Address?" doorhanger appears in the Address bar
30-
address_autofill_popup.element_visible("address-save-doorhanger")
29+
# Check "Save Address?" door hanger appears in the Address bar
30+
autofill_popup.element_visible("address-save-doorhanger")

l10n_CM/Unified/test_demo_ad_email_phone_captured_in_doorhanger_and_stored.py

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ def test_demo_ad_email_phone_captured_in_doorhanger_and_stored(
1717
region: str,
1818
address_autofill: AddressFill,
1919
util: Utilities,
20-
address_autofill_popup: AutofillPopup,
21-
about_prefs: AboutPrefs,
20+
autofill_popup: AutofillPopup,
21+
about_prefs_privacy: AboutPrefs,
2222
):
2323
"""
2424
C2888704 - Verify tele/email data are captured in the Capture Doorhanger and stored in about:preferences
@@ -30,33 +30,31 @@ def test_demo_ad_email_phone_captured_in_doorhanger_and_stored(
3030
address_autofill.save_information_basic(address_autofill_data)
3131

3232
# The "Save address?" doorhanger is displayed
33-
address_autofill_popup.element_visible("address-save-doorhanger")
33+
autofill_popup.element_visible("address-save-doorhanger")
3434

3535
# containing email field
3636
expected_email = address_autofill_data.email
37-
address_autofill_popup.element_has_text("address-doorhanger-email", expected_email)
37+
autofill_popup.element_has_text("address-doorhanger-email", expected_email)
3838

3939
# containing phone field
4040
expected_phone = address_autofill_data.telephone
4141
with driver.context(driver.CONTEXT_CHROME):
42-
actual_phone = address_autofill_popup.get_element(
43-
"address-doorhanger-phone"
44-
).text
42+
actual_phone = autofill_popup.get_element("address-doorhanger-phone").text
4543
normalize_expected = util.normalize_phone_number(expected_phone)
4644
normalized_actual = util.normalize_phone_number(actual_phone)
4745
assert normalized_actual == normalize_expected
4846

4947
# Click the "Save" button
50-
address_autofill_popup.click_doorhanger_button("save")
48+
autofill_popup.click_doorhanger_button("save")
5149

5250
# Navigate to about:preferences#privacy => "Autofill" section
53-
about_prefs.open()
54-
about_prefs.switch_to_saved_addresses_popup_iframe()
51+
about_prefs_privacy.open()
52+
about_prefs_privacy.switch_to_saved_addresses_popup_iframe()
5553

5654
# The address saved in step 2 is listed in the "Saved addresses" modal: Email and phone
5755
elements = map(
5856
data_sanitizer,
59-
about_prefs.get_element("saved-addresses-values").text.split(","),
57+
about_prefs_privacy.get_element("saved-addresses-values").text.split(","),
6058
)
6159
expected_values = [expected_phone, expected_email]
6260
found_email_phone = list(set(elements) & set(expected_values))

l10n_CM/Unified/test_demo_ad_name_org_captured_in_doorhanger_and_stored.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ def test_demo_ad_name_org_captured_in_doorhanger_and_stored(
1717
region: str,
1818
address_autofill: AddressFill,
1919
util: Utilities,
20-
address_autofill_popup: AutofillPopup,
21-
about_prefs: AboutPrefs,
20+
autofill_popup: AutofillPopup,
21+
about_prefs_privacy: AboutPrefs,
2222
):
2323
"""
2424
C2888701 - Verify name/org fields are captured in the Capture Doorhanger and stored in about:preferences
@@ -29,25 +29,25 @@ def test_demo_ad_name_org_captured_in_doorhanger_and_stored(
2929
address_autofill.save_information_basic(address_autofill_data)
3030

3131
# The "Save address?" doorhanger is displayed
32-
address_autofill_popup.element_visible("address-save-doorhanger")
32+
autofill_popup.element_visible("address-save-doorhanger")
3333

3434
# containing name field
3535
expected_name = address_autofill_data.name
36-
address_autofill_popup.element_has_text("address-doorhanger-name", expected_name)
36+
autofill_popup.element_has_text("address-doorhanger-name", expected_name)
3737

3838
# containing org field
3939
expected_org = address_autofill_data.organization
40-
address_autofill_popup.element_has_text("address-doorhanger-org", expected_org)
40+
autofill_popup.element_has_text("address-doorhanger-org", expected_org)
4141

4242
# Click the "Save" button
43-
address_autofill_popup.click_doorhanger_button("save")
43+
autofill_popup.click_doorhanger_button("save")
4444

4545
# Navigate to about:preferences#privacy => "Autofill" section
46-
about_prefs.open()
47-
about_prefs.switch_to_saved_addresses_popup_iframe()
46+
about_prefs_privacy.open()
47+
about_prefs_privacy.switch_to_saved_addresses_popup_iframe()
4848

4949
# The address saved in step 2 is listed in the "Saved addresses" modal: name and organization
50-
elements = about_prefs.get_elements("saved-addresses-values")
50+
elements = about_prefs_privacy.get_elements("saved-addresses-values")
5151
expected_values = [expected_name, expected_org]
5252
found_name_org = any(
5353
all(value in element.text for value in expected_values) for element in elements

l10n_CM/Unified/test_us_demo_addy_verify_new_address_added.py renamed to l10n_CM/Unified/test_demo_addy_verify_new_address_added.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ def add_prefs(region: str):
2727

2828

2929
def test_verify_new_address_is_added(
30-
driver: Firefox, region: str, about_prefs: AboutPrefs, util: Utilities
30+
driver: Firefox, region: str, about_prefs_privacy: AboutPrefs, util: Utilities
3131
):
3232
"""
3333
C2886580: Verify that a new Address can be added
@@ -38,12 +38,12 @@ def test_verify_new_address_is_added(
3838
address_autofill_data = util.fake_autofill_data(region)
3939

4040
# open saved addresses and add entry
41-
about_prefs.open()
42-
about_prefs.add_entry_to_saved_addresses(address_autofill_data)
41+
about_prefs_privacy.open()
42+
about_prefs_privacy.add_entry_to_saved_addresses(address_autofill_data)
4343

4444
# verify that the address saved is the same.
4545
# The address saved in step 2 is listed in the "Saved addresses" modal: name and organization
46-
elements = about_prefs.get_element("saved-addresses-values").text.split(",")
46+
elements = about_prefs_privacy.get_element("saved-addresses-values").text.split(",")
4747
address_match = all(
4848
data_sanitizer(element, region, inverted_state_province_abbr)
4949
in address_autofill_data.__dict__.values()

l10n_CM/Unified/test_demo_cc_add_new_credit_card.py

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,29 +16,27 @@ def test_create_new_cc_profile(
1616
driver: Firefox,
1717
region: str,
1818
util: Utilities,
19+
about_prefs_privacy: AboutPrefs,
1920
about_prefs: AboutPrefs,
20-
about_prefs_cc_popup: AboutPrefs,
2121
):
2222
"""
2323
C2886595 - Tests you can create and save a new Credit Card profile
2424
"""
2525

2626
# Go to about:preferences#privacy and open Saved Payment Methods
27-
about_prefs.open()
28-
about_prefs.switch_to_saved_payments_popup_iframe()
27+
about_prefs_privacy.open()
28+
about_prefs_privacy.switch_to_saved_payments_popup_iframe()
2929

3030
# Save CC information using fake data
3131
credit_card_sample_data = util.fake_credit_card_data()
3232

3333
# Add a new CC profile
34-
about_prefs_cc_popup.click_on(
35-
"panel-popup-button", labels=["autofill-manage-add-button"]
36-
)
37-
about_prefs.fill_cc_panel_information(credit_card_sample_data)
34+
about_prefs.click_on("panel-popup-button", labels=["autofill-manage-add-button"])
35+
about_prefs_privacy.fill_cc_panel_information(credit_card_sample_data)
3836

3937
# Get the saved CC data
40-
cc_profiles = about_prefs_cc_popup.get_all_saved_cc_profiles()
38+
cc_profiles = about_prefs.get_all_saved_cc_profiles()
4139
cc_info_json = json.loads(cc_profiles[0].get_dom_attribute("data-l10n-args"))
4240

4341
# Compare input CC data with saved CC data
44-
about_prefs.verify_cc_json(cc_info_json, credit_card_sample_data)
42+
about_prefs_privacy.verify_cc_json(cc_info_json, credit_card_sample_data)

l10n_CM/Unified/test_demo_cc_clear_form.py

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ def test_case():
1414
def test_cc_clear_form(
1515
driver: Firefox,
1616
util: Utilities,
17-
address_autofill_popup: AutofillPopup,
17+
autofill_popup: AutofillPopup,
18+
about_prefs_privacy: AboutPrefs,
1819
about_prefs: AboutPrefs,
19-
about_prefs_cc_popup: AboutPrefs,
2020
credit_card_fill_obj: CreditCardFill,
2121
):
2222
"""
@@ -25,15 +25,13 @@ def test_cc_clear_form(
2525
"""
2626

2727
# Save a credit card in about:preferences
28-
about_prefs.open()
29-
about_prefs.switch_to_saved_payments_popup_iframe()
28+
about_prefs_privacy.open()
29+
about_prefs_privacy.switch_to_saved_payments_popup_iframe()
3030

3131
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-
)
35-
about_prefs.fill_cc_panel_information(credit_card_sample_data)
32+
about_prefs.click_on("panel-popup-button", labels=["autofill-manage-add-button"])
33+
about_prefs_privacy.fill_cc_panel_information(credit_card_sample_data)
3634

3735
# Open credit card form page, clear form and verify all fields are empty
3836
credit_card_fill_obj.open()
39-
credit_card_fill_obj.verify_clear_form_all_fields(address_autofill_popup)
37+
credit_card_fill_obj.verify_clear_form_all_fields(autofill_popup)

l10n_CM/Unified/test_demo_cc_doorhanger_shown_on_valid_credit_card_submission.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ def test_cc_check_door_hanger_is_displayed(
1515
driver: Firefox,
1616
region: str,
1717
util: Utilities,
18-
address_autofill_popup: AutofillPopup,
18+
autofill_popup: AutofillPopup,
1919
credit_card_fill_obj: CreditCardFill,
2020
):
2121
"""
@@ -29,4 +29,4 @@ def test_cc_check_door_hanger_is_displayed(
2929
credit_card_fill_obj.fill_credit_card_info(credit_card_sample_data)
3030

3131
# Check if an element from the door hanger is visible
32-
address_autofill_popup.element_visible("doorhanger-save-button")
32+
autofill_popup.element_visible("doorhanger-save-button")

l10n_CM/Unified/test_demo_cc_dropdown-presence.py

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,27 +14,25 @@ def test_case():
1414
def test_dropdown_presence_credit_card(
1515
driver: Firefox,
1616
util: Utilities,
17-
address_autofill_popup: AutofillPopup,
17+
autofill_popup: AutofillPopup,
18+
about_prefs_privacy: AboutPrefs,
1819
about_prefs: AboutPrefs,
19-
about_prefs_cc_popup: AboutPrefs,
2020
credit_card_fill_obj: CreditCardFill,
2121
):
2222
"""
2323
C2886598 - Verify autofill dropdown is displayed only for the eligible fields after a credit card is saved
2424
"""
2525

2626
# Save a credit card in about:preferences
27-
about_prefs.open()
28-
about_prefs.switch_to_saved_payments_popup_iframe()
27+
about_prefs_privacy.open()
28+
about_prefs_privacy.switch_to_saved_payments_popup_iframe()
2929

3030
credit_card_sample_data = util.fake_credit_card_data()
31-
about_prefs_cc_popup.click_on(
32-
"panel-popup-button", labels=["autofill-manage-add-button"]
33-
)
34-
about_prefs.fill_cc_panel_information(credit_card_sample_data)
31+
about_prefs.click_on("panel-popup-button", labels=["autofill-manage-add-button"])
32+
about_prefs_privacy.fill_cc_panel_information(credit_card_sample_data)
3533

3634
# Open credit card form page
3735
credit_card_fill_obj.open()
3836

3937
# Verify autofill dropdown is displayed only for the eligible fields
40-
credit_card_fill_obj.verify_autofill_dropdown_all_fields(address_autofill_popup)
38+
credit_card_fill_obj.verify_autofill_dropdown_all_fields(autofill_popup)

0 commit comments

Comments
 (0)