Skip to content

Commit e5a95c4

Browse files
Hani YacoubHani Yacoub
authored andcommitted
Merge main
2 parents aace8c5 + ded2c12 commit e5a95c4

File tree

8 files changed

+31
-10
lines changed

8 files changed

+31
-10
lines changed

l10n_CM/Unified/conftest.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,11 @@ def cc_form_field(cc_site_data):
157157

158158

159159
@pytest.fixture()
160-
def address_autofill(driver, ad_site_data, ad_form_field, serve_live_site):
160+
def address_autofill(
161+
driver, ad_site_data, ad_form_field, serve_live_site, live_site, region
162+
):
163+
if ad_site_data.get("skip"):
164+
pytest.skip(f"Address tests for {live_site} in {region} region skipped..")
161165
af = AddressFill(
162166
driver,
163167
url_template=ad_site_data.get("url"),
@@ -170,6 +174,8 @@ def address_autofill(driver, ad_site_data, ad_form_field, serve_live_site):
170174

171175
@pytest.fixture()
172176
def credit_card_autofill(driver, cc_site_data, cc_form_field, serve_live_site):
177+
if cc_site_data.get("skip"):
178+
pytest.skip(f"Credit Card tests for {live_site} in {region} region skipped..")
173179
cf = CreditCardFill(
174180
driver,
175181
url_template=cc_site_data.get("url"),
Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
11
{
22
"url": "http://127.0.0.1:8080/amazon_cc.html",
33
"field_mapping": {
4-
"card_number": "cc-number",
5-
"expiration_date": "cc-exp"
4+
"card_number": "5c01d093-4e7c-422a-99b3-6c7b9a8cd49f",
5+
"expiration_date": "6c5f05c1-72f0-4392-a1ef-a0f7e69ee1b2",
6+
"name": "286af831-a430-43ce-893a-a9e5f21a7417"
67
},
8+
"form_field": "*[data-moz-autofill-inspect-id='{name}']",
9+
"skip": "True",
710
"fields": [
8-
"cc-number",
9-
"cc-exp"
11+
"5c01d093-4e7c-422a-99b3-6c7b9a8cd49f",
12+
"6c5f05c1-72f0-4392-a1ef-a0f7e69ee1b2",
13+
"286af831-a430-43ce-893a-a9e5f21a7417"
1014
]
1115
}

l10n_CM/constants/amazon/DE/amazon_ad.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
"name": "28f5f493-ad18-4e7c-99fa-524bc768ed7a",
66
"telephone": "c384d303-3e2b-4b8a-ba89-c741056fc9b4",
77
"street_address": "a5fb9e4c-60a0-42a2-9e4a-6a067b55d208",
8-
"organization": "9e8475b3-e1a5-46cf-9af0-6f2caab918fe",
98
"address_level_2": "67cbe0f8-dbe4-4afd-a077-765186bcf0b3",
109
"postal_code": "e38f3160-4ce5-4804-b5d5-b92c3ccc499e"
1110
},
@@ -15,7 +14,6 @@
1514
"28f5f493-ad18-4e7c-99fa-524bc768ed7a",
1615
"c384d303-3e2b-4b8a-ba89-c741056fc9b4",
1716
"a5fb9e4c-60a0-42a2-9e4a-6a067b55d208",
18-
"9e8475b3-e1a5-46cf-9af0-6f2caab918fe",
1917
"67cbe0f8-dbe4-4afd-a077-765186bcf0b3",
2018
"e38f3160-4ce5-4804-b5d5-b92c3ccc499e"
2119
]

l10n_CM/constants/amazon/DE/amazon_cc.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
"cvv":"b7ea2a60-8b59-4a5a-b1b8-e8d640efd511"
88
},
99
"form_field": "*[data-moz-autofill-inspect-id='{name}']",
10+
"skip": "True",
1011
"fields": [
1112
"06014430-b517-476f-8618-f4770f0c078f",
1213
"31fd4333-af75-4131-939a-d73a36f70fe9",

l10n_CM/constants/amazon/FR/amazon_cc.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
"cvv":"68a5e85d-d8c5-4d10-9827-394263770656"
88
},
99
"form_field": "*[data-moz-autofill-inspect-id='{name}']",
10+
"skip": "True",
1011
"fields": [
1112
"4bfc1932-75e6-436c-b195-a443beb1adfc",
1213
"b48f8715-36a7-4c89-8c64-5a5471f7d9f2",

modules/page_object_autofill.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,8 @@ def verify_form_data(self, sample_data: CreditCardBase | AutofillAddressBase):
245245
)
246246
elif attr_name == "expiration_date" and len(autofilled_field_value) > 5:
247247
autofilled_field_value = autofilled_field_value.replace("20", "")
248-
248+
elif attr_name == "country":
249+
expected_value = self.util.get_country_local_translation(expected_value)
249250
if autofilled_field_value.isdigit():
250251
# Handle expiration month comparison - normalize to integers to handle leading zeros
251252
autofilled_field_value = str(int(autofilled_field_value))

modules/util.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,8 @@ def __init__(self):
103103
"Nunavut": "NU",
104104
"Yukon": "YT",
105105
}
106+
# temporary fix until faker issue is resolved
107+
self.country_local_translation = {"Germany": "Deutschland"}
106108
self.fake = None
107109
self.locale = None
108110

@@ -519,6 +521,15 @@ def get_state_province_abbreviation(self, full_name: str) -> str:
519521
"""
520522
return self.state_province_abbr.get(full_name, "Not Found")
521523

524+
def get_country_local_translation(self, country_name: str) -> str:
525+
"""
526+
Returns the local translation of the country name.
527+
528+
:param country_name: The full name of the country in english
529+
:return: The corresponding translation in the local language or the english name itself if not in the dictionary.
530+
"""
531+
return self.country_local_translation.get(country_name, country_name)
532+
522533
def normalize_regional_phone_numbers(self, phone: str, region: str) -> str:
523534
"""
524535
Normalizes a phone number by separating the country prefix and verifying the rest of the number as an integer.

tests/password_manager/test_primary_password_triggered_on_about_logins_access.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,6 @@ def test_primary_password_triggered_on_about_logins_access_via_hamburger_menu(
7373
# Attempt to view the saved password in order to trigger the primary password prompt
7474
about_logins.element_visible("show-password-checkbox")
7575
about_logins.click_on("show-password-checkbox")
76-
7776
# Dismiss the primary password prompt without entering the password
7877
with driver.context(driver.CONTEXT_CHROME):
7978
driver.switch_to.window(driver.window_handles[-1])
@@ -84,9 +83,9 @@ def test_primary_password_triggered_on_about_logins_access_via_hamburger_menu(
8483
tabs.switch_to_new_tab()
8584
panel_ui.open_panel_menu()
8685
panel_ui.redirect_to_about_logins_page()
87-
8886
# Verify that the primary password prompt appears and enter the primary password
8987
with driver.context(driver.CONTEXT_CHROME):
88+
tabs.wait_for_num_tabs(2)
9089
driver.switch_to.window(driver.window_handles[-1])
9190
# Fetch a fresh reference to avoid staling
9291
primary_password_prompt = about_logins.get_element("primary-password-prompt")

0 commit comments

Comments
 (0)