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
This commit is contained in:
Rémy Coutable 2018-06-13 16:53:16 +00:00
commit cc1b03545c
1 changed files with 1 additions and 13 deletions

View File

@ -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
##