Skip to content

Commit d950972

Browse files
Hani YacoubHani Yacoub
authored andcommitted
merge main
2 parents 1e46f3a + 328ca6a commit d950972

39 files changed

+1075
-688
lines changed

SELECTOR_INFO.md

Lines changed: 43 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Path to .json: (ie, modules/data/google_search.components.json
1212
```
1313
Selector Name: sidebar-options
1414
Selector Data: "button.category[name='{name}']"
15-
Description: Selects an option in about:addons (sidebar)
15+
Description: Selects an option in about:addons(sidebar)
1616
Location: Left side of about:addons page
1717
Path to .json: modules/data/about_addons.components.json
1818
```
@@ -459,6 +459,20 @@ Location: about:preferences#search
459459
Path to .json: modules/data/about_prefs.components.json
460460
```
461461
```
462+
Selector Name: form-container
463+
Selector Data: "form"
464+
Description: Form to to fill in saved addresses data
465+
Location: about:preferences#privacy
466+
Path to .json: modules/data/about_prefs.components.json
467+
```
468+
```
469+
Selector Name: save-button
470+
Selector Data: "save"
471+
Description: Button to save filled in address form.
472+
Location: about:preferences#privacy
473+
Path to .json: modules/data/about_prefs.components.json
474+
```
475+
```
462476
Selector Name: find-in-settings
463477
Selector Data: "searchInput"
464478
Description: Find in Settings input field (is a shadow root)
@@ -963,6 +977,20 @@ Location: about:preferences#privacy in Exceptions - Saved Passwords modal
963977
Path to .json: modules/data/about_prefs.components.json
964978
```
965979
```
980+
Selector Name: actions-menu
981+
Selector Data: "richlistitem[type='{.*}'] menulist.actionsMenu"
982+
Description: Select Application list that handles how downloads are handled
983+
Location: about:preferences#general Applications subsection
984+
Path to .json: modules/data/about_prefs.components.json
985+
```
986+
```
987+
Selector Name: actions-menu-option
988+
Selector Data: "richlistitem[type='{.*}'] menuitem[label='{.*}']"
989+
Description: Select download option from Application List
990+
Location: about:preferences#general Applications subsection
991+
Path to .json: modules/data/about_prefs.components.json
992+
```
993+
```
966994
Selector Name: use-primary-password
967995
Selector Data: "useMasterPassword"
968996
Description: Checkbox for using primary password
@@ -1333,6 +1361,13 @@ Location: Inside any autofill-eligible form field, triggered by user interaction
13331361
Path to .json: modules/data/autofill_popup.components.json
13341362
```
13351363
```
1364+
Selector Name: address-preview-form-container
1365+
Selector Data: "address-save-update-notification-content"
1366+
Description: Form container that is hidden in chrome context. Used to verify hover preview data
1367+
Location: Inside chrome context, holds the data that would be showed as a preview when autofill is hovered.
1368+
Path to .json: modules/data/autofill_popup.components.json
1369+
```
1370+
```
13361371
Selector Name: doorhanger-save-button
13371372
Selector Data: button[label='Save'].popup-notification-primary-button
13381373
Description: The "Save" button
@@ -2142,6 +2177,13 @@ Location: any element that supports the attribute (usually text)
21422177
Path to .json: modules/data/generic_pdf.components.json
21432178
```
21442179
```
2180+
Selector Name: pdf-text-layer
2181+
Selector Data: "textLayer"
2182+
Description: first instance of a text span.
2183+
Location: any element that supports the attribute (usually text)
2184+
Path to .json: modules/data/generic_pdf.components.json
2185+
```
2186+
```
21452187
Selector Name: html-body
21462188
Selector Data: "html"
21472189
Description: The html tag of the pdf

l10n_CM/Unified/test_demo_ad_address_data_captured_in_doorhanger_and_stored.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,15 +56,17 @@ def test_demo_ad_address_data_captured_in_doorhanger_and_stored(
5656
autofill_popup.element_has_text(zip_selector, expected_zip)
5757

5858
# Containing Country field
59-
expected_country = address_autofill_data.country
59+
expected_country = address_autofill_data.country_code
6060

6161
autofill_popup.element_has_text("address-doorhanger-country", expected_country)
6262

6363
# Click the "Save" button
64+
6465
autofill_popup.click_doorhanger_button("save")
6566

6667
# Navigate to about:preferences#privacy => "Autofill" section
6768
about_prefs_privacy.open()
69+
about_prefs_privacy.get_saved_addresses_popup().click()
6870
about_prefs_privacy.switch_to_saved_addresses_popup_iframe()
6971

7072
# Verify saved addresses

l10n_CM/Unified/test_demo_ad_autofill_dropdown_present_for_email_and_phone.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ def test_case():
1212

1313

1414
def test_dropdown_presence_email_phone_field(
15-
driver: Firefox,
16-
region: str,
17-
address_autofill: AddressFill,
18-
util: Utilities,
19-
autofill_popup: AutofillPopup,
15+
driver: Firefox,
16+
region: str,
17+
address_autofill: AddressFill,
18+
util: Utilities,
19+
autofill_popup: AutofillPopup,
2020
):
2121
"""
2222
C2888567 - Verify that the autofill dropdown is displayed for the email and phone fields

l10n_CM/Unified/test_demo_ad_email_phone_captured_in_doorhanger_and_stored.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,8 @@ def test_demo_ad_email_phone_captured_in_doorhanger_and_stored(
4242
if expected_phone:
4343
with driver.context(driver.CONTEXT_CHROME):
4444
actual_phone = autofill_popup.get_element("address-doorhanger-phone").text
45-
normalize_expected = util.normalize_regional_phone_numbers(
46-
expected_phone, region
47-
)
48-
normalized_actual = util.normalize_regional_phone_numbers(actual_phone, region)
45+
normalize_expected = util.normalize_phone_number(expected_phone, region)
46+
normalized_actual = util.normalize_phone_number(actual_phone, region)
4947
assert normalized_actual == normalize_expected, (
5048
f"Phone number mismatch for {region} | Expected: {normalize_expected}, Got: {normalized_actual}"
5149
)
@@ -55,6 +53,7 @@ def test_demo_ad_email_phone_captured_in_doorhanger_and_stored(
5553

5654
# Navigate to about:preferences#privacy => "Autofill" section
5755
about_prefs_privacy.open()
56+
about_prefs_privacy.get_saved_addresses_popup().click()
5857
about_prefs_privacy.switch_to_saved_addresses_popup_iframe()
5958

6059
# The address saved in step 2 is listed in the "Saved addresses" modal: Email and phone
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
import logging
2+
3+
import pytest
4+
from selenium.webdriver import ActionChains, Firefox
5+
6+
from modules.browser_object_autofill_popup import AutofillPopup
7+
from modules.page_object_autofill import AddressFill
8+
from modules.page_object_prefs import AboutPrefs
9+
from modules.util import Utilities
10+
11+
12+
@pytest.fixture()
13+
def test_case():
14+
return "2888562"
15+
16+
17+
@pytest.fixture()
18+
def add_to_prefs_list(region: str):
19+
return [
20+
("extensions.formautofill.creditCards.supportedCountries", region),
21+
("extensions.formautofill.addresses.supported", "on"),
22+
]
23+
24+
25+
def test_hover_address_is_previewed(
26+
driver: Firefox,
27+
region: str,
28+
about_prefs_privacy: AboutPrefs,
29+
address_autofill: AddressFill,
30+
autofill_popup: AutofillPopup,
31+
util: Utilities,
32+
):
33+
"""
34+
C2888562: Verify that hovering over field will preview all fields
35+
"""
36+
# Create fake data and fill it in
37+
address_autofill.open()
38+
address_autofill_data = util.fake_autofill_data(region)
39+
address_autofill.save_information_basic(address_autofill_data)
40+
41+
# Click the "Save" button
42+
autofill_popup.click_doorhanger_button("save")
43+
# Hover over each field and check data preview
44+
for field in AddressFill.fields:
45+
# hack to pass over fields that don't show up in autofill dropdown
46+
if field == "address-level1" and region in ["DE", "FR"]:
47+
continue
48+
address_autofill.double_click("form-field", labels=[field])
49+
autofill_popup.ensure_autofill_dropdown_visible()
50+
autofill_popup.hover("select-form-option")
51+
address_autofill.verify_autofill_data_on_hover(
52+
address_autofill_data, autofill_popup, util
53+
)

l10n_CM/Unified/test_demo_ad_name_org_captured_in_doorhanger_and_stored.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ def test_demo_ad_name_org_captured_in_doorhanger_and_stored(
4444

4545
# Navigate to about:preferences#privacy => "Autofill" section
4646
about_prefs_privacy.open()
47+
about_prefs_privacy.get_saved_addresses_popup().click()
4748
about_prefs_privacy.switch_to_saved_addresses_popup_iframe()
4849

4950
# The address saved in step 2 is listed in the "Saved addresses" modal: name and organization

l10n_CM/Unified/test_demo_ad_verify_new_address_added.py

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,6 @@ def test_case():
1212
return "2886580"
1313

1414

15-
@pytest.fixture()
16-
def region():
17-
return "US"
18-
19-
2015
@pytest.fixture()
2116
def add_to_prefs_list(region: str):
2217
return [
@@ -38,23 +33,25 @@ def test_verify_new_address_is_added(
3833

3934
# open saved addresses and add entry
4035
about_prefs_privacy.open()
36+
about_prefs_privacy.get_saved_addresses_popup().click()
4137
about_prefs_privacy.add_entry_to_saved_addresses(address_autofill_data)
38+
about_prefs_privacy.switch_to_saved_addresses_popup_iframe()
4239

4340
# verify that the address saved is the same.
4441
# The address saved in step 2 is listed in the "Saved addresses" modal: name and organization
4542
elements = about_prefs_privacy.get_element("saved-addresses-values").text.split(",")
4643
address_match = all(
47-
data_sanitizer(element, region, inverted_state_province_abbr)
44+
data_sanitizer(util, element, region, inverted_state_province_abbr)
4845
in address_autofill_data.__dict__.values()
4946
for element in elements
5047
)
5148
assert address_match, "Address found is not equal to address created!"
5249

5350

54-
def data_sanitizer(value: str, region: str, state_province: Dict):
51+
def data_sanitizer(util: Utilities, value: str, region: str, state_province: Dict):
5552
value = value.strip()
5653
if value[0] == "+":
57-
return value[1:]
54+
return util.normalize_phone_number(value)
5855
elif len(value) == 2 and value != region:
5956
return state_province.get(value, value)
6057
return value

l10n_CM/Unified/test_demo_ad_yellow_highlight_address.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,24 +21,20 @@ def test_address_yellow_highlight_address_fields(
2121
"""
2222
C2888564 - Verify the yellow highlight appears on autofilled fields for the address fields.
2323
"""
24-
25-
# Instantiate objects
26-
address_autofill_popup = AutofillPopup(driver)
27-
2824
# Create fake data and fill it in
2925
address_autofill.open()
3026
address_autofill_data = util.fake_autofill_data(region)
3127
address_autofill.save_information_basic(address_autofill_data)
3228

3329
# Click the "Save" button
34-
address_autofill_popup.click_doorhanger_button("save")
30+
autofill_popup.click_doorhanger_button("save")
3531

3632
# Double click inside street address field and select a saved address entry from the dropdown
3733
address_autofill.double_click("form-field", labels=["street-address"])
3834

3935
# 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)
36+
first_item = autofill_popup.get_nth_element(1)
37+
autofill_popup.click_on(first_item)
4238

4339
# Verify the address fields are highlighted
4440
address_autofill.verify_field_yellow_highlights(

l10n_CM/region/US.json

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

l10n_CM/region/Unified.json

Lines changed: 25 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,29 @@
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_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_autofill_from_dropdown.py",
16-
"test_demo_cc_yellow_highlight.py",
17-
"test_demo_ad_autofill_address_fields.py",
18-
"test_demo_ad_yellow_highlight.py",
19-
"test_demo_ad_autofill_address_fields.py",
20-
"test_demo_ad_yellow_highlight_name_org.py",
21-
"test_demo_ad_yellow_highlight_address.py",
22-
"test_demo_ad_yellow_highlight_phone_email.py",
23-
"test_demo_ad_dropdown_presence_address.py",
24-
"test_demo_ad_clear_name_org.py",
25-
"test_demo_ad_clear_address_fields.py",
26-
"test_demo_ad_clear_tel_email.py",
27-
"test_demo_ad_yellow_highlight_phone_email.py",
28-
"test_demo_ad_preview_name_org.py"
29-
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_autofill_from_dropdown.py",
16+
"test_demo_cc_yellow_highlight.py",
17+
"test_demo_ad_autofill_address_fields.py",
18+
"test_demo_ad_yellow_highlight_name_org.py",
19+
"test_demo_ad_yellow_highlight_address.py",
20+
"test_demo_ad_yellow_highlight_phone_email.py",
21+
"test_demo_ad_dropdown_presence_address.py",
22+
"test_demo_ad_clear_name_org.py",
23+
"test_demo_ad_clear_address_fields.py",
24+
"test_demo_ad_clear_tel_email.py",
25+
"test_demo_ad_autofill_dropdown_present_for_email_and_phone.py",
26+
"test_demo_ad_hover_verify_address.py",
27+
"test_demo_ad_preview_name_org.py"
3028
]
3129
}

0 commit comments

Comments
 (0)