File tree Expand file tree Collapse file tree 2 files changed +51
-0
lines changed
Expand file tree Collapse file tree 2 files changed +51
-0
lines changed Original file line number Diff line number Diff line change @@ -387,6 +387,10 @@ downloads:
387387 result : pass
388388 splits :
389389 - functional1
390+ test_download_mp3_and_check_extension :
391+ result : pass
392+ splits :
393+ - functional1
390394 test_download_pdf :
391395 result : pass
392396 splits :
Original file line number Diff line number Diff line change 1+ import pytest
2+ from selenium .webdriver import Firefox
3+
4+ from modules .browser_object_navigation import Navigation
5+ from modules .page_object_generics import GenericPage
6+
7+ MP3_URL = "https://download.samplelib.com/mp3/sample-3s.mp3"
8+ MP3_NAME_REGEX = r".*\.mp3(\s\(\d+\))?$"
9+
10+
11+ @pytest .fixture ()
12+ def test_case ():
13+ return "1836832"
14+
15+
16+ @pytest .mark .headed
17+ def test_download_mp3_and_check_extension (driver : Firefox ):
18+ """
19+ 1836829: Verify the mp3 filename shown in Firefox Downloads panel includes `.mp3`
20+ """
21+ nav = Navigation (driver )
22+
23+ # Load a normal page
24+ page = GenericPage (driver , url = "about:blank" )
25+ page .open ()
26+
27+ # Simulate downloading the file by creating and clicking an anchor element
28+ driver .execute_script (
29+ """
30+ const a = document.createElement("a");
31+ a.href = arguments[0];
32+ a.click();
33+ """ ,
34+ MP3_URL ,
35+ )
36+
37+ # Dismiss "harmful file" warning if present
38+ try :
39+ nav .click_file_download_warning_panel ()
40+ except Exception :
41+ pass
42+
43+ # Wait for the download entry in the panel
44+ nav .element_visible ("download-target-element" )
45+
46+ # Reuse the verification that already worked
47+ nav .verify_download_name (MP3_NAME_REGEX )
You can’t perform that action at this time.
0 commit comments