Skip to content

Commit 7e1f748

Browse files
Hani YacoubHani Yacoub
authored andcommitted
merge main
2 parents 6208d33 + 239b0de commit 7e1f748

File tree

45 files changed

+392
-165
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+392
-165
lines changed

Pipfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ taskcluster-taskgraph = "==9.0.0"
1717
jsonpath-ng = "1.6.1"
1818
pillow = "<10.5"
1919
pyfxa = "0.7.0"
20-
ruff = "0.5.2"
20+
ruff = "0.9.6"
2121
pytest-rerunfailures = "14.0"
2222
slack-sdk = "3.31.0"
2323
google-cloud-storage = "2.18.0"

SELECTOR_INFO.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1354,6 +1354,20 @@ Location: Address bar
13541354
Path to .json: modules/data/autofill_popup.components.json
13551355
```
13561356
```
1357+
Selector Name: address-doorhanger-email
1358+
Selector Data: "div.address-save-update-row-container:nth-of-type(2) div p:first-of-type span"
1359+
Description: Save address doorhanger email section
1360+
Location: Address bar
1361+
Path to .json: modules/data/autofill_popup.components.json
1362+
```
1363+
```
1364+
Selector Name: address-doorhanger-phone
1365+
Selector Data: "div.address-save-update-row-container:nth-of-type(2) div p:nth-of-type(2) span"
1366+
Description: Save address doorhanger phone section
1367+
Location: Address bar
1368+
Path to .json: modules/data/autofill_popup.components.json
1369+
```
1370+
```
13571371
Selector Name: address-doorhanger-name
13581372
Selector Data: "div.address-save-update-row-container:nth-of-type(1) div p:first-of-type span"
13591373
Description: Save address doorhanger name section

collect_executables.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -111,23 +111,23 @@ def get_gd_platform():
111111
minor = int(minor)
112112
beta = int(beta)
113113

114-
next_major = f"{major+1}.0b1"
114+
next_major = f"{major + 1}.0b1"
115115
fx_download_dir_url = f"https://archive.mozilla.org/pub/firefox/candidates/{next_major}-candidates/build1/"
116116
rs = requests.get(fx_download_dir_url)
117117
if rs.status_code < 300:
118118
latest_beta_ver = next_major
119119
this_beta = next_major
120120
continue
121121

122-
next_minor = f"{major}.{minor+1}b1"
122+
next_minor = f"{major}.{minor + 1}b1"
123123
fx_download_dir_url = f"https://archive.mozilla.org/pub/firefox/candidates/{next_minor}-candidates/build1/"
124124
rs = requests.get(fx_download_dir_url)
125125
if rs.status_code < 300:
126126
latest_beta_ver = next_minor
127127
this_beta = next_minor
128128
continue
129129

130-
next_beta = f"{major}.{minor}b{beta+1}"
130+
next_beta = f"{major}.{minor}b{beta + 1}"
131131
fx_download_dir_url = f"https://archive.mozilla.org/pub/firefox/candidates/{next_beta}-candidates/build1/"
132132
rs = requests.get(fx_download_dir_url)
133133
if rs.status_code < 300:

l10n_CM/Unified/test_demo_ad_address_data_captured_in_doorhanger_and_stored.py

Lines changed: 28 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,17 @@
44
from modules.browser_object_autofill_popup import AutofillPopup
55
from modules.page_object_autofill import AddressFill
66
from modules.page_object_prefs import AboutPrefs
7-
from modules.util import Utilities, BrowserActions
8-
7+
from modules.util import BrowserActions, Utilities
98

109

1110
@pytest.fixture()
1211
def test_case():
1312
return "2888703"
1413

1514

16-
def test_demo_ad_address_data_captured_in_doorhanger_and_stored(driver: Firefox, region: str):
15+
def test_demo_ad_address_data_captured_in_doorhanger_and_stored(
16+
driver: Firefox, region: str
17+
):
1718
"""
1819
C2888703 - Verify Address data are captured in the Capture Doorhanger and stored in about:preferences
1920
"""
@@ -33,7 +34,9 @@ def test_demo_ad_address_data_captured_in_doorhanger_and_stored(driver: Firefox,
3334

3435
# containing Street Address field
3536
expected_street_add = address_autofill_data.street_address
36-
address_autofill_popup.element_has_text("address-doorhanger-street", expected_street_add)
37+
address_autofill_popup.element_has_text(
38+
"address-doorhanger-street", expected_street_add
39+
)
3740

3841
# containing City field
3942
expected_city = address_autofill_data.address_level_2
@@ -42,16 +45,24 @@ def test_demo_ad_address_data_captured_in_doorhanger_and_stored(driver: Firefox,
4245
expected_state = address_autofill_data.address_level_1
4346
if region not in ["FR", "DE"]:
4447
state_abbreviation = util.get_state_province_abbreviation(expected_state)
45-
address_autofill_popup.element_has_text("address-doorhanger-state", state_abbreviation)
48+
address_autofill_popup.element_has_text(
49+
"address-doorhanger-state", state_abbreviation
50+
)
4651

4752
# Verify Zip Code field (Different selector for DE/FR)
4853
expected_zip = address_autofill_data.postal_code
49-
zip_selector = "address-doorhanger-zip-other" if region in ["FR", "DE"] else "address-doorhanger-zip"
54+
zip_selector = (
55+
"address-doorhanger-zip-other"
56+
if region in ["FR", "DE"]
57+
else "address-doorhanger-zip"
58+
)
5059
address_autofill_popup.element_has_text(zip_selector, expected_zip)
5160

5261
# containing Country field
5362
expected_country = address_autofill_data.country
54-
address_autofill_popup.element_has_text("address-doorhanger-country", expected_country)
63+
address_autofill_popup.element_has_text(
64+
"address-doorhanger-country", expected_country
65+
)
5566

5667
# Click the "Save" button
5768
address_autofill_popup.click_doorhanger_button("save")
@@ -65,13 +76,19 @@ def test_demo_ad_address_data_captured_in_doorhanger_and_stored(driver: Firefox,
6576
elements = about_prefs.get_elements("saved-addresses-values")
6677

6778
# Expected values for verification
68-
expected_values = [expected_street_add, expected_city, expected_zip, expected_country]
79+
expected_values = [
80+
expected_street_add,
81+
expected_city,
82+
expected_zip,
83+
expected_country,
84+
]
6985
if region not in ["FR", "DE"]:
7086
expected_values.insert(2, expected_state)
7187

7288
# Check if all expected values exist in any saved address
7389
found_address_data = any(
74-
all(value in element.text for value in expected_values)
75-
for element in elements
90+
all(value in element.text for value in expected_values) for element in elements
91+
)
92+
assert found_address_data, (
93+
"Street, city, state (if applicable), zip, or country were not found in any of the address entries!"
7694
)
77-
assert found_address_data, "Street, city, state (if applicable), zip, or country were not found in any of the address entries!"
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
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.page_object_prefs import AboutPrefs
7+
from modules.util import BrowserActions, Utilities
8+
9+
10+
@pytest.fixture()
11+
def test_case():
12+
return "2886581"
13+
14+
15+
def test_demo_ad_email_phone_captured_in_doorhanger_and_stored(
16+
driver: Firefox, region: str
17+
):
18+
"""
19+
C2888704 - Verify tele/email data are captured in the Capture Doorhanger and stored in about:preferences
20+
"""
21+
# instantiate objects
22+
address_autofill = AddressFill(driver)
23+
address_autofill_popup = AutofillPopup(driver)
24+
util = Utilities()
25+
browser_action_obj = BrowserActions(driver)
26+
27+
# create fake data and fill it in
28+
address_autofill.open()
29+
address_autofill_data = util.fake_autofill_data(region)
30+
address_autofill.save_information_basic(address_autofill_data)
31+
32+
# The "Save address?" doorhanger is displayed
33+
address_autofill_popup.element_visible("address-save-doorhanger")
34+
35+
# containing email field
36+
expected_email = address_autofill_data.email
37+
address_autofill_popup.element_has_text("address-doorhanger-email", expected_email)
38+
39+
# containing phone field
40+
expected_phone = address_autofill_data.telephone
41+
with driver.context(driver.CONTEXT_CHROME):
42+
actual_phone = address_autofill_popup.get_element(
43+
"address-doorhanger-phone"
44+
).text
45+
normalize_expected = util.normalize_phone_number(expected_phone)
46+
normalized_actual = util.normalize_phone_number(actual_phone)
47+
assert normalized_actual == normalize_expected
48+
49+
# Click the "Save" button
50+
address_autofill_popup.click_doorhanger_button("save")
51+
52+
# Navigate to about:preferences#privacy => "Autofill" section
53+
about_prefs = AboutPrefs(driver, category="privacy").open()
54+
iframe = about_prefs.get_save_addresses_popup_iframe()
55+
browser_action_obj.switch_to_iframe_context(iframe)
56+
57+
# The address saved in step 2 is listed in the "Saved addresses" modal: Email and phone
58+
elements = about_prefs.get_elements("saved-addresses-values")
59+
expected_values = [expected_phone, expected_email]
60+
found_email_phone = any(
61+
all(value in element.text for value in expected_values) for element in elements
62+
)
63+
assert found_email_phone, (
64+
"Email or phone were not found in any of the address entries!"
65+
)

l10n_CM/Unified/test_demo_ad_name_org_captured_in_doorhanger_and_stored.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,6 @@ def test_demo_ad_name_org_captured_in_doorhanger_and_stored(
5959
found_name_org = any(
6060
all(value in element.text for value in expected_values) for element in elements
6161
)
62-
assert (
63-
found_name_org
64-
), "Name or organization were not found in any of the address entries!"
62+
assert found_name_org, (
63+
"Name or organization were not found in any of the address entries!"
64+
)
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
import pytest
2+
from selenium.webdriver import Firefox
3+
4+
from modules.browser_object_autofill_popup import AutofillPopup
5+
from modules.page_object import AboutPrefs, CreditCardFill
6+
from modules.util import BrowserActions, Utilities
7+
8+
9+
@pytest.fixture()
10+
def test_case():
11+
return "2886602"
12+
13+
14+
def test_cc_clear_form(driver: Firefox):
15+
"""
16+
C2886602 - Verify that clearing the form from any field results in all fields being emptied, regardless of the
17+
field from which the clear action was triggered.
18+
"""
19+
20+
# Initialize objects
21+
util = Utilities()
22+
about_prefs = AboutPrefs(driver, category="privacy")
23+
about_prefs_cc_popup = AboutPrefs(driver)
24+
browser_action_obj = BrowserActions(driver)
25+
credit_card_fill_obj = CreditCardFill(driver)
26+
autofill_popup = AutofillPopup(driver)
27+
28+
# Save a credit card in about:preferences
29+
about_prefs.open()
30+
iframe = about_prefs.get_saved_payments_popup_iframe()
31+
browser_action_obj.switch_to_iframe_context(iframe)
32+
credit_card_sample_data = util.fake_credit_card_data()
33+
about_prefs_cc_popup.click_on(
34+
"panel-popup-button", labels=["autofill-manage-add-button"]
35+
)
36+
about_prefs.fill_cc_panel_information(credit_card_sample_data)
37+
38+
# Open credit card form page, clear form and verify all fields are empty
39+
credit_card_fill_obj.open()
40+
credit_card_fill_obj.verify_clear_form_all_fields(autofill_popup)

l10n_CM/region/CA.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
"test_demo_ad_name_org_captured_in_doorhanger_and_stored.py",
88
"test_demo_ad_address_data_captured_in_doorhanger_and_stored.py",
99
"test_demo_cc_dropdown-presence.py",
10+
"test_demo_cc_clear_form.py",
11+
"test_demo_cc_dropdown-presence.py",
1012
"test_demo_ad_autofill_name_org.py"
1113
]
1214
}

l10n_CM/region/DE.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
"test_demo_ad_name_org_captured_in_doorhanger_and_stored.py",
88
"test_demo_cc_dropdown-presence.py",
99
"test_demo_ad_address_data_captured_in_doorhanger_and_stored.py",
10-
"test_demo_ad_autofill_name_org.py"
10+
"test_demo_ad_autofill_name_org.py",
11+
"test_demo_ad_address_data_captured_in_doorhanger_and_stored.py",
12+
"test_demo_cc_clear_form.py"
1113
]
1214
}

l10n_CM/region/FR.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77
"test_demo_ad_name_org_captured_in_doorhanger_and_stored.py",
88
"test_demo_cc_dropdown-presence.py",
99
"test_demo_ad_address_data_captured_in_doorhanger_and_stored.py",
10-
"test_demo_ad_autofill_name_org.py"
10+
"test_demo_ad_autofill_name_org.py",
11+
"test_demo_ad_email_phone_captured_in_doorhanger_and_stored.py",
12+
"test_demo_cc_dropdown-presence.py",
13+
"test_demo_cc_clear_form.py"
1114
]
1215
}

0 commit comments

Comments
 (0)