Skip to content

Commit 56291b2

Browse files
Merge branch 'main' into anca/CM-cleanup
2 parents befe196 + b662374 commit 56291b2

34 files changed

+466
-41
lines changed

.github/workflows/l10n.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ jobs:
8888
pipenv run python check_l10n_test_cases.py;
8989
while IFS= read -r line; do
9090
echo "Running tests for: $line";
91-
pipenv run python l10n_CM/run_l10n.py --fx-executable="$FX_EXECUTABLE" $line || SCRIPT_EXIT_CODE=$?;
91+
pipenv run python -m l10n_CM.run_l10n --fx-executable="$FX_EXECUTABLE" $line || SCRIPT_EXIT_CODE=$?;
9292
done < selected_l10n_mappings;
9393
mv artifacts artifacts-mac || true;
9494
EXIT_CODE=$(cat TEST_EXIT_CODE);
@@ -106,7 +106,7 @@ jobs:
106106
echo "0" > TEST_EXIT_CODE;
107107
while IFS= read -r line; do
108108
echo "Running tests for: $line";
109-
pipenv run python l10n_CM/run_l10n.py --fx-executable="$FX_EXECUTABLE" $line || SCRIPT_EXIT_CODE=$?;
109+
pipenv run python -m l10n_CM.run_l10n --fx-executable="$FX_EXECUTABLE" $line || SCRIPT_EXIT_CODE=$?;
110110
done < selected_l10n_mappings;
111111
mv -n artifacts/* artifacts-mac/ || true;
112112
EXIT_CODE=$(cat TEST_EXIT_CODE);
@@ -170,7 +170,7 @@ jobs:
170170
Xvfb :99 -screen 0 '1600x1200x24' > artifacts/xvfb.log &
171171
while IFS= read -r line; do
172172
echo "Running tests for: $line";
173-
DISPLAY=:99 pipenv run python l10n_CM/run_l10n.py --fx-executable="$FX_EXECUTABLE" $line || SCRIPT_EXIT_CODE=$?;
173+
DISPLAY=:99 pipenv run python -m l10n_CM.run_l10n --fx-executable="$FX_EXECUTABLE" $line || SCRIPT_EXIT_CODE=$?;
174174
done < selected_l10n_mappings;
175175
mv artifacts artifacts-linux || true;
176176
EXIT_CODE=$(cat TEST_EXIT_CODE);
@@ -188,7 +188,7 @@ jobs:
188188
echo "0" > TEST_EXIT_CODE;
189189
while IFS= read -r line; do
190190
echo "Running tests for: $line";
191-
DISPLAY=:99 pipenv run python l10n_CM/run_l10n.py --fx-executable="$FX_EXECUTABLE" $line || SCRIPT_EXIT_CODE=$?;
191+
DISPLAY=:99 pipenv run python -m l10n_CM.run_l10n --fx-executable="$FX_EXECUTABLE" $line || SCRIPT_EXIT_CODE=$?;
192192
done < selected_l10n_mappings;
193193
mv -n artifacts/* artifacts-linux/ || true;
194194
EXIT_CODE=$(cat TEST_EXIT_CODE);
@@ -284,7 +284,7 @@ jobs:
284284
$line = $_
285285
Write-Host "Running tests for: $line"
286286
try {
287-
pipenv run python l10n_CM/run_l10n.py --fx-executable="$env:FX_EXECUTABLE" $line
287+
pipenv run python -m l10n_CM.run_l10n --fx-executable="$env:FX_EXECUTABLE" $line
288288
} catch {
289289
$SCRIPT_EXIT_CODE = $_.Exception.HResult
290290
}
@@ -311,7 +311,7 @@ jobs:
311311
$line = $_
312312
Write-Host "Running tests for: $line"
313313
try {
314-
pipenv run python l10n_CM/run_l10n.py --fx-executable="$env:FX_EXECUTABLE" $line
314+
pipenv run python -m l10n_CM.run_l10n --fx-executable="$env:FX_EXECUTABLE" $line
315315
} catch {
316316
$SCRIPT_EXIT_CODE = $_.Exception.HResult
317317
}

l10n_CM/README.md

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ The harness relies on several configuration files:
7171
## Usage
7272

7373
```bash
74-
python run_l10n.py [FLAGS] [REGIONS] [SITES]
74+
python -m l10n_CM.run_l10n [FLAGS] [REGIONS] [SITES]
7575
```
7676

7777
### Parameters
@@ -92,22 +92,22 @@ python run_l10n.py [FLAGS] [REGIONS] [SITES]
9292

9393
```bash
9494
# Run tests for all regions and sites
95-
python run_l10n.py
95+
python -m l10n_CM.run_l10n
9696

9797
# Run all tests for US region only across all available sites
98-
python run_l10n.py US
98+
python -m l10n_CM.run_l10n US
9999

100100
# Run all tests for amazon site only across all regions
101-
python run_l10n.py US
101+
python -m l10n_CM.run_l10n US
102102

103103
# Run tests for US region on amazon site
104-
python run_l10n.py US amazon
104+
python -m l10n_CM.run_l10n US amazon
105105

106106
# Run tests for US and CA regions with 4 parallel workers
107-
python run_l10n.py -n 4 US CA
107+
python -m l10n_CM.run_l10n -n 4 US CA
108108

109109
# Run tests for US region on amazon site in headless mode
110-
python run_l10n.py --run-headless US amazon
110+
python -m l10n_CM.run_l10n --run-headless US amazon
111111
```
112112

113113
## Architecture
@@ -137,6 +137,7 @@ The framework sets the following environment variables during test execution:
137137
- `CM_SITE`: The site being tested
138138
- `FX_REGION`: The region being tested
139139
- `TEST_EXIT_CODE`: Exit code of the test execution
140+
- `FX_L10N`: Flag to check whether l10n workflow is being run.
140141

141142
## Adding New Tests
142143

@@ -153,6 +154,10 @@ The framework sets the following environment variables during test execution:
153154
5. Create the necessary mapping files in `constants/{site_name}/{region}/`
154155
* The naming convention for both the mapping files and the HTML files are `{site}_ad` for Address Pages and `{site}_cc` for Credit Card Pages.
155156

157+
## Useful Documents
158+
- [Sites/Regions to Automate](https://docs.google.com/spreadsheets/d/15_ejIC3YABnMGHafgkLeuuu_wakfpiLapOmUdBF2pVI/edit?usp=sharing)
159+
- [Skipped Automation Test Combinations](https://docs.google.com/document/d/18zYICZ3lbtUK7-LC-2Gt8jRbxQp0w0Is0ytM2BrcD7w/edit?usp=sharing)
160+
156161
## Troubleshooting
157162

158163
- **Invalid Arguments**: Ensure all region codes, site names, and flags are valid
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/aldoshoes_ad.html",
3+
"field_mapping": {
4+
"email": "0601af09-6be4-458e-aece-b697f54440d0",
5+
"given_name":"4923a310-2b5b-4053-8864-7059d5522d23",
6+
"family_name":"e9558e91-ba1a-49c9-aa33-8dda969f7f47",
7+
"street_address": "7cba876b-f9c1-4c3a-8f6b-32f448794b48",
8+
"address_level_2": "bcb31920-3557-4816-8b78-7a7d2848d953",
9+
"address_level_1": "ab93b6cb-cb1f-44a2-8b82-6d086c31729f",
10+
"postal_code": "859aaa97-ad32-4b51-8d1e-57182fffdf00",
11+
"telephone": "d355f108-0b70-4b02-b170-6ecd80e8e914"
12+
},
13+
"form_field": "*[data-moz-autofill-inspect-id='{name}']",
14+
"fields": [
15+
"0601af09-6be4-458e-aece-b697f54440d0",
16+
"4923a310-2b5b-4053-8864-7059d5522d23",
17+
"e9558e91-ba1a-49c9-aa33-8dda969f7f47",
18+
"7cba876b-f9c1-4c3a-8f6b-32f448794b48",
19+
"bcb31920-3557-4816-8b78-7a7d2848d953",
20+
"ab93b6cb-cb1f-44a2-8b82-6d086c31729f",
21+
"859aaa97-ad32-4b51-8d1e-57182fffdf00",
22+
"d355f108-0b70-4b02-b170-6ecd80e8e914"
23+
]
24+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"url": "http://127.0.0.1:8080/aldoshoes_cc.html",
3+
"field_mapping": {
4+
"card_number": "card",
5+
"name": "name",
6+
"expiration_month": "expmonth",
7+
"expiration_year": "expyear"
8+
},
9+
"form_field": "*[data-moz-autofill-inspect-id='{name}']",
10+
"skip": "True",
11+
"fields": [
12+
"card",
13+
"name",
14+
"expmonth",
15+
"expyear"
16+
]
17+
}

l10n_CM/constants/calvinklein/US/calvinklein_ad.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
},
1313

1414
"form_field": "*[data-moz-autofill-inspect-id='{given_name}']",
15+
"skip": "True",
1516
"fields": [
1617
"5d2af5cb-8f6d-4fdc-8ae5-21c7e5e97a43",
1718
"82900c67-963c-40f8-b0ef-c986a2accc43",
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"url": "http://127.0.0.1:8080/canadatire_ad.html",
3+
"field_mapping": {
4+
"street_address": "0a83813e-53bc-4e86-9e5c-e7c3d82903e5",
5+
"address_level_2": "9d74745a-8c68-4fe5-b163-d035468a3935",
6+
"postal_code": "fe227768-f39b-4ec5-8f02-ee824696bca0"
7+
},
8+
"form_field": "*[data-moz-autofill-inspect-id='{given_name}']",
9+
"fields": [
10+
"0a83813e-53bc-4e86-9e5c-e7c3d82903e5",
11+
"9d74745a-8c68-4fe5-b163-d035468a3935",
12+
"fe227768-f39b-4ec5-8f02-ee824696bca0"
13+
]
14+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"url": "http://127.0.0.1:8080/canadatire_cc.html",
3+
"field_mapping": {
4+
"cardholder_name": "card",
5+
"card_number": "card",
6+
"expiration_date": "card",
7+
"cvv": "card"
8+
},
9+
"form_field": "*[data-moz-autofill-inspect-id='{name}']",
10+
"skip": "True",
11+
"fields": [
12+
"card",
13+
"card",
14+
"card",
15+
"card",
16+
"card"
17+
]
18+
}
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: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"url": "http://127.0.0.1:8080/ebay_ad.html",
3+
"field_mapping": {
4+
"given_name":"9aae675e-5ad3-432c-b920-bb8f0a6e8a7c",
5+
"family_name":"b3161d6b-a8fd-46ae-8099-d75cf34502cf",
6+
"street_address":"98678400-36f3-4132-bb4c-177c6d2420c1",
7+
"address_level_2":"d18b5a17-2f53-4f76-9360-073bd188ac52",
8+
"postal_code":"d561a175-12e9-41c5-8019-ef58d432e763",
9+
"telephone": "28a8b204-deb2-408b-bf6d-180066ea5190"
10+
11+
},
12+
"form_field": "*[data-moz-autofill-inspect-id='{name}']",
13+
"fields": [
14+
"9aae675e-5ad3-432c-b920-bb8f0a6e8a7c",
15+
"b3161d6b-a8fd-46ae-8099-d75cf34502cf",
16+
"98678400-36f3-4132-bb4c-177c6d2420c1",
17+
"d18b5a17-2f53-4f76-9360-073bd188ac52",
18+
"d561a175-12e9-41c5-8019-ef58d432e763",
19+
"28a8b204-deb2-408b-bf6d-180066ea5190"
20+
]
21+
}

0 commit comments

Comments
 (0)