Skip to content

Commit 0441354

Browse files
Merge branch 'main' into philimon/suite_refactor
2 parents edd46e2 + 6579ab4 commit 0441354

29 files changed

+197
-228
lines changed

.cron.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
- {hour: 17, minute: 15}
2828
- {hour: 18, minute: 15}
2929
- {hour: 19, minute: 15}
30-
- {hour: 20, minute: 15}
30+
- {hour: 20, minute: 00}
3131
- {hour: 21, minute: 15}
3232
- {hour: 22, minute: 15}
3333
- {hour: 23, minute: 15}

.github/workflows/check-beta.yml

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Check new beta version
22

33
on:
44
schedule:
5-
- cron: "16 */1 * * *"
5+
- cron: "49 */1 * * *"
66
env:
77
LATEST: ""
88
permissions:
@@ -15,10 +15,16 @@ jobs:
1515
- name: Checkout repository
1616
uses: actions/checkout@v4
1717
- name: Check if the run is reportable
18+
env:
19+
TESTRAIL_REPORT: true
20+
TESTRAIL_BASE_URL: ${{ secrets.TESTRAIL_BASE_URL }}
21+
TESTRAIL_API_KEY: ${{ secrets.TESTRAIL_API_KEY }}
22+
TESTRAIL_USERNAME: ${{ secrets.TESTRAIL_USERNAME }}
1823
run: |
1924
pip3 install 'pipenv==2023.11.15';
2025
pipenv install
21-
python3 -c 'from modules import testrail_integration as tri; import sys; sys.exit(0) if tri.reportable() else sys.exit(100)'
22-
- name: Run smoke tests
23-
uses: ./.github/workflows/smoke.yml
24-
secrets: inherit
26+
pipenv run python -c 'from modules import testrail_integration as tri; import sys; sys.exit(0) if tri.reportable() else sys.exit(100)'
27+
Run-Smoke-Tests:
28+
needs: Check-Beta-Version
29+
uses: ./.github/workflows/smoke.yml
30+
secrets: inherit

.github/workflows/smoke.yml

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@ run-name: ${{ github.actor }} is running smoke tests
55
on:
66
pull_request:
77
workflow_call:
8-
permissions:
9-
contents: 'write'
108
env:
119
TESTRAIL_BASE_URL: ${{ secrets.TESTRAIL_BASE_URL }}
1210
TESTRAIL_API_KEY: ${{ secrets.TESTRAIL_API_KEY }}
@@ -32,7 +30,7 @@ jobs:
3230
with:
3331
python-version: "3.11"
3432
- name: Set Environment
35-
if: ${{ github.event_name == 'workflow_call' }}
33+
if: ${{ github.event_name == 'schedule' }}
3634
run: |
3735
$env_contents = @"
3836
TESTRAIL_REPORT='true'
@@ -87,7 +85,7 @@ jobs:
8785
mv ./ci_pyproject_headed.toml ./pyproject.toml;
8886
$env:FX_EXECUTABLE = "C:\Program Files\Custom Firefox\firefox.exe"
8987
pipenv run python choose_ci_set.py
90-
pipenv run pytest -n 4 $(cat selected_tests)
88+
pipenv run pytest $(cat selected_tests)
9189
$env:TEST_EXIT_CODE = $LASTEXITCODE
9290
rm artifacts/assets -r -Force
9391
Get-ChildItem -Path "artifacts" | ForEach-Object {
@@ -128,9 +126,10 @@ jobs:
128126
run: |
129127
python check_test_cases.py
130128
exit $?
129+
echo "Triggered by event: ${{ github.event_name }}"
131130
- name: Set Environment
132-
if: ${{ github.event_name == 'workflow_call' }}
133-
run:
131+
if: ${{ github.event_name == 'schedule' }}
132+
run: |
134133
echo "TESTRAIL_REPORT='true'" >> "$GITHUB_ENV";
135134
echo "Running report for most recent Beta on MacOS";
136135
- name: Install dependencies
@@ -153,15 +152,6 @@ jobs:
153152
pipenv run pytest --fx-executable="$FX_EXECUTABLE" -n 4 $(cat selected_tests) || TEST_EXIT_CODE=$?
154153
mv artifacts artifacts-mac || true
155154
exit $TEST_EXIT_CODE
156-
- name: Commit Changed Tracker Files
157-
if: ${{ github.event_name == 'workflow_call' }}
158-
run: |
159-
git pull
160-
git config --global user.email ${{ github.actor }}@users.noreply.github.com;
161-
git config --global user.name ${{ github.actor }};
162-
git add mac-latest-reported-version;
163-
git commit -m "update macos reported version";
164-
git push
165155
- name: Run Smoke Tests in MacOS (Headed)
166156
if: steps.setup.conclusion == 'success' && always()
167157
env:

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
.tmp*
66
.testrail_credential*
77
.DS_Store
8+
selected_tests
89
test*.txt
910
fx_location
1011
test*txt

SELECTOR_INFO.md

Lines changed: 28 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1404,6 +1404,13 @@ Location: Any history item in the Hamburger history list
14041404
Path to .json: modules/data/context_menu.components.json
14051405
```
14061406
```
1407+
Selector Name: context-menu-add-search-engine
1408+
Selector Data: "context-menu-add-engine"
1409+
Description: Awesomebar context click option "Add <search engine>"
1410+
Location: Any history item in the Hamburger history list
1411+
Path to .json: modules/data/context_menu.components.json
1412+
```
1413+
```
14071414
Selector Name: context-menu-pin-tab
14081415
Selector Data: "context_pinTab"
14091416
Description: Tab context click option "Pin Tab"
@@ -2391,20 +2398,6 @@ Location: Private browsing mode
23912398
Path to .json: modules/data/navigation.components.json
23922399
```
23932400
```
2394-
Selector name: add-extra-search-engine
2395-
Selector Data: [id*=urlbar-engine-one-off-item-engine--1][tooltiptext*='{0}']
2396-
Description: Add extra search engine in the url bar
2397-
Location: URL bar
2398-
Path to .json: modules/data/navigation.components.json
2399-
```
2400-
```
2401-
Selector name: search-one-off-engine-button
2402-
Selector Data: [id*=urlbar-engine-one-off-item-engine][tooltiptext^='{0}']
2403-
Description: Search one off engine button
2404-
Location: URL bar search results
2405-
Path to .json: modules/data/navigation.components.json
2406-
```
2407-
```
24082401
Selector name: downloads-button
24092402
Selector Data: downloads-button
24102403
Description: Toolbar download button
@@ -2834,6 +2827,27 @@ Description: Search settings button in the searchmode switcher dropdown
28342827
Location: Address bar
28352828
Path to .json: modules/data/navigation.components.json
28362829
```
2830+
```
2831+
Selector Name: search-mode-switcher-option
2832+
Selector Data: toolbarbutton[label*='{title}']
2833+
Description: Option by label in search mode list
2834+
Location: Search mode of awesomebar
2835+
Path to .json: modules/data/navigation.components.json
2836+
```
2837+
```
2838+
Selector Name: refresh-button-awesome-bar
2839+
Selector Data: .urlbarView-action-btn[data-action=refresh]
2840+
Description: Refresh button in the awesome bar
2841+
Location: Address bar
2842+
Path to .json: modules/data/navigation.components.json
2843+
```
2844+
```
2845+
Selector Name: refresh-firefox-dialog
2846+
Selector Data: window-modal-dialog
2847+
Description: Refresh Firefox dialog window
2848+
Location: Dialog window
2849+
Path to .json: modules/data/navigation.components.json
2850+
```
28372851
#### panel_ui
28382852
```
28392853
Selector name: panel-ui-button
@@ -3420,13 +3434,6 @@ Location: In the tabbed browser.
34203434
Path to .json: modules/data/tab_bar.components.json
34213435
```
34223436
```
3423-
Selector name: tab-sound-label
3424-
Selector Data: "tab-icon-sound-{status}-label"
3425-
Description: A tab's sound status
3426-
Location: In the tabbed browser.
3427-
Path to .json: modules/data/tab_bar.components.json
3428-
```
3429-
```
34303437
Selector name: tab-title
34313438
Selector Data: "tab-text"
34323439
Description: Gets the text of a Tab (it's title)

choose_ci_set.py

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -74,19 +74,29 @@ def get_tests_by_model(
7474

7575
def dedupe(run_list: list, slash: str) -> list:
7676
"""For a run list, remove entries that are covered by more general entries."""
77-
suites = []
7877
run_list = list(set(run_list))
79-
for entry in run_list:
80-
pieces = entry.split(slash)
81-
if len(pieces) < 4:
82-
suites.append(pieces[-1])
83-
78+
dotslashes = []
8479
removes = []
85-
for entry in run_list:
86-
pieces = entry.split(slash)
87-
if len(pieces) > 3 and pieces[2] in suites:
88-
removes.append(run_list.index(entry))
8980

81+
for i, entry in enumerate(run_list):
82+
if (
83+
not entry.startswith(".")
84+
and not entry.startswith("\\")
85+
and not entry.startswith("/")
86+
):
87+
dotslashes.append(i)
88+
89+
for dotslash in dotslashes:
90+
run_list[dotslash] = f".{slash}{run_list[dotslash]}"
91+
92+
for i, entry_a in enumerate(run_list):
93+
for j, entry_b in enumerate(run_list):
94+
if i == j:
95+
continue
96+
if entry_a in entry_b:
97+
removes.append(j)
98+
99+
removes.sort(reverse=True)
90100
for remove in removes:
91101
del run_list[remove]
92102

ci_pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ markers = [
1616
testpaths = [
1717
"tests"
1818
]
19-
addopts = "-vs --ci --run-headless --json-report --reruns 3 --reruns-delay 2 -m 'not incident and not unstable and not headed' --html=artifacts/report.html"
19+
addopts = "-vs --ci --run-headless --json-report --reruns 3 --reruns-delay 3 -m 'not incident and not unstable and not headed' --html=artifacts/report.html"
2020

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

conftest.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -382,12 +382,6 @@ def pytest_sessionfinish(session):
382382
tr_session = tri.testrail_init()
383383
passes = tri.collect_changes(tr_session, report)
384384
tri.mark_results(tr_session, passes)
385-
with open(".tmp_testrail_info") as fh:
386-
(plan_title, config) = fh.read().split("|")
387-
version = os.environ.get("BETA_VERSION")
388-
prefix = config[:3].lower()
389-
with open(f"{prefix}-latest-reported-version", "w") as fh:
390-
fh.write(version)
391385

392386

393387
@pytest.fixture()

modules/browser_object_navigation.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
from selenium.common.exceptions import TimeoutException
44
from selenium.webdriver import Firefox
5+
from selenium.webdriver.common.action_chains import ActionChains
56
from selenium.webdriver.common.by import By
67
from selenium.webdriver.common.keys import Keys
78
from selenium.webdriver.remote.webelement import WebElement
@@ -179,6 +180,12 @@ def click_in_awesome_bar(self) -> BasePage:
179180
return self
180181

181182
@BasePage.context_chrome
183+
def context_click_in_awesome_bar(self) -> BasePage:
184+
self.set_awesome_bar()
185+
actions = ActionChains(self.driver)
186+
actions.context_click(self.awesome_bar).perform()
187+
return self
188+
182189
def get_download_button(self) -> WebElement:
183190
"""
184191
Gets the download button WebElement

modules/browser_object_tabbar.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ class MediaStatus:
1919
"""Fake enum: just return a string based on a constant name"""
2020

2121
def __init__(self):
22-
self.PLAYING = "playing"
22+
self.PLAYING = "soundplaying"
2323
self.MUTED = "muted"
2424
self.AUTOPLAY_BLOCKED = "blocked"
25-
self.PIP = "pip"
25+
self.PIP = "pictureinpicture"
2626

2727
MEDIA_STATUS = MediaStatus()
2828

@@ -137,11 +137,7 @@ def expect_tab_sound_status(
137137
) -> BasePage:
138138
"""Check to see if the tab has an expected MediaStatus"""
139139
tab = self.get_tab(identifier)
140-
with self.driver.context(self.driver.CONTEXT_CHROME):
141-
self.actions.move_to_element(tab).perform()
142-
self.expect(
143-
EC.visibility_of(self.get_element("tab-sound-label", labels=[status]))
144-
)
140+
self.wait.until(lambda _: tab.get_attribute(status) is not None)
145141
return self
146142

147143
def expect_title_contains(self, text: str) -> BasePage:

0 commit comments

Comments
 (0)