Skip to content

Commit 48110f9

Browse files
author
Xing Han Lu
committed
Update saving directory for test_usage
tests/screenshots -> tests/screenshots/usage
1 parent ca54a1e commit 48110f9

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

tests/test_usage.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88

99
class Tests(IntegrationTests):
10-
def create_usage_test(self, filename):
10+
def create_usage_test(self, filename, dir_name='usage'):
1111
app = importlib.import_module(filename).app
1212

1313
self.startServer(app)
@@ -16,9 +16,20 @@ def create_usage_test(self, filename):
1616
EC.presence_of_element_located((By.ID, "cytoscape"))
1717
)
1818

19+
directory_path = os.path.join(
20+
os.path.dirname(__file__),
21+
'screenshots',
22+
dir_name
23+
)
24+
25+
# Create directory if it doesn't already exist
26+
if not os.path.exists(directory_path):
27+
os.makedirs(directory_path)
28+
1929
self.driver.save_screenshot(os.path.join(
2030
os.path.dirname(__file__),
2131
'screenshots',
32+
dir_name,
2233
filename + '.png'
2334
))
2435

0 commit comments

Comments
 (0)