diff options
author | Rémy Coutable <remy@rymai.me> | 2018-06-11 13:34:50 +0200 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2018-06-13 09:30:46 +0200 |
commit | 888b671fe3889e0052c867bb6eefd69d80186750 (patch) | |
tree | 3fe6d3eaf5ed48a0b8882e96739b4d67f56c2e02 | |
parent | fba123a329f44ed80bbf71feb639dab9afc13d6f (diff) | |
download | gitlab-ce-qa-197.tar.gz |
Ensure we advertise screenshots taken when a QA failure happen outside of an RSpec exampleqa-197
Signed-off-by: Rémy Coutable <remy@rymai.me>
-rw-r--r-- | qa/qa/runtime/api/client.rb | 2 | ||||
-rw-r--r-- | qa/qa/runtime/browser.rb | 7 |
2 files changed, 7 insertions, 2 deletions
diff --git a/qa/qa/runtime/api/client.rb b/qa/qa/runtime/api/client.rb index 02015e23ad8..938c19c4f97 100644 --- a/qa/qa/runtime/api/client.rb +++ b/qa/qa/runtime/api/client.rb @@ -29,7 +29,7 @@ module QA def create_personal_access_token Runtime::Browser.visit(@address, Page::Main::Login) do - Page::Main::Login.act { sign_in_using_credentials } + Page::Main::Login.act { sign_in_using_credentials } unless Page::Menu::Main.act { has_personal_area? } Factory::Resource::PersonalAccessToken.fabricate!.access_token end end diff --git a/qa/qa/runtime/browser.rb b/qa/qa/runtime/browser.rb index a12d95683af..ea08fa1036e 100644 --- a/qa/qa/runtime/browser.rb +++ b/qa/qa/runtime/browser.rb @@ -109,7 +109,12 @@ module QA # RSpec examples will take care of screenshots on their own # unless block.binding.receiver.is_a?(RSpec::Core::ExampleGroup) - screenshot_and_save_page + screenshots = screenshot_and_save_page + puts(" " + CapybaraScreenshot::Helpers.yellow("Image screenshot: file://#{screenshots[:image]}")) if screenshots[:image] + puts(" " + CapybaraScreenshot::Helpers.yellow("HTML screenshot: file://#{screenshots[:html]}")) if screenshots[:html] + + # De-activate automatic screenshots since we already took it + Capybara::Screenshot.autosave_on_failure = false end raise |