Skip to content

Commit b2782cd

Browse files
amazon de hot fix until faker issue is resolved
1 parent 711d639 commit b2782cd

File tree

5 files changed

+24
-6
lines changed

5 files changed

+24
-6
lines changed

l10n_CM/Unified/conftest.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,12 @@ def get_html_files(live_site, region):
4242

4343
@pytest.fixture()
4444
def region():
45-
return os.environ.get("FX_REGION", "US")
45+
return os.environ.get("FX_REGION", "DE")
4646

4747

4848
@pytest.fixture()
4949
def live_site():
50-
return os.environ.get("CM_SITE", "demo")
50+
return os.environ.get("CM_SITE", "amazon")
5151

5252

5353
@pytest.fixture()

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/run_l10n.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,15 @@
1313
valid_flags = {"--run-headless", "-n", "--reruns", "--fx-executable", "--ci"}
1414
flag_with_parameter = {"-n", "--reruns"}
1515
valid_region = {"US", "CA", "DE", "FR"}
16-
valid_sites = {"demo", "amazon", "walmart", "mediamarkt", "lowes", "etsy", "calvinklein"}
16+
valid_sites = {
17+
"demo",
18+
"amazon",
19+
"walmart",
20+
"mediamarkt",
21+
"lowes",
22+
"etsy",
23+
"calvinklein",
24+
}
1725
live_sites = []
1826

1927
LOCALHOST = "127.0.0.1"

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 "Not Found" 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.

0 commit comments

Comments
 (0)