Skip to content

Commit 66e7821

Browse files
Merge pull request #682 from mozilla/Hani/cm-fnac-fr
Hani/ L10n [FR] - Fnac (ad + cc)
2 parents 6e8a9e6 + ed3ff0e commit 66e7821

File tree

10 files changed

+74
-18
lines changed

10 files changed

+74
-18
lines changed

choose_l10n_ci_set.py

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -36,26 +36,31 @@ def valid_l10n_mappings():
3636

3737
def distribute_mappings_evenly(mappings, version):
3838
"""
39-
Write the selected mappings to the output file.
39+
Distribute the selected mappings if its a reportable run.
4040
4141
Args:
4242
mappings (dict): A dictionary of mappings, where the keys are sites and the values are sets of regions.
4343
version (int): The beta_version of the beta.
4444
"""
4545
if not mappings:
4646
return {}
47-
# sort the mappings by the length of the regions per site
48-
mappings = dict(sorted(mappings.items(), key=lambda val: len(val[1]), reverse=True))
49-
# place the mappings into 3 containers evenly according to the load
50-
loads = [0, 0, 0]
51-
containers = [defaultdict(set) for _ in range(3)]
52-
for key, value in mappings.items():
53-
min_idx = loads.index(min(loads))
54-
containers[min_idx][key] = value
55-
loads[min_idx] += len(value)
56-
# get container index according to beta beta_version
57-
run_idx = version % 3
58-
return containers[run_idx]
47+
if os.environ.get("TESTRAIL_REPORT"):
48+
# sort the mappings by the length of the regions per site
49+
mappings = dict(
50+
sorted(mappings.items(), key=lambda val: len(val[1]), reverse=True)
51+
)
52+
# place the mappings into 3 containers evenly according to the load
53+
loads = [0, 0, 0]
54+
containers = [defaultdict(set) for _ in range(3)]
55+
for key, value in mappings.items():
56+
min_idx = loads.index(min(loads))
57+
containers[min_idx][key] = value
58+
loads[min_idx] += len(value)
59+
# get container index according to beta beta_version
60+
run_idx = version % 3
61+
return containers[run_idx]
62+
else:
63+
return mappings
5964

6065

6166
def process_changed_file(f, selected_mappings):

ci_l10n_pyproject_headed.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ markers = [
1515
"noxvfb: tests that should not run in xvfb sessions"
1616
]
1717

18-
addopts = "-vs --ci --json-report --json-report-file artifacts/report_headed.json -n auto --reruns 5 --reruns-delay 3 --html=artifacts/report_headed.html"
18+
addopts = "-vs --ci --json-report --json-report-file artifacts/report_headed.json -n auto --reruns 4 --reruns-delay 3 --html=artifacts/report_headed.html"
1919

2020
[tool.ruff]
2121
target-version = "py310"

l10n_CM/constants/artsper/FR/artsper_ad.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,9 @@
1818
"ec64782b-ae40-44fe-ac38-2147be6fd7b5",
1919
"0db3d939-9d04-4d95-9f33-5d33ba281fec",
2020
"8755f1ec-42e6-4a4f-ac5f-1cf696a0271a"
21+
],
22+
"skipped": [
23+
"test_demo_ad_3a_autofill_address_fields.py",
24+
"test_demo_ad_5b_clear_address_fields.py"
2125
]
2226
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"url": "http://127.0.0.1:8080/fnac_ad.html",
3+
"field_mapping": {
4+
"given_name": "4c929eea-6b02-416b-ab91-5c12df732fc7",
5+
"family_name": "be324d87-0dda-45d4-a884-8f622d4e5be8",
6+
"street_address": "b3b475eb-3b91-4170-a6ca-880a071c6c3f",
7+
"address_level_2": "55790e94-fabf-4684-b2db-6846fa1056c2",
8+
"address_level_1": "ac6e6f42-0d04-4671-8ced-9c5e7f8dc51a",
9+
"country": "b3b87b3b-867d-4ec6-8e4b-aa13a45fe9ed",
10+
"postal_code": "8bd2a4c8-0eed-4721-8179-47d35717a188",
11+
"telephone": "82310c4a-3f30-4898-b0da-3605ec2dc6fd"
12+
},
13+
14+
"form_field": "*[data-moz-autofill-inspect-id='{given_name}']",
15+
"fields": [
16+
"4c929eea-6b02-416b-ab91-5c12df732fc7",
17+
"be324d87-0dda-45d4-a884-8f622d4e5be8",
18+
"b3b475eb-3b91-4170-a6ca-880a071c6c3f",
19+
"55790e94-fabf-4684-b2db-6846fa1056c2",
20+
"ac6e6f42-0d04-4671-8ced-9c5e7f8dc51a",
21+
"b3b87b3b-867d-4ec6-8e4b-aa13a45fe9ed",
22+
"8bd2a4c8-0eed-4721-8179-47d35717a188",
23+
"82310c4a-3f30-4898-b0da-3605ec2dc6fd"
24+
]
25+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"url": "http://127.0.0.1:8080/fnac_cc.html",
3+
"field_mapping": {
4+
"name": "c39e0aac-c334-43d5-81ac-1e799ecf7b63",
5+
"card_number": "2508fd7b-a4c9-4d63-80a1-79b4e12a8826",
6+
"expiration_date": "3181324d-01b3-4665-bdd9-5de4be475336",
7+
"cvv": "bc2807a3-960e-4071-9cf0-5713b340911a"
8+
},
9+
"form_field": "*[data-moz-autofill-inspect-id='{name}']",
10+
"fields": [
11+
"c39e0aac-c334-43d5-81ac-1e799ecf7b63",
12+
"2508fd7b-a4c9-4d63-80a1-79b4e12a8826",
13+
"3181324d-01b3-4665-bdd9-5de4be475336",
14+
"bc2807a3-960e-4071-9cf0-5713b340911a"
15+
],
16+
"skipped": [
17+
"test_demo_cc_1_dropdown.py",
18+
"test_demo_cc_2_preview.py",
19+
"test_demo_cc_3_autofill.py",
20+
"test_demo_cc_5_clear.py"
21+
]
22+
}

l10n_CM/region/FR.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"amazon",
55
"demo",
66
"artsper",
7+
"fnac",
78
"yellowkorner"
89
],
910
"tests": [

l10n_CM/run_l10n.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
"justspices",
4242
"yellowkorner",
4343
"bijoubrigitte",
44+
"fnac",
4445
"burtsbees",
4546
"peacocks",
4647
"whittard",

l10n_CM/sites/fnac/FR/fnac_ad.html

Lines changed: 1 addition & 0 deletions
Large diffs are not rendered by default.

l10n_CM/sites/fnac/FR/fnac_cc.html

Lines changed: 1 addition & 0 deletions
Large diffs are not rendered by default.

modules/browser_object_autofill_popup.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import logging
21
from typing import Union
32

43
from selenium.webdriver.remote.webelement import WebElement
@@ -48,9 +47,6 @@ def ensure_autofill_dropdown_visible(self, field_element: WebElement = None):
4847
"""
4948
self.element_exists("pop-up-component")
5049
popup_component = self.get_element("pop-up-component")
51-
logging.warning(
52-
f"Parent pop up component: {len(popup_component.get_attribute('innerHTML')) > 1}"
53-
)
5450
if popup_component:
5551
self.element_visible("select-form-option")
5652
return self

0 commit comments

Comments
 (0)