Skip to content

Commit bba7286

Browse files
committed
If the downloads_folder doesn't exist, create it for downloads
1 parent 681ba40 commit bba7286

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

seleniumbase/fixtures/base_case.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2027,6 +2027,8 @@ def download_file(self, file_url, destination_folder=None):
20272027
(The default downloads folder = "./downloaded_files") """
20282028
if not destination_folder:
20292029
destination_folder = constants.Files.DOWNLOADS_FOLDER
2030+
if not os.path.exists(destination_folder):
2031+
os.makedirs(destination_folder)
20302032
page_utils._download_file_to(file_url, destination_folder)
20312033

20322034
def save_file_as(self, file_url, new_file_name, destination_folder=None):

0 commit comments

Comments
 (0)