diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2019-11-11 03:06:26 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2019-11-11 03:06:26 +0300 |
commit | 991a295378736c60d419c794f0accbf0336987fc (patch) | |
tree | aaee5152256c8d4eb40a1583521bcf320082bb49 /spec/support/capybara.rb | |
parent | 71d998ca0de672d5accdf209b4b5e3f360ea5267 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/support/capybara.rb')
-rw-r--r-- | spec/support/capybara.rb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/spec/support/capybara.rb b/spec/support/capybara.rb index 7b3b966bd50..2bd4750dffa 100644 --- a/spec/support/capybara.rb +++ b/spec/support/capybara.rb @@ -101,8 +101,12 @@ RSpec.configure do |config| config.after(:example, :js) do |example| # when a test fails, display any messages in the browser's console - if example.exception + # but fail don't add the message if the failure is a pending test that got + # fixed. If we raised the `JSException` the fixed test would be marked as + # failed again. + if example.exception && !example.exception.is_a?(RSpec::Core::Pending::PendingExampleFixedError) console = page.driver.browser.manage.logs.get(:browser)&.reject { |log| log.message =~ JS_CONSOLE_FILTER } + if console.present? message = "Unexpected browser console output:\n" + console.map(&:message).join("\n") raise JSConsoleError, message |