Skip to content

Commit 386dde9

Browse files
Merge branch 'main' into vs/Canadatire
2 parents 46af0ad + be08ddc commit 386dde9

File tree

10 files changed

+125
-15
lines changed

10 files changed

+125
-15
lines changed
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"url": "http://127.0.0.1:8080/cdiscount_ad.html",
3+
"field_mapping": {
4+
"given_name": "6be28779-ec7a-413e-a02a-4c52e13c4e82",
5+
"family_name": "33a53ab7-94d4-4406-8b8e-f60fc41af203",
6+
"address_level_2": "94555611-ca46-4468-ab4e-5795616b0fd1",
7+
"street_address" : "ee3cb5a9-8100-4a31-af20-809609cdd4fb",
8+
"postal_code": "48ead2a0-c336-46eb-a533-d75511f1b0f6",
9+
"country" : "739b4de7-c7f2-4e9c-ade2-16a78af0dea6",
10+
"telephone": "9250bcbf-33d7-4fec-87bd-9614956820cd"
11+
12+
},
13+
"form_field": "*[data-moz-autofill-inspect-id='{name}']",
14+
"fields": [
15+
"6be28779-ec7a-413e-a02a-4c52e13c4e82",
16+
"33a53ab7-94d4-4406-8b8e-f60fc41af203",
17+
"94555611-ca46-4468-ab4e-5795616b0fd1",
18+
"ee3cb5a9-8100-4a31-af20-809609cdd4fb",
19+
"48ead2a0-c336-46eb-a533-d75511f1b0f6",
20+
"739b4de7-c7f2-4e9c-ade2-16a78af0dea6",
21+
"9250bcbf-33d7-4fec-87bd-9614956820cd"
22+
23+
]
24+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"url": "http://127.0.0.1:8080/cdiscount_cc.html",
3+
"field_mapping": {
4+
"card_number": "03b45e0e-3ee5-4588-bb52-11c51280b1a1",
5+
"expiration_date": "1f545e96-cf5e-4bdd-8f70-8d307f9de357",
6+
"cvv": "963fd1a5-05f5-4464-adba-71c1529dc983",
7+
"cardholder_name": "e9f9c0b6-2960-47f0-91ca-74b18b3f1056"
8+
},
9+
"form_field": "*[data-moz-autofill-inspect-id='{name}']",
10+
"fields": [
11+
"03b45e0e-3ee5-4588-bb52-11c51280b1a1",
12+
"1f545e96-cf5e-4bdd-8f70-8d307f9de357",
13+
"963fd1a5-05f5-4464-adba-71c1529dc983",
14+
"e9f9c0b6-2960-47f0-91ca-74b18b3f1056"
15+
]
16+
}
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/newbalance_ad.html",
3+
"field_mapping": {
4+
"given_name":"94d5b3c4-499a-49e8-80a6-284b407c14d2",
5+
"family_name":"66fdc090-e5a8-42c7-8933-fc90d6a66798",
6+
"street_address":"2e77b7bc-752e-48dc-98a7-42371399d3ed",
7+
"address_level_2":"74403655-6c14-4f3a-bae9-4e0ac7db4c08",
8+
"postal_code":"3587a8f1-2639-4cb1-94be-16db11d1f291",
9+
"telephone": "36708c9a-2675-46f5-bef2-eb7e87460b8c",
10+
"email": "59b9f19d-2422-40ec-b1ea-e4e557e50512"
11+
},
12+
"form_field": "*[data-moz-autofill-inspect-id='{name}']",
13+
"fields": [
14+
"94d5b3c4-499a-49e8-80a6-284b407c14d2",
15+
"66fdc090-e5a8-42c7-8933-fc90d6a66798",
16+
"2e77b7bc-752e-48dc-98a7-42371399d3ed",
17+
"74403655-6c14-4f3a-bae9-4e0ac7db4c08",
18+
"3587a8f1-2639-4cb1-94be-16db11d1f291",
19+
"36708c9a-2675-46f5-bef2-eb7e87460b8c",
20+
"59b9f19d-2422-40ec-b1ea-e4e557e50512"
21+
]
22+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"url": "http://127.0.0.1:8080/newbalance_cc.html",
3+
"field_mapping": {
4+
"card_number": "2f4676c4-2ce0-4a97-a0cc-fb377d836441",
5+
"expiration_date": "060f9552-da63-46a8-a820-a671c185776c",
6+
"cvv": "a3ee2068-148e-4b0a-a67b-f401e0930f39"
7+
},
8+
"form_field": "*[data-moz-autofill-inspect-id='{name}']",
9+
"skip": "True",
10+
"fields": [
11+
"2f4676c4-2ce0-4a97-a0cc-fb377d836441",
12+
"060f9552-da63-46a8-a820-a671c185776c",
13+
"a3ee2068-148e-4b0a-a67b-f401e0930f39"
14+
]
15+
}

l10n_CM/run_l10n.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
"ebay",
2929
"newbalance",
3030
"zalando",
31+
"cdiscount",
3132
"aldoshoes",
3233
"canadatire"
3334
}
@@ -131,9 +132,7 @@ def get_region_tests(test_region: str) -> list[str]:
131132
region_data = load(fp)
132133
raw_tests = region_data.get("tests", [])
133134
return (
134-
list(
135-
map(lambda test: os.path.join(current_dir, "Unified", test), raw_tests)
136-
)
135+
list(map(lambda test: current_dir + "/Unified/" + test, raw_tests))
137136
if len(raw_tests) > 0
138137
else raw_tests
139138
)

l10n_CM/sites/cdiscount/FR/cdiscount_ad.html

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

l10n_CM/sites/cdiscount/FR/cdiscount_cc.html

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

l10n_CM/sites/newbalance/DE/newbalance_ad.html

Lines changed: 11 additions & 0 deletions
Large diffs are not rendered by default.

l10n_CM/sites/newbalance/DE/newbalance_cc.html

Lines changed: 11 additions & 0 deletions
Large diffs are not rendered by default.

tests/downloads/test_mixed_content_download_via_https.py

Lines changed: 22 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import re
2+
from time import sleep
23

34
import pytest
5+
from selenium.common.exceptions import StaleElementReferenceException
46
from selenium.webdriver import Firefox
57
from selenium.webdriver.common.by import By
68
from selenium.webdriver.support import expected_conditions as EC
@@ -19,7 +21,8 @@ def delete_files_regex_string():
1921
return r"\bdownload\b"
2022

2123

22-
MIXED_CONTENT_DOWNLOAD_URL = "https://b-mcb-download.glitch.me/"
24+
MIXED_CONTENT_DOWNLOAD_URL = "https://file-examples.com/wp-content/storage/2018/04/file_example_AVI_480_750kB.avi"
25+
MAX_CHECKS = 30
2326

2427

2528
def test_mixed_content_download_via_https(driver: Firefox, delete_files):
@@ -29,14 +32,10 @@ def test_mixed_content_download_via_https(driver: Firefox, delete_files):
2932

3033
web_page = GenericPage(driver, url=MIXED_CONTENT_DOWNLOAD_URL)
3134

32-
# Wait up to 30 seconds for test website to wake up and load the content
35+
# Wait up to 30 seconds for test website to wake up and download the content
3336
web_page.open()
3437
with driver.context(driver.CONTEXT_CHROME):
35-
WebDriverWait(driver, 30).until(EC.title_contains("Hello!"))
36-
37-
WebDriverWait(driver, 5).until(
38-
EC.presence_of_element_located((By.XPATH, "//button[@onclick='runtestSec()']"))
39-
).click()
38+
WebDriverWait(driver, 30).until(EC.title_contains("File Examples"))
4039

4140
with driver.context(driver.CONTEXT_CHROME):
4241
download_name = WebDriverWait(driver, 10).until(
@@ -49,12 +48,23 @@ def test_mixed_content_download_via_https(driver: Firefox, delete_files):
4948

5049
# Verify that the desired download target element is present directly, no extra steps needed.
5150
download_value = download_name.get_attribute("value")
52-
assert re.match(r"download(\(\d+\))?$", download_value), (
51+
assert re.match(r"file_example_AVI_480_750kB(\(\d+\)).avi$", download_value), (
5352
f"The download name is incorrect: {download_value}"
5453
)
5554

5655
# Verify that the download progress has reached 100%, which indicates that the download is complete.
57-
download_status_value = download_status.get_attribute("value")
58-
assert download_status_value == "100", (
59-
f"The download status is not '100': {download_status_value}"
60-
)
56+
i = 1
57+
while True:
58+
try:
59+
download_value = download_status.get_attribute("value")
60+
if download_value == "100":
61+
break
62+
except StaleElementReferenceException:
63+
pass
64+
65+
if i > MAX_CHECKS:
66+
raise TimeoutError(
67+
"Download progress did not reach 100% within reasonable time."
68+
)
69+
sleep(1)
70+
i = +1

0 commit comments

Comments
 (0)