Skip to content

Commit 90e551d

Browse files
Hani YacoubHani Yacoub
authored andcommitted
merge main
2 parents e441f70 + 74e28af commit 90e551d

File tree

45 files changed

+466
-295
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+466
-295
lines changed

.github/workflows/check-devedition.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Check new devedition version
22

33
on:
44
schedule:
5-
- cron: "38 * * * *"
5+
- cron: "38 */12 * * *"
66
env:
77
LATEST: ""
88
permissions:

.github/workflows/smoke.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ env:
2323

2424
jobs:
2525
Smoke-Windows:
26+
if: ${{ inputs.job_to_run == 'Smoke-Windows' || github.event_name == 'pull_request' }}
2627
runs-on: windows-latest
2728
steps:
2829
- name: Create app token
@@ -116,6 +117,7 @@ jobs:
116117
name: artifacts-win
117118
path: artifacts-win
118119
Smoke-MacOS:
120+
if: ${{ inputs.job_to_run == 'Smoke-MacOS' || github.event_name == 'pull_request' }}
119121
runs-on: macos-latest
120122
steps:
121123
- name: Create app token
@@ -151,11 +153,11 @@ jobs:
151153
rm ./pyproject.toml;
152154
mv ./ci_pyproject.toml ./pyproject.toml;
153155
pipenv install;
154-
bash ./collect_executables.sh;
156+
echo app_name=$(bash ./collect_executables.sh | xargs -0 ./parse_executables.sh) >> "$GITHUB_OUTPUT"
155157
- name: Run Smoke Tests in MacOS
156158
if: steps.setup.conclusion == 'success'
157159
env:
158-
FX_EXECUTABLE: /Volumes/Firefox/Firefox.app/Contents/MacOS/firefox
160+
FX_EXECUTABLE: /Volumes/${{ steps.setup.outputs.app_name }}/${{ steps.setup.outputs.app_name }}.app/Contents/MacOS/firefox
159161
run: |
160162
/Volumes/Firefox/Firefox.app/Contents/MacOS/firefox --version
161163
pipenv run python choose_ci_set.py

SELECTOR_INFO.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1389,6 +1389,13 @@ Location: Appears as part of the dropdown under the autofill panel, within any e
13891389
Path to .json: modules/data/autofill_popup.components.json
13901390
```
13911391
```
1392+
Selector Name: select-form-option-by-index
1393+
Selector Data: ".autocomplete-richlistbox .autocomplete-richlistitem:nth:child({index})"
1394+
Description: Select n individual entry within the autofill dropdown, using the index of the child.
1395+
Location: Appears as part of the dropdown under the autofill panel, within any eligible form field when suggestions are available.
1396+
Path to .json: modules/data/autofill_popup.components.json
1397+
```
1398+
```
13921399
Selector Name: clear-form-option
13931400
Selector Data: ".autocomplete-richlistbox .autocomplete-richlistitem[ac-value='Clear Autofill Form']"
13941401
Description: The "Clear Autofill Form" option in the dropdown that appears when interacting with an autofill-enabled input field
@@ -2976,7 +2983,7 @@ Path to .json: modules/data/navigation.components.json
29762983
```
29772984
```
29782985
Selector Name: search-mode-switcher-option
2979-
Selector Data: toolbarbutton[label*='{title}']
2986+
Selector Data: menuitem[label*='{title}']
29802987
Description: Option by label in search mode list
29812988
Location: Search mode of awesomebar
29822989
Path to .json: modules/data/navigation.components.json

collect_executables.py

Lines changed: 58 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,8 @@ def get_gd_platform():
103103
language = "en-US"
104104

105105
if channel == "-devedition":
106+
# Devedition has special requirements as it's testing a release
107+
106108
this_devedition = BACKSTOP
107109
fx_download_dir_url = (
108110
"https://archive.mozilla.org/pub/devedition/releases/135.0b5/"
@@ -121,62 +123,60 @@ def get_gd_platform():
121123
fx_download_dir_url = next_candidate
122124

123125
devedition_version = fx_download_dir_url.split("/")[-2]
124-
if NUMBER_ONLY:
125-
print(devedition_version)
126-
else:
127-
print(
128-
f"{fx_download_dir_url}{get_fx_platform()}/{language}/Firefox%20{devedition_version}.{get_fx_executable_extension()}"
129-
)
130-
exit()
131-
132-
candidate_exists = True
133-
this_beta = BACKSTOP
134-
while candidate_exists:
135-
(major, minor_beta) = this_beta.split(".")
136-
(minor, beta) = minor_beta.split("b")
137-
major = int(major)
138-
minor = int(minor)
139-
beta = int(beta)
140-
141-
next_major = f"{major + 1}.0b1"
142-
fx_download_dir_url = f"https://archive.mozilla.org/pub/firefox/candidates/{next_major}-candidates/build1/"
143-
rs = requests.get(fx_download_dir_url)
144-
if rs.status_code < 300:
145-
latest_beta_ver = next_major
146-
this_beta = next_major
147-
continue
148-
149-
next_minor = f"{major}.{minor + 1}b1"
150-
fx_download_dir_url = f"https://archive.mozilla.org/pub/firefox/candidates/{next_minor}-candidates/build1/"
151-
rs = requests.get(fx_download_dir_url)
152-
if rs.status_code < 300:
153-
latest_beta_ver = next_minor
154-
this_beta = next_minor
155-
continue
126+
fx_download_dir_url = f"{fx_download_dir_url}{get_fx_platform()}/{language}/"
156127

157-
next_beta = f"{major}.{minor}b{beta + 1}"
158-
fx_download_dir_url = f"https://archive.mozilla.org/pub/firefox/candidates/{next_beta}-candidates/build1/"
159-
rs = requests.get(fx_download_dir_url)
160-
if rs.status_code < 300:
161-
latest_beta_ver = next_beta
162-
this_beta = next_beta
163-
continue
164-
165-
candidate_exists = False
128+
else:
129+
# Anything but devedition
166130

167-
status = 200
168-
build = 0
169-
while status < 400 and build < 20:
170-
build += 1
171-
fx_download_dir_url = f"https://archive.mozilla.org/pub/firefox/candidates/{latest_beta_ver}-candidates/build{build}/"
131+
candidate_exists = True
132+
this_beta = BACKSTOP
133+
while candidate_exists:
134+
(major, minor_beta) = this_beta.split(".")
135+
(minor, beta) = minor_beta.split("b")
136+
major = int(major)
137+
minor = int(minor)
138+
beta = int(beta)
139+
140+
next_major = f"{major + 1}.0b1"
141+
fx_download_dir_url = f"https://archive.mozilla.org/pub/firefox/candidates/{next_major}-candidates/build1/"
142+
rs = requests.get(fx_download_dir_url)
143+
if rs.status_code < 300:
144+
latest_beta_ver = next_major
145+
this_beta = next_major
146+
continue
147+
148+
next_minor = f"{major}.{minor + 1}b1"
149+
fx_download_dir_url = f"https://archive.mozilla.org/pub/firefox/candidates/{next_minor}-candidates/build1/"
150+
rs = requests.get(fx_download_dir_url)
151+
if rs.status_code < 300:
152+
latest_beta_ver = next_minor
153+
this_beta = next_minor
154+
continue
155+
156+
next_beta = f"{major}.{minor}b{beta + 1}"
157+
fx_download_dir_url = f"https://archive.mozilla.org/pub/firefox/candidates/{next_beta}-candidates/build1/"
158+
rs = requests.get(fx_download_dir_url)
159+
if rs.status_code < 300:
160+
latest_beta_ver = next_beta
161+
this_beta = next_beta
162+
continue
163+
164+
candidate_exists = False
165+
166+
status = 200
167+
build = 0
168+
while status < 400 and build < 20:
169+
build += 1
170+
fx_download_dir_url = f"https://archive.mozilla.org/pub/firefox/candidates/{latest_beta_ver}-candidates/build{build}/"
171+
172+
# Fetch the page
173+
response = requests.get(fx_download_dir_url)
174+
status = response.status_code
172175

173-
# Fetch the page
174-
response = requests.get(fx_download_dir_url)
175-
status = response.status_code
176+
# Correct build is the last one that didn't 404
177+
build -= 1
178+
fx_download_dir_url = f"https://archive.mozilla.org/pub/firefox/candidates/{latest_beta_ver}-candidates/build{build}/{get_fx_platform()}/{language}/"
176179

177-
# Correct build is the last one that didn't 404
178-
build -= 1
179-
fx_download_dir_url = f"https://archive.mozilla.org/pub/firefox/candidates/{latest_beta_ver}-candidates/build{build}/{get_fx_platform()}/{language}/"
180180
response = requests.get(fx_download_dir_url)
181181
status = response.status_code
182182
response_text = None
@@ -206,8 +206,11 @@ def get_gd_platform():
206206

207207
fx_download_executable_url = rf"{fx_download_dir_url}{executable_name}"
208208
if NUMBER_ONLY:
209-
number_cand = fx_download_dir_url.split("/")[6]
210-
number = number_cand.split("-")[0]
211-
print(f"{number}-build{build}")
209+
if channel == "-devedition":
210+
print(devedition_version)
211+
else:
212+
number_cand = fx_download_dir_url.split("/")[6]
213+
number = number_cand.split("-")[0]
214+
print(f"{number}-build{build}")
212215
else:
213216
print(fx_download_executable_url)

collect_executables.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ then
77
curl -o Firefox.dmg -L "$(pipenv run python collect_executables.py)"
88
hdiutil attach Firefox.dmg
99
else
10+
pipenv run python collect_executables.py
1011
curl -o firefox.tar.xz -L "$(pipenv run python collect_executables.py)"
1112
tar xf firefox.tar.xz
1213
fi
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
import pytest
2+
from selenium.webdriver import Firefox
3+
4+
from modules.browser_object_autofill_popup import AutofillPopup
5+
from modules.page_object_autofill import AddressFill
6+
from modules.util import Utilities
7+
8+
9+
@pytest.fixture()
10+
def test_case():
11+
return "2888563"
12+
13+
14+
def test_demo_ad_autofill_address_fields(
15+
driver: Firefox,
16+
region: str,
17+
address_autofill: AddressFill,
18+
util: Utilities,
19+
autofill_popup: AutofillPopup,
20+
):
21+
"""
22+
C2888563 - Verify Autofill functionality when selecting an entry from the dropdown for address fields
23+
"""
24+
# Create fake data and fill it in
25+
address_autofill.open()
26+
address_autofill_data = util.fake_autofill_data(region)
27+
address_autofill.save_information_basic(address_autofill_data)
28+
29+
# Click the "Save" button
30+
autofill_popup.click_doorhanger_button("save")
31+
32+
# List of field labels to be autofilled and verified
33+
fields_to_test = [
34+
"street-address",
35+
"address-level2",
36+
"address-level1", # This will be skipped for DE/FR
37+
"postal-code",
38+
"country",
39+
]
40+
41+
# Loop through each field and perform the autofill test
42+
for field in fields_to_test:
43+
address_autofill.autofill_and_verify(
44+
autofill_popup, field, address_autofill_data, util
45+
)

l10n_CM/Unified/test_demo_ad_autofill_name_org.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import pytest
22
from selenium.webdriver import Firefox
33

4-
from l10n_CM.Unified.conftest import autofill_popup
54
from modules.browser_object_autofill_popup import AutofillPopup
65
from modules.page_object_autofill import AddressFill
76
from modules.util import Utilities
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
import pytest
2+
from selenium.webdriver import Firefox
3+
4+
from modules.browser_object_autofill_popup import AutofillPopup
5+
from modules.page_object_autofill import AddressFill
6+
from modules.util import Utilities
7+
8+
9+
@pytest.fixture()
10+
def test_case():
11+
return "2888560"
12+
13+
14+
def test_demo_ad_clear_name_org(
15+
driver: Firefox,
16+
region: str,
17+
address_autofill: AddressFill,
18+
util: Utilities,
19+
autofill_popup: AutofillPopup
20+
):
21+
"""
22+
C2888560 - Verify clear functionality after selecting an entry from name/org fields
23+
"""
24+
# Create fake data and fill it in
25+
address_autofill.open()
26+
address_autofill_data = util.fake_autofill_data(region)
27+
address_autofill.save_information_basic(address_autofill_data)
28+
29+
# Click the "Save" button
30+
autofill_popup.click_doorhanger_button("save")
31+
32+
# List of field labels to be autofilled and verified
33+
fields_to_test = [
34+
"name",
35+
"organization"
36+
]
37+
38+
# Loop through each field and perform the autofill test
39+
for field in fields_to_test:
40+
address_autofill.clear_and_verify(autofill_popup, field, address_autofill_data)

l10n_CM/Unified/test_demo_ad_email_phone_captured_in_doorhanger_and_stored.py

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,17 @@ def test_demo_ad_email_phone_captured_in_doorhanger_and_stored(
3838

3939
# containing phone field
4040
expected_phone = address_autofill_data.telephone
41-
actual_phone = autofill_popup.get_cc_doorhanger_data("address-doorhanger-phone")
42-
normalize_expected = util.normalize_regional_phone_numbers(expected_phone, region)
43-
normalized_actual = util.normalize_regional_phone_numbers(actual_phone, region)
44-
assert normalized_actual == normalize_expected, (
45-
f"Phone number mismatch for {region} | Expected: {normalize_expected}, Got: {normalized_actual}"
46-
)
41+
# Skip verification if phone number isn't provided
42+
if expected_phone:
43+
with driver.context(driver.CONTEXT_CHROME):
44+
actual_phone = autofill_popup.get_element("address-doorhanger-phone").text
45+
normalize_expected = util.normalize_regional_phone_numbers(
46+
expected_phone, region
47+
)
48+
normalized_actual = util.normalize_regional_phone_numbers(actual_phone, region)
49+
assert normalized_actual == normalize_expected, (
50+
f"Phone number mismatch for {region} | Expected: {normalize_expected}, Got: {normalized_actual}"
51+
)
4752

4853
# Click the "Save" button
4954
autofill_popup.click_doorhanger_button("save")

l10n_CM/Unified/test_demo_cc_add_new_credit_card.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
import pytest
44
from selenium.webdriver import Firefox
55

6-
from l10n_CM.Unified.conftest import region
76
from modules.page_object import AboutPrefs
87
from modules.util import Utilities
98

0 commit comments

Comments
 (0)