diff options
Diffstat (limited to 'service')
-rw-r--r-- | service/test/functional/features/environment.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/service/test/functional/features/environment.py b/service/test/functional/features/environment.py index ce880a87..b03c506e 100644 --- a/service/test/functional/features/environment.py +++ b/service/test/functional/features/environment.py @@ -90,11 +90,13 @@ def _save_screenshot(context, step): if (step.status == 'failed' and context.config.userdata.getbool("screenshots", True)): timestamp = time.strftime("%Y-%m-%d-%H-%M-%S") - filename = re.sub('\W', '-', timestamp + ' failed ' + str(step.name)) + filename = _slugify('{} failed {}'.format(timestamp, str(step.name))) filepath = os.path.join('screenshots', filename + '.png') context.browser.save_screenshot(filepath) +def _slugify(string_): + return re.sub('\W', '-', string_) @wait_for(timeout=10.0) |