Skip to content

Commit 9b7ee07

Browse files
committed
Method and docstring changes
1 parent 1109a61 commit 9b7ee07

File tree

3 files changed

+18
-10
lines changed

3 files changed

+18
-10
lines changed

tests/downloads/test_add_mime_type_doc.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def delete_files_regex_string():
2525

2626
def expected_app_name(sys_platform: str, opt_ci: bool) -> str:
2727
"""
28-
Decide which default application should be used to open .doc files, based on OS and CI environment
28+
Decide which default application should be used to open .doc files, based on OS
2929
"""
3030
if sys_platform == "Darwin":
3131
return "TextEdit" if opt_ci else "Pages"

tests/downloads/test_download_pdf.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ def test_download_pdf(
3030
C1756769 - Verify that the user can Download a PDF
3131
3232
Notes:
33-
- Firefox is launched with a **new profile** that has default download settings.
33+
- Firefox is launched with a new profile (also a test case precondition) that has default download settings.
3434
- This means the OS-level "Save File" dialog will appear for every download.
3535
- Selenium cannot interact with this native dialog directly, so the test
3636
must rely on fixed waits to give the OS time to render the dialog and to
@@ -43,8 +43,7 @@ def test_download_pdf(
4343

4444
# Click the download button
4545
pdf.open()
46-
download_button = pdf.get_element("download-button")
47-
download_button.click()
46+
pdf.click_download_button()
4847

4948
# Allow time for the download dialog to appear and pressing handle the prompt
5049
time.sleep(2)

tests/downloads/test_download_pdf_from_context_menu.py

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,18 +28,27 @@ 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)
46+
about_telemetry = AboutTelemetry(driver)
3947

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

4554
# Allow time for the save dialog to appear and handle prompt
@@ -51,8 +60,8 @@ def test_download_pdf_from_context_menu(
5160
sleep(3)
5261

5362
# Open about:telemetry and go to events tab
54-
about_telemetry = AboutTelemetry(driver).open()
55-
about_telemetry.get_element("events-tab").click()
63+
about_telemetry.open()
64+
about_telemetry.click_on("events-tab")
5665

5766
# Verify that Telemetry is recorded
5867
pdf_telemetry_data = ["downloads", "added", "fileExtension", "pdf"]

0 commit comments

Comments
 (0)