javascript_errors.rb 478 B

123456789101112131415161718
  1. # frozen_string_literal: true
  2. RSpec.configure do |config|
  3. config.after(:each, type: :system) do
  4. errors = page.driver.browser.logs.get(:browser)
  5. if errors.present?
  6. aggregate_failures 'javascript errrors' do
  7. errors.each do |error|
  8. expect(error.level).to_not eq('SEVERE'), error.message
  9. next unless error.level == 'WARNING'
  10. warn 'WARN: javascript warning'
  11. warn error.message
  12. end
  13. end
  14. end
  15. end
  16. end