From 888b671fe3889e0052c867bb6eefd69d80186750 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20Coutable?= Date: Mon, 11 Jun 2018 13:34:50 +0200 Subject: Ensure we advertise screenshots taken when a QA failure happen outside of an RSpec example MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Rémy Coutable --- qa/qa/runtime/api/client.rb | 2 +- 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 -- cgit v1.2.1