diff options
author | Rémy Coutable <remy@rymai.me> | 2018-07-09 17:40:51 +0200 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2018-07-11 18:22:29 +0200 |
commit | eb4e629fa906ed73e0d70a8f9a1b460f50627c30 (patch) | |
tree | 5ceed82772629c561282435cf4af5ecef7f3ef5f /qa | |
parent | c7c630f142a23505b4adce449c0a176dec142384 (diff) | |
download | gitlab-ce-eb4e629fa906ed73e0d70a8f9a1b460f50627c30.tar.gz |
[QA] Ensure screenshots are save in subfolder per QA run
Signed-off-by: Rémy Coutable <remy@rymai.me>
Diffstat (limited to 'qa')
-rw-r--r-- | qa/qa/runtime/browser.rb | 4 | ||||
-rw-r--r-- | qa/qa/runtime/namespace.rb | 2 |
2 files changed, 5 insertions, 1 deletions
diff --git a/qa/qa/runtime/browser.rb b/qa/qa/runtime/browser.rb index cee381f3379..877864fb40c 100644 --- a/qa/qa/runtime/browser.rb +++ b/qa/qa/runtime/browser.rb @@ -85,6 +85,10 @@ module QA driver.browser.save_screenshot(path) end + Capybara::Screenshot.register_filename_prefix_formatter(:rspec) do |example| + File.join(QA::Runtime::Namespace.name, example.file_path.sub('./qa/specs/features/', '')) + end + Capybara.configure do |config| config.default_driver = :chrome config.javascript_driver = :chrome diff --git a/qa/qa/runtime/namespace.rb b/qa/qa/runtime/namespace.rb index ccfa8b44db3..28f17d1160b 100644 --- a/qa/qa/runtime/namespace.rb +++ b/qa/qa/runtime/namespace.rb @@ -8,7 +8,7 @@ module QA end def name - 'qa-test-' + time.strftime('%d-%m-%Y-%H-%M-%S') + "qa-test-#{time.strftime('%Y-%m-%d-%Y-%H-%M-%S')}" end def path |