summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRémy Coutable <remy@rymai.me>2018-06-13 16:53:16 +0000
committerRémy Coutable <remy@rymai.me>2018-06-13 16:53:16 +0000
commitcc1b03545c83c83e5791b5d04d7ff0b86f892364 (patch)
tree9472684381550d8a4ab93ad268f1cb8e03c312c5
parent28504273f6177b0461428e48ecc4e91f3709fce9 (diff)
parent11a19e64ec9395127333f1fea78c71264bec02b0 (diff)
downloadgitlab-ce-cc1b03545c83c83e5791b5d04d7ff0b86f892364.tar.gz
Merge branch 'qa-clear-session-only-if-block-given-and-no-errors' into 'master'
QA: Only clear the sessions if there's no error with a block Closes gitlab-qa#197 See merge request gitlab-org/gitlab-ce!19751
-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
##