Skip to content

Commit

Permalink
exclude certain errors from being fatal
Browse files Browse the repository at this point in the history
  • Loading branch information
evgeni committed Feb 14, 2023
1 parent 45fde8c commit d739325
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion tests/test_pages.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@
from selenium.common.exceptions import TimeoutException


EXCLUDE_ERRORS = (
# https://projects.theforeman.org/issues/36093
'Scrollbar test exception: TypeError:',
)


@pytest.fixture
def firefox_options(firefox_options):
firefox_options.add_argument('--headless')
Expand Down Expand Up @@ -76,5 +82,5 @@ def test_menu_item(selenium, user, url):
print("https://github.com/mozilla/geckodriver/issues/284")

logs = selenium.get_log('browser')
severe_messages = [x['message'] for x in logs if x.get('level') == 'SEVERE']
severe_messages = [x['message'] for x in logs if x.get('level') == 'SEVERE' and not any(excl in x['message'] for excl in EXCLUDE_ERRORS)]
assert severe_messages == [], 'Error messages with log level SEVERE in browser console'

0 comments on commit d739325

Please sign in to comment.