diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2019-10-31 09:06:29 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2019-10-31 09:06:29 +0000 |
commit | 6026bddcd51eca573c530240c421392045172b89 (patch) | |
tree | 30cb1134ac00a336e6cfaa81bbafe6cd1360f58f /qa/spec | |
parent | b7c776f95d5f41ac00986073563ad0c1de4bad44 (diff) | |
download | gitlab-ce-6026bddcd51eca573c530240c421392045172b89.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'qa/spec')
-rw-r--r-- | qa/spec/spec_helper.rb | 18 |
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 |