2024-01-12 20:12:31 +11:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
RSpec.configure do |config|
|
2024-05-10 22:36:09 +10:00
|
|
|
config.after(:each, :js, type: :system) do
|
2024-06-25 23:57:40 +10:00
|
|
|
# Classes of intermittent ignorable errors
|
|
|
|
ignored_errors = [
|
|
|
|
/Error while trying to use the following icon from the Manifest/, # https://github.com/mastodon/mastodon/pull/30793
|
2024-07-22 17:46:41 +10:00
|
|
|
/Manifest: Line: 1, column: 1, Syntax error/, # Similar parsing/interruption issue as above
|
2024-06-25 23:57:40 +10:00
|
|
|
]
|
|
|
|
errors = page.driver.browser.logs.get(:browser).reject do |error|
|
|
|
|
ignored_errors.any? { |pattern| pattern.match(error.message) }
|
|
|
|
end
|
|
|
|
|
2024-01-12 20:12:31 +11:00
|
|
|
if errors.present?
|
|
|
|
aggregate_failures 'javascript errrors' do
|
|
|
|
errors.each do |error|
|
|
|
|
expect(error.level).to_not eq('SEVERE'), error.message
|
|
|
|
next unless error.level == 'WARNING'
|
|
|
|
|
2024-01-16 08:26:11 +11:00
|
|
|
warn 'WARN: javascript warning'
|
|
|
|
warn error.message
|
2024-01-12 20:12:31 +11:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|