Skip to content

Commit c8fb603

Browse files
committed
Make sure files are saved in the correct format
1 parent 6372faa commit c8fb603

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

seleniumbase/fixtures/page_actions.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -467,7 +467,7 @@ def save_screenshot(driver, name, folder=None):
467467
If the folder provided doesn't exist, it will get created.
468468
The screenshot will be in PNG format.
469469
"""
470-
if "." not in name:
470+
if not name.endswith(".png"):
471471
name = name + ".png"
472472
if folder:
473473
abs_path = os.path.abspath('.')
@@ -497,7 +497,7 @@ def save_page_source(driver, name, folder=None):
497497
name - The file name to save the current page's HTML to.
498498
folder - The folder to save the file to. (Default = current folder)
499499
"""
500-
if "." not in name:
500+
if not name.endswith(".html"):
501501
name = name + ".html"
502502
if folder:
503503
abs_path = os.path.abspath('.')

0 commit comments

Comments
 (0)