Skip to content

Commit eb335ea

Browse files
Hani YacoubHani Yacoub
authored andcommitted
Merge branch 'main' into Hani/testrail_set_all_subs_to_functional
2 parents d0e05a7 + 0276320 commit eb335ea

File tree

168 files changed

+2871
-1326
lines changed

Some content is hidden

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

168 files changed

+2871
-1326
lines changed

.github/workflows/smoke.yml

Lines changed: 106 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
name: Mac and Windows Smoke
2+
name: Smoke Test Execution
33

44
run-name: ${{ github.actor }} is running smoke tests
55
on:
@@ -14,6 +14,20 @@ on:
1414
job_to_run:
1515
required: true
1616
type: string
17+
workflow_dispatch:
18+
inputs:
19+
win_installer_link:
20+
description: 'The link to the Windows installer (win64) for the Fx under test'
21+
required: false
22+
type: string
23+
mac_installer_link:
24+
description: 'The link to the macOS installer for the Fx under test'
25+
required: false
26+
type: string
27+
linux_tarball_link:
28+
description: 'The link to the Linux tarball (linux-x86_64) for the Fx under test'
29+
required: false
30+
type: string
1731
env:
1832
FX_CHANNEL: ${{ inputs.channel }}
1933
TESTRAIL_BASE_URL: ${{ secrets.TESTRAIL_BASE_URL }}
@@ -23,7 +37,7 @@ env:
2337

2438
jobs:
2539
Smoke-Windows:
26-
if: ${{ inputs.job_to_run == 'Smoke-Windows' || github.event_name == 'pull_request' }}
40+
if: ${{ inputs.job_to_run == 'Smoke-Windows' || github.event_name == 'pull_request' || inputs.win_installer_link }}
2741
runs-on: windows-latest
2842
steps:
2943
- name: Create app token
@@ -40,7 +54,15 @@ jobs:
4054
uses: actions/setup-python@v5
4155
with:
4256
python-version: "3.11"
43-
- name: Set Environment
57+
- name: Set Environment (Manual)
58+
if: ${{ inputs.win_installer_link }}
59+
run: |
60+
$env_contents = @"
61+
MANUAL='true'
62+
"@
63+
New-item -Name .env -Value $env_contents -ItemType File -Force
64+
Write-Host "Running smoke tests on supplied executable"
65+
- name: Set Environment (Scheduled Beta)
4466
if: ${{ inputs.job_to_run == 'Smoke-Windows' }}
4567
run: |
4668
$env_contents = @"
@@ -65,12 +87,19 @@ jobs:
6587
unzip geckodriver.zip
6688
shell: pwsh
6789
- name: Download Beta
90+
if: ${{ !inputs.win_installer_link }}
6891
run: |
6992
$fx_url = (pipenv run python collect_executables.py) -join "`n"
7093
echo $fx_url
7194
Invoke-WebRequest -Uri $fx_url -OutFile "${{ github.workspace }}\setup.exe"
7295
New-Item -ItemType Directory -Path "C:\Program Files\Custom Firefox" -Force
7396
shell: pwsh
97+
- name: Download Executable
98+
if: ${{ inputs.win_installer_link }}
99+
run: |
100+
Invoke-WebRequest -Uri ${{ inputs.win_installer_link }} -OutFile "${{ github.workspace }}\setup.exe"
101+
New-Item -ItemType Directory -Path "C:\Program Files\Custom Firefox" -Force
102+
shell: pwsh
74103
- name: Install Beta
75104
id: setup
76105
run: |
@@ -117,7 +146,7 @@ jobs:
117146
name: artifacts-win
118147
path: artifacts-win
119148
Smoke-MacOS:
120-
if: ${{ inputs.job_to_run == 'Smoke-MacOS' || github.event_name == 'pull_request' }}
149+
if: ${{ inputs.job_to_run == 'Smoke-MacOS' || github.event_name == 'pull_request' || inputs.mac_installer_link }}
121150
runs-on: macos-latest
122151
steps:
123152
- name: Create app token
@@ -139,20 +168,29 @@ jobs:
139168
python check_test_cases.py
140169
exit $?
141170
echo "Triggered by event: ${{ github.event_name }}"
142-
- name: Set Environment
171+
- name: Set Environment (Scheduled Beta)
143172
if: ${{ inputs.job_to_run == 'Smoke-MacOS' }}
144173
run: |
145174
echo "TESTRAIL_REPORT='true'" >> "$GITHUB_ENV";
146175
echo "Running report for most recent Beta on MacOS";
176+
- name: Set Environment (Manual)
177+
if: ${{ inputs.mac_installer_link }}
178+
run: |
179+
echo "MANUAL='true'" >> "$GITHUB_ENV";
180+
echo "Running smoke tests on supplied executable";
147181
- name: Install dependencies
148-
id: setup
149182
run: |
150183
mkdir -p artifacts;
151184
pip3 install 'pipenv==2023.11.15';
152185
pip3 install 'ruff>=0.4.8,<0.5';
153186
rm ./pyproject.toml;
154187
mv ./ci_pyproject.toml ./pyproject.toml;
155-
pipenv install;
188+
pipenv install
189+
- name: Install Fx
190+
id: setup
191+
env:
192+
MANUAL_DOWNLOAD_LINK: ${{ inputs.mac_installer_link }}
193+
run:
156194
echo app_name=$(bash ./collect_executables.sh | xargs -0 ./parse_executables.sh) >> "$GITHUB_OUTPUT"
157195
- name: Run Smoke Tests in MacOS
158196
if: steps.setup.conclusion == 'success'
@@ -181,8 +219,69 @@ jobs:
181219
with:
182220
name: artifacts-mac
183221
path: artifacts-mac
222+
Smoke-Linux:
223+
if: ${{ inputs.linux_tarball_link }}
224+
runs-on: ubuntu-latest
225+
steps:
226+
- name: Create app token
227+
uses: actions/create-github-app-token@v1
228+
id: app-token
229+
with:
230+
app-id: ${{ secrets.BOT_CLIENT_ID }}
231+
private-key: ${{ secrets.BOT_PRIVATE_KEY }}
232+
- name: Checkout repository
233+
uses: actions/checkout@v4
234+
with:
235+
token: ${{ steps.app-token.outputs.token }}
236+
- name: Set up Python 3.11
237+
uses: actions/setup-python@v5
238+
with:
239+
python-version: "3.11"
240+
- name: Check test case numbers
241+
run: |
242+
python check_test_cases.py
243+
exit $?
244+
echo "Triggered by event: ${{ github.event_name }}"
245+
- name: Install dependencies
246+
id: setup
247+
env:
248+
MANUAL_DOWNLOAD_LINK: ${{ inputs.linux_tarball_link }}
249+
run: |
250+
echo "MANUAL='true'" >> "$GITHUB_ENV";
251+
echo "Running smoke tests on supplied executable";
252+
sudo apt install gnome-screenshot
253+
uname -m;
254+
mkdir -p artifacts;
255+
pip3 install 'pipenv==2023.11.15';
256+
pip3 install 'ruff>=0.4.8,<0.5';
257+
rm ./pyproject.toml;
258+
mv ./ci_xvfb_pyproject.toml ./pyproject.toml;
259+
pipenv install;
260+
./collect_executables.sh
261+
./firefox/firefox --version;
262+
#. ./keyring-unlock.sh;
263+
- name: Run Smoke Tests in Ubuntu
264+
if: steps.setup.conclusion == 'success'
265+
env:
266+
FX_EXECUTABLE: ./firefox/firefox
267+
run: |
268+
"$FX_EXECUTABLE" --version;
269+
pipenv run python choose_ci_set.py;
270+
Xvfb :99 -screen 0 '1600x1200x24' > artifacts/xvfb.log &
271+
DISPLAY=:99 pipenv run pytest --fx-executable="$FX_EXECUTABLE" -n 4 $(cat selected_tests) || TEST_EXIT_CODE=$?
272+
exit $TEST_EXIT_CODE
273+
- name: Run Smoke Tests in Ubuntu (Headed)
274+
if: steps.setup.conclusion == 'success' && always()
275+
env:
276+
FX_EXECUTABLE: ./firefox/firefox
277+
run: |
278+
mv ./ci_xvfb_pyproject_headed.toml ./pyproject.toml;
279+
pipenv run python choose_ci_set.py
280+
DISPLAY=:99 pipenv run pytest --fx-executable="$FX_EXECUTABLE" $(cat selected_tests) || TEST_EXIT_CODE=$?
281+
exit $TEST_EXIT_CODE
184282
185283
Use-Artifacts:
284+
if: ${{ github.event_name != 'workflow_dispatch' }}
186285
runs-on: ubuntu-latest
187286
needs:
188287
- Smoke-Windows

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,7 @@ tests/test_scratch.py
194194

195195
# Credentials
196196
credentials.json
197+
testrail_credentials.env
197198

198199
# Do not ignore
199200
!data/goomy.png

README.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,28 @@ You may find that if you are re-running all previously executed test runs that y
127127
"Session is not reportable." If you wish to overwrite a previously reported session, add
128128
`REPORTABLE=true` to your environment.
129129

130+
### Manual Execution of Smoke Tests
131+
132+
To run the smoke tests manually against an arbitrary version of Firefox **where the installer or (for Linux)
133+
tarball exists on the web**:
134+
135+
- Get write permissions to the repo (ask Ben C, Tracy, or Virgil S to add you)
136+
- Go to the [Smoke Test Execution workflow page](https://github.com/mozilla/fx-desktop-qa-automation/actions/workflows/smoke.yml)
137+
- At the top right of the workflow history panel (near the top right of the page), press the button
138+
labeled "Run workflow"
139+
- Make sure you are running against `Branch: main`
140+
- Alternately, runs can be made against ESR versions 128 and higher by running against `Branch: 00esr-manual`
141+
- MacOS ESR manual runs are currently not supported
142+
- Add the URLs to your installers for Windows and MacOS, and the tarball for Linux in the fields below.
143+
- **Installers and tarballs must be available on the internet**
144+
- **Windows should be x86, 64-bit (win64), .exe installer (no .msi)**
145+
- **MacOS should be a .dmg installer (no .pkg)**
146+
- **Linux should be a .tar.xz or .tar.bz2 tarball (no .deb)**
147+
- **Version numbers less than 128 are not likely to work**
148+
- Press the green "Run workflow" option
149+
- In a few minutes, the top workflow should be yours. Click through to watch progress.
150+
- Linux runs throw a lot of warnings, ignore them and focus on the results. Green checks are the key.
151+
130152
### Project Contribution
131153
If you are outside of Mozilla and would like to contribute to this project:
132154
- Read all the documentation including this README, BEST_PRACTICES and CODE_OF_CONDUCT.

SELECTOR_INFO.md

Lines changed: 9 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -571,13 +571,6 @@ Location: about:preferences#privacy popup dialog
571571
Path to .json: modules/data/about_prefs.components.json
572572
```
573573
```
574-
Selector Name: dialog-close-button
575-
Selector Data: "dialogClose"
576-
Description: The close button of the popup dialog
577-
Location: top right corner of about:preferences popup dialog
578-
Path to .json: modules/data/about_prefs.components.json
579-
```
580-
```
581574
Selector Name: saved-addresses
582575
Selector Data: "addresses"
583576
Description: The element that contains the saved addresses
@@ -1368,14 +1361,7 @@ Location: Inside any autofill-eligible form field, triggered by user interaction
13681361
Path to .json: modules/data/autofill_popup.components.json
13691362
```
13701363
```
1371-
Selector Name: address-preview-form-container
1372-
Selector Data: "address-save-update-notification-content"
1373-
Description: Form container that is hidden in chrome context. Used to verify hover preview data
1374-
Location: Inside chrome context, holds the data that would be showed as a preview when autofill is hovered.
1375-
Path to .json: modules/data/autofill_popup.components.json
1376-
```
1377-
```
1378-
Selector Name: cc-preview-form-container
1364+
Selector Name: preview-form-container
13791365
Selector Data: ".autocomplete-richlistbox richlistitem"
13801366
Description: Form container that is hidden in chrome context. Used to verify hover preview data
13811367
Location: Inside chrome context, holds the data that would be showed as a preview when autofill is hovered.
@@ -2630,7 +2616,7 @@ Path to .json: modules/data/navigation.components.json
26302616
```
26312617
```
26322618
Selector name: sponsored-suggestion
2633-
Selector Data: urlbarView-row-body-description
2619+
Selector Data: urlbarView-group-aria-label
26342620
Description: Sponsored search results
26352621
Location: URL bar search results
26362622
Path to .json: modules/data/navigation.components.json
@@ -2643,6 +2629,13 @@ Location: URL bar search results
26432629
Path to .json: modules/data/navigation.components.json
26442630
```
26452631
```
2632+
Selector name: suggestion-titles
2633+
Selector Data: urlbarView-title
2634+
Description: Firefox suggestion search results item titles
2635+
Location: URL bar suggestion results
2636+
Path to .json: modules/data/navigation.components.json
2637+
```
2638+
```
26462639
Selector name: search-result-autofill-adaptive-element
26472640
Selector Data: .//*[@type='autofill_adaptive']
26482641
Description: Search result autofill adaptive element

choose_ci_set.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,11 +107,14 @@ def dedupe(run_list: list, slash: str) -> list:
107107
if __name__ == "__main__":
108108
if os.path.exists(".env"):
109109
with open(".env") as fh:
110-
if "TESTRAIL_REPORT='true'" in fh.read():
110+
contents = fh.read()
111+
if "TESTRAIL_REPORT='true'" in contents:
111112
os.environ["TESTRAIL_REPORT"] = "true"
113+
if "RUN_ALL='true'" in contents:
114+
os.environ["MANUAL"] = "true"
112115

113-
if os.environ.get("TESTRAIL_REPORT"):
114-
# Run all tests if this is a scheduled beta
116+
if os.environ.get("TESTRAIL_REPORT") or os.environ.get("MANUAL"):
117+
# Run all tests if this is a scheduled beta or a manual run
115118
with open(OUTPUT_FILE, "w") as fh:
116119
fh.write("tests")
117120
sys.exit(0)

ci_pyproject.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ markers = [
1111
"ci: basic tests to run in ci",
1212
"locale_de: tests run in DE locale versions",
1313
"locale_fr: tests run in FR locale versions",
14-
"locale_gb: tests run in GB locale versions"
14+
"locale_gb: tests run in GB locale versions",
15+
"noxvfb: tests that should not run in xvfb sessions"
1516
]
1617
testpaths = [
1718
"tests"

ci_pyproject_headed.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ markers = [
1111
"ci: basic tests to run in ci",
1212
"locale_de: tests run in DE locale versions",
1313
"locale_fr: tests run in FR locale versions",
14-
"locale_gb: tests run in GB locale versions"
14+
"locale_gb: tests run in GB locale versions",
15+
"noxvfb: tests that should not run in xvfb sessions"
1516
]
1617
testpaths = [
1718
"tests"

ci_xvfb_pyproject.toml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
[tool.pytest.ini_options]
2+
generate_report_on_test = true
3+
log_cli = true
4+
log_cli_level = "warn"
5+
markers = [
6+
"audio: test is reliant on audio",
7+
"headed: test must run in headed mode (e.g. uses pynput)",
8+
"incident: incident smoke tests",
9+
"unstable: temporary mark for unstable tests",
10+
"slow: test is clocked at more than 30s on modern machines",
11+
"ci: basic tests to run in ci",
12+
"locale_de: tests run in DE locale versions",
13+
"locale_fr: tests run in FR locale versions",
14+
"locale_gb: tests run in GB locale versions",
15+
"noxvfb: tests that should not run in xvfb sessions"
16+
]
17+
testpaths = [
18+
"tests"
19+
]
20+
addopts = "-vs --ci --run-headless --json-report --json-report-file artifacts/report.json --reruns 3 --reruns-delay 3 -m 'not unstable and not headed and not noxvfb' --html=artifacts/report.html"
21+
22+
[tool.ruff]
23+
target-version = "py310"

ci_xvfb_pyproject_headed.toml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
[tool.pytest.ini_options]
2+
generate_report_on_test = true
3+
log_cli = true
4+
log_cli_level = "warn"
5+
markers = [
6+
"audio: test is reliant on audio",
7+
"headed: test must run in headed mode (e.g. uses pynput)",
8+
"incident: incident smoke tests",
9+
"unstable: temporary mark for unstable tests",
10+
"slow: test is clocked at more than 30s on modern machines",
11+
"ci: basic tests to run in ci",
12+
"locale_de: tests run in DE locale versions",
13+
"locale_fr: tests run in FR locale versions",
14+
"locale_gb: tests run in GB locale versions",
15+
"noxvfb: tests that should not run in xvfb sessions"
16+
]
17+
testpaths = [
18+
"tests"
19+
]
20+
addopts = "-vs --ci --json-report --json-report-file artifacts/report_headed.json --reruns 3 --reruns-delay 2 -m 'not unstable and not noxvfb and headed' --html=artifacts/report_headed.html"
21+
22+
[tool.ruff]
23+
target-version = "py310"

collect_executables.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ def get_gd_platform():
8383
gd_platform = get_gd_platform()
8484
ext = "zip" if "win" in gd_platform else "tar.gz"
8585
print(
86-
f"https://github.com/mozilla/geckodriver/releases/download/v0.35.0/geckodriver-v0.35.0-{gd_platform}.{ext}"
86+
f"https://github.com/mozilla/geckodriver/releases/download/v0.36.0/geckodriver-v0.36.0-{gd_platform}.{ext}"
8787
)
8888
exit()
8989

0 commit comments

Comments
 (0)