Skip to content

Commit 39390c0

Browse files
Hani YacoubHani Yacoub
authored andcommitted
Merge branch 'main' into Hani/enable-be
2 parents e15cf35 + 4c08d19 commit 39390c0

File tree

2 files changed

+34
-79
lines changed

2 files changed

+34
-79
lines changed

.github/workflows/l10n.yml

Lines changed: 0 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -92,25 +92,6 @@ jobs:
9292
exit $EXIT_CODE;
9393
fi
9494
exit $SCRIPT_EXIT_CODE;
95-
- name: Run L10N Tests in MacOS (Headed)
96-
if: steps.setup.conclusion == 'success' && always()
97-
env:
98-
FX_EXECUTABLE: /Volumes/${{ steps.setup.outputs.app_name }}/${{ steps.setup.outputs.app_name }}.app/Contents/MacOS/firefox
99-
REPORTABLE: ${{ env.TESTRAIL_REPORT == 'true' }}
100-
run: |
101-
mv ./ci_l10n_pyproject_headed.toml ./pyproject.toml;
102-
echo "0" > TEST_EXIT_CODE;
103-
while IFS= read -r line; do
104-
echo "Running tests for: $line";
105-
pipenv run python -m l10n_CM.run_l10n --fx-executable="$FX_EXECUTABLE" $line || SCRIPT_EXIT_CODE=$?;
106-
done < selected_l10n_mappings;
107-
ls artifacts-mac/* &>/dev/null || echo "No mappings to report" >> artifacts-mac/placeholder.txt
108-
mv -n artifacts/* artifacts-mac/ || true;
109-
EXIT_CODE=$(cat TEST_EXIT_CODE);
110-
if [ $EXIT_CODE != 0 ]; then
111-
exit $EXIT_CODE;
112-
fi
113-
exit $SCRIPT_EXIT_CODE;
11495
- name: Upload artifacts
11596
if: ${{ always() && github.event_name == 'pull_request' }}
11697
uses: actions/upload-artifact@v4
@@ -167,25 +148,6 @@ jobs:
167148
exit $EXIT_CODE;
168149
fi
169150
exit $SCRIPT_EXIT_CODE;
170-
- name: Run Smoke Tests in Ubuntu (Headed)
171-
if: steps.setup.conclusion == 'success' && always()
172-
env:
173-
REPORTABLE: ${{ env.TESTRAIL_REPORT == 'true' }}
174-
FX_EXECUTABLE: ./firefox/firefox
175-
run: |
176-
mv ./ci_l10n_pyproject_headed.toml ./pyproject.toml;
177-
echo "0" > TEST_EXIT_CODE;
178-
while IFS= read -r line; do
179-
echo "Running tests for: $line";
180-
DISPLAY=:99 pipenv run python -m l10n_CM.run_l10n --fx-executable="$FX_EXECUTABLE" $line || SCRIPT_EXIT_CODE=$?;
181-
done < selected_l10n_mappings;
182-
ls artifacts-linux/* &>/dev/null || echo "No mappings to report" >> artifacts-linux/placeholder.txt
183-
mv -n artifacts/* artifacts-linux/ || true;
184-
EXIT_CODE=$(cat TEST_EXIT_CODE);
185-
if [ $EXIT_CODE != 0 ]; then
186-
exit $EXIT_CODE;
187-
fi
188-
exit $SCRIPT_EXIT_CODE;
189151
- name: Upload artifacts
190152
if: ${{ always() && inputs.is_pull_request == true }}
191153
uses: actions/upload-artifact@v4
@@ -277,47 +239,6 @@ jobs:
277239
exit [int]$EXIT_CODE
278240
}
279241
exit $env:SCRIPT_EXIT_CODE
280-
- name: Run L10N Tests in Win (Headed)
281-
if: steps.setup.conclusion == 'success' && always()
282-
env:
283-
REPORTABLE: ${{ env.TESTRAIL_REPORT == 'true' }}
284-
run: |
285-
rm ./pyproject.toml;
286-
mv ./ci_l10n_pyproject_headed.toml ./pyproject.toml;
287-
$env:FX_EXECUTABLE = 'C:\Program Files\Custom Firefox\firefox.exe'
288-
Write-Host "FX_EXECUTABLE: $FX_EXECUTABLE"
289-
pipenv run python choose_l10n_ci_set.py
290-
"0" | Set-Content -Path "TEST_EXIT_CODE"
291-
$SCRIPT_EXIT_CODE = 0
292-
Get-Content "selected_l10n_mappings" | ForEach-Object {
293-
$line = $_
294-
Write-Host "Running tests for: $line"
295-
try {
296-
pipenv run python -m l10n_CM.run_l10n --fx-executable="$env:FX_EXECUTABLE" $line
297-
} catch {
298-
$SCRIPT_EXIT_CODE = $_.Exception.HResult
299-
}
300-
}
301-
rm artifacts/assets -r -Force -ErrorAction SilentlyContinue
302-
Get-ChildItem -Path "artifacts" -ErrorAction SilentlyContinue | ForEach-Object {
303-
$destPath = "artifacts-win\" + $_.Name
304-
if (-not (Test-Path -Path $destPath)) {
305-
try {
306-
Move-Item -Path $_.FullName -Destination $destPath
307-
} catch {
308-
# Ignore errors and continue
309-
}
310-
}
311-
}
312-
mkdir artifacts-win -Force
313-
if (-not (Test-Path -Path "artifacts-win\*")) {
314-
New-Item -Path "artifacts-win\placeholder.txt" -ItemType File -Value "no mappings to report."
315-
}
316-
$EXIT_CODE = Get-Content -Path "TEST_EXIT_CODE"
317-
if ($EXIT_CODE -ne 0) {
318-
exit [int]$EXIT_CODE
319-
}
320-
exit $env:SCRIPT_EXIT_CODE
321242
- name: Upload artifacts
322243
if: ${{ always() && inputs.is_pull_request == true }}
323244
uses: actions/upload-artifact@v4
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
import pytest
2+
from selenium.webdriver import Firefox
3+
4+
from modules.browser_object_tabbar import TabBar
5+
from modules.page_object import ExamplePage
6+
7+
8+
@pytest.fixture()
9+
def test_case():
10+
return "134645"
11+
12+
13+
@pytest.mark.headed
14+
def test_close_tab_through_middle_mouse_click(driver: Firefox):
15+
"""
16+
C134645 - Verify that middle clicking a tab will close it
17+
"""
18+
19+
example = ExamplePage(driver)
20+
tabs = TabBar(driver)
21+
example.open()
22+
23+
# Open 2 mnew tabs for a total of 3
24+
for _ in range(2):
25+
tabs.new_tab_by_button()
26+
tabs.wait_for_num_tabs(3)
27+
28+
# Ensure each tab exists and middle-click to close it
29+
for i in range(3, 1, -1):
30+
with driver.context(driver.CONTEXT_CHROME):
31+
tab_to_close = tabs.get_tab(i)
32+
assert tab_to_close is not None, f"Expected tab index {i} to exist"
33+
tabs.middle_click(tab_to_close)
34+
tabs.wait_for_num_tabs(i - 1)

0 commit comments

Comments
 (0)