summaryrefslogtreecommitdiff
path: root/qa
diff options
context:
space:
mode:
authorLin Jen-Shin <godfat@godfat.org>2018-06-13 20:20:36 +0800
committerLin Jen-Shin <godfat@godfat.org>2018-06-13 22:03:30 +0800
commit11a19e64ec9395127333f1fea78c71264bec02b0 (patch)
treecfeee9173f129519530847bd63476aa524efba87 /qa
parent031ee142b1cd941eb10afd11db553173a60428f3 (diff)
downloadgitlab-ce-11a19e64ec9395127333f1fea78c71264bec02b0.tar.gz
Only clear the sessions if block_given? and no error
Because otherwise capybara-screenshot/rspec can't take the screenshots for us. If we got an error, we don't want to continue anyway?
Diffstat (limited to 'qa')
-rw-r--r--qa/qa/runtime/browser.rb14
1 files changed, 1 insertions, 13 deletions
diff --git a/qa/qa/runtime/browser.rb b/qa/qa/runtime/browser.rb
index a12d95683af..ecd273c6db8 100644
--- a/qa/qa/runtime/browser.rb
+++ b/qa/qa/runtime/browser.rb
@@ -102,19 +102,7 @@ module QA
def perform(&block)
visit(url)
- yield if block_given?
- rescue
- raise if block.nil?
-
- # RSpec examples will take care of screenshots on their own
- #
- unless block.binding.receiver.is_a?(RSpec::Core::ExampleGroup)
- screenshot_and_save_page
- end
-
- raise
- ensure
- clear! if block_given?
+ yield.tap { clear! } if block_given?
end
##