Skip to content

Commit ed42c36

Browse files
committed
Test CI
1 parent ba22be7 commit ed42c36

File tree

2 files changed

+15
-6
lines changed

2 files changed

+15
-6
lines changed

tests/downloads/test_add_mime_type_doc.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def expected_app_name(sys_platform: str, opt_ci: bool) -> str:
3333
return "LibreOffice Writer"
3434

3535

36-
@pytest.mark.skipif(WIN_GHA, reason="Test unstable in Windows Github Actions")
36+
# @pytest.mark.skipif(WIN_GHA, reason="Test unstable in Windows Github Actions")
3737
@pytest.mark.noxvfb
3838
def test_mime_type_doc(driver: Firefox, sys_platform: str, opt_ci: bool, delete_files):
3939
"""

tests/downloads/test_download_pdf_from_context_menu.py

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,18 +28,26 @@ def test_download_pdf_from_context_menu(
2828
):
2929
"""
3030
C1756790: Verify that Telemetry is Recorded when Saving a PDF from the Context menu
31+
32+
Notes:
33+
- Firefox is launched with a new profile (also a test case precondition) that has default download settings.
34+
- This means the OS-level "Save File" dialog will appear for every download.
35+
- Selenium cannot interact with this native dialog directly, so the test
36+
must rely on fixed waits to give the OS time to render the dialog and to
37+
finish writing the file.
3138
"""
3239

3340
from pynput.keyboard import Controller
3441

42+
# Initialize objects
3543
pdf = GenericPdf(driver, pdf_url=fillable_pdf_url)
36-
pdf.open()
3744
keyboard = Controller()
38-
body = pdf.get_element("pdf-body")
45+
context_menu = ContextMenu(driver)
3946

40-
# Right-click on the body of the file and select Save page as
47+
# Open the PDF file, right-click on the body of the file and select Save page as
48+
pdf.open()
49+
body = pdf.get_element("pdf-body")
4150
pdf.context_click(body)
42-
context_menu = ContextMenu(driver)
4351
context_menu.click_and_hide_menu("context-menu-save-page-as")
4452

4553
# Allow time for the save dialog to appear and handle prompt
@@ -51,7 +59,8 @@ def test_download_pdf_from_context_menu(
5159
sleep(3)
5260

5361
# Open about:telemetry and go to events tab
54-
about_telemetry = AboutTelemetry(driver).open()
62+
about_telemetry = AboutTelemetry(driver)
63+
about_telemetry.open()
5564
about_telemetry.get_element("events-tab").click()
5665

5766
# Verify that Telemetry is recorded

0 commit comments

Comments
 (0)