@@ -3610,7 +3610,29 @@ def delete_downloaded_file_if_present(self, file, browser=False):
3610
3610
file - The filename to be deleted from the [Downloads Folder].
3611
3611
browser - If True, uses the path set by click-initiated downloads.
3612
3612
If False, uses the self.download_file(file_url) path.
3613
- Those paths are often the same. (browser-dependent)
3613
+ Those paths are usually the same. (browser-dependent)
3614
+ (Default: False).
3615
+ """
3616
+ if self .is_downloaded_file_present (file , browser = browser ):
3617
+ file_path = self .get_path_of_downloaded_file (file , browser = browser )
3618
+ try :
3619
+ os .remove (file_path )
3620
+ except Exception :
3621
+ pass
3622
+
3623
+ def delete_downloaded_file (self , file , browser = False ):
3624
+ """Same as self.delete_downloaded_file_if_present()
3625
+ Deletes the file from the [Downloads Folder] if the file exists.
3626
+ For browser click-initiated downloads, SeleniumBase will override
3627
+ the system [Downloads Folder] to be "./downloaded_files/",
3628
+ but that path can't be overridden when using Safari, IE,
3629
+ or Chromium Guest Mode, which keeps the default system path.
3630
+ self.download_file(file_url) will always use "./downloaded_files/".
3631
+ @Params
3632
+ file - The filename to be deleted from the [Downloads Folder].
3633
+ browser - If True, uses the path set by click-initiated downloads.
3634
+ If False, uses the self.download_file(file_url) path.
3635
+ Those paths are usually the same. (browser-dependent)
3614
3636
(Default: False).
3615
3637
"""
3616
3638
if self .is_downloaded_file_present (file , browser = browser ):
@@ -9127,8 +9149,7 @@ def __process_dashboard(self, has_exception, init=False):
9127
9149
'<tbody class="%s results-table-row">'
9128
9150
'<tr style="background-color: #F8FFF8;">'
9129
9151
'<td class="col-result">%s</td><td>%s</td><td>%s</td>'
9130
- "<td>-</td></tr></tbody>"
9131
- % (row [0 ], row [1 ], row [2 ], row [3 ])
9152
+ "<td>-</td></tr></tbody>" % (row [0 ], row [1 ], row [2 ], row [3 ])
9132
9153
)
9133
9154
table_html += row
9134
9155
for row in the_untested :
0 commit comments