We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c8fb603 commit 0ef69adCopy full SHA for 0ef69ad
seleniumbase/fixtures/base_case.py
@@ -1532,6 +1532,14 @@ def delete_all_cookies(self):
1532
def delete_saved_cookies(self, name="cookies.txt"):
1533
""" Deletes the cookies file from the "saved_cookies" folder.
1534
Does NOT delete the cookies from the web browser. """
1535
+ if name.endswith('/'):
1536
+ raise Exception("Invalid filename for Cookies!")
1537
+ if '/' in name:
1538
+ name = name.split('/')[-1]
1539
+ if len(name) < 1:
1540
+ raise Exception("Filename for Cookies is too short!")
1541
+ if not name.endswith(".txt"):
1542
+ name = name + ".txt"
1543
folder = constants.SavedCookies.STORAGE_FOLDER
1544
abs_path = os.path.abspath('.')
1545
file_path = abs_path + "/%s" % folder
0 commit comments