summaryrefslogtreecommitdiff
path: root/qa/spec
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2019-10-31 09:06:29 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2019-10-31 09:06:29 +0000
commit6026bddcd51eca573c530240c421392045172b89 (patch)
tree30cb1134ac00a336e6cfaa81bbafe6cd1360f58f /qa/spec
parentb7c776f95d5f41ac00986073563ad0c1de4bad44 (diff)
downloadgitlab-ce-6026bddcd51eca573c530240c421392045172b89.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'qa/spec')
-rw-r--r--qa/spec/spec_helper.rb18
1 files changed, 18 insertions, 0 deletions
diff --git a/qa/spec/spec_helper.rb b/qa/spec/spec_helper.rb
index 363980acc33..ed29bfa41dd 100644
--- a/qa/spec/spec_helper.rb
+++ b/qa/spec/spec_helper.rb
@@ -23,6 +23,24 @@ RSpec.configure do |config|
QA::Runtime::Logger.debug("Starting test: #{example.full_description}") if QA::Runtime::Env.debug?
end
+ config.after(:context) do
+ if !QA::Runtime::Browser.blank_page? && QA::Page::Main::Menu.perform(&:signed_in?)
+ QA::Page::Main::Menu.perform(&:sign_out)
+ raise(
+ <<~ERROR
+ The test left the browser signed in.
+
+ Usually, Capybara prevents this from happening but some things can
+ interfere. For example, if it has an `after(:context)` block that logs
+ in, the browser will stay logged in and this will cause the next test
+ to fail.
+
+ Please make sure the test does not leave the browser signed in.
+ ERROR
+ )
+ end
+ end
+
config.expect_with :rspec do |expectations|
expectations.include_chain_clauses_in_custom_matcher_descriptions = true
end