Skip to content

Commit 0e4bb61

Browse files
committed
Add methods for setting up the visual_baseline folder
1 parent 19af2ed commit 0e4bb61

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

seleniumbase/core/visual_helper.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import os
2+
from seleniumbase.fixtures import constants
3+
4+
VISUAL_BASELINE_DIR = constants.VisualBaseline.STORAGE_FOLDER
5+
abs_path = os.path.abspath('.')
6+
visual_baseline_path = os.path.join(abs_path, VISUAL_BASELINE_DIR)
7+
8+
9+
def get_visual_baseline_folder():
10+
return visual_baseline_path
11+
12+
13+
def visual_baseline_folder_setup():
14+
""" Handle Logging """
15+
if not os.path.exists(visual_baseline_path):
16+
try:
17+
os.makedirs(visual_baseline_path)
18+
except Exception:
19+
pass # Should only be reachable during multi-threaded runs

seleniumbase/fixtures/constants.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ class Files:
1919
ARCHIVED_DOWNLOADS_FOLDER = "archived_files"
2020

2121

22+
class VisualBaseline:
23+
STORAGE_FOLDER = "visual_baseline"
24+
25+
2226
class JQuery:
2327
VER = "3.3.1"
2428
# MIN_JS = "//cdnjs.cloudflare.com/ajax/libs/jquery/%s/jquery.min.js" % VER

0 commit comments

Comments
 (0)