Skip to content
Snippets Groups Projects
Verified Commit 1f37b990 authored by Varac's avatar Varac
Browse files

Lint features/environment.py

parent f1288db1
No related branches found
No related tags found
No related merge requests found
......@@ -9,8 +9,8 @@ from behave_webdriver.driver import ChromeOptions
def save_screenshot(context, step):
"""Save a screenshot to ./screenshots."""
timestamp = time.strftime("%Y-%m-%dT%H:%M:%S")
filename = re.sub('\W', '-', '{} failed {}'.format(timestamp,
str(step.name)))
filename = re.sub(r'\W', '-', '{} failed {}'.format(timestamp,
str(step.name)))
filepath = os.path.join('screenshots', filename + '.png')
if not os.path.exists('screenshots'):
os.mkdir('screenshots')
......@@ -35,6 +35,7 @@ def before_all(context):
def before_tag(context, tag):
"""Define steps run before each tag."""
def get_values(app):
values = {}
values['url'] = userdata.get(app + '.url')
......@@ -58,7 +59,6 @@ def before_tag(context, tag):
context.nextcloud = get_values('nextcloud')
def after_all(context):
"""Cleanup after tests run."""
context.behave_driver.quit()
......@@ -74,4 +74,3 @@ def after_step(context, step):
print(" Timestamp: {}".format(message['timestamp']))
print(" Source: {}".format(message['source']))
print(" Message: {}\n".format(message['message']))
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment