@@ -38,6 +38,7 @@ class MyTestClass(BaseCase):
38
38
from seleniumbase .core .testcase_manager import TestcaseDataPayload
39
39
from seleniumbase .core .testcase_manager import TestcaseManager
40
40
from seleniumbase .core import browser_launcher
41
+ from seleniumbase .core import download_helper
41
42
from seleniumbase .core import log_helper
42
43
from seleniumbase .fixtures import constants
43
44
from seleniumbase .fixtures import page_actions
@@ -688,6 +689,23 @@ def save_file_as(self, file_url, new_file_name, destination_folder=None):
688
689
page_utils ._download_file_to (
689
690
file_url , destination_folder , new_file_name )
690
691
692
+ def get_downloads_folder (self ):
693
+ """ Returns the OS path of the Downloads Folder.
694
+ (Works with Chrome and Firefox only, for now.) """
695
+ return download_helper .get_downloads_folder ()
696
+
697
+ def get_path_of_downloaded_file (self , file ):
698
+ """ Returns the OS path of the downloaded file. """
699
+ return os .path .join (self .get_downloads_folder (), file )
700
+
701
+ def is_downloaded_file_present (self , file ):
702
+ """ Checks if the file exists in the Downloads Folder. """
703
+ return os .path .exists (self .get_path_of_downloaded_file (file ))
704
+
705
+ def assert_downloaded_file (self , file ):
706
+ """ Asserts that the file exists in the Downloads Folder. """
707
+ assert os .path .exists (self .get_path_of_downloaded_file (file ))
708
+
691
709
def convert_xpath_to_css (self , xpath ):
692
710
return xpath_to_css .convert_xpath_to_css (xpath )
693
711
0 commit comments