Actions
Bug #36286
closedInvestigate nightly failure
Description
We are seeing very frequent nightly pipeline failures on this test:
test_menu_item[Subscriptions] – tests.test_pages
AssertionError: Error messages with log level SEVERE in browser console
assert ['https://192.168.122.4/katello/api/v2/subscriptions/auto_complete_search?organization_id=1&search= '\n '- Failed to load resource: the server responded with a status of 500 ()'] == []
Left contains one more item: 'https://192.168.122.4/katello/api/v2/subscriptions/auto_complete_search?organization_id=1&search= - Failed to load resource: the server responded with a status of 500 ()'
Full diff:
[
- ,
+ 'https://192.168.122.4/katello/api/v2/subscriptions/auto_complete_search?organization_id=1&search= '
+ '- Failed to load resource: the server responded with a status of 500 ()',
]
Stacktrace
selenium = <selenium.webdriver.chrome.webdriver.WebDriver (session="bf95bfba1d76698fa69454a9641d9937")>
user = User(username='admin', password='changeme', name='Admin User')
url = 'https://192.168.122.4/subscriptions'
@pytest.mark.nondestructive
@pytest.mark.selenium
def test_menu_item(selenium, user, url):
selenium.get(url)
assert selenium.current_url.endswith('/users/login'), 'Redirect to login page'
login_field = selenium.find_element(By.NAME, 'login[login]')
login_field.send_keys(user.username)
password_field = selenium.find_element(By.NAME, 'login[password]')
password_field.send_keys(user.password)
password_field.submit()
# Foreman 2.5 changed the navigation
try:
account_menu = WebDriverWait(selenium, 10).until(
EC.presence_of_element_located((By.CLASS_NAME, 'user-nav-item'))
)
except TimeoutException:
account_menu = WebDriverWait(selenium, 10).until(
EC.presence_of_element_located((By.ID, 'account_menu'))
)
assert account_menu.text == user.name, 'Logged in user shows the correct name'
expected_parsed_url = urlparse(url)
allowed_query_params = parse_qs(expected_parsed_url.query).keys()
actual_parsed_url = filtered_url_query(selenium.current_url, allowed_query_params)
assert actual_parsed_url == expected_parsed_url, 'Correct page is loaded'
if selenium.name == 'firefox':
print("Firefox hasn't implemented webdriver logging")
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' and not any(excl in x['message'] for excl in EXCLUDE_ERRORS)]
> assert severe_messages == [], 'Error messages with log level SEVERE in browser console'
E AssertionError: Error messages with log level SEVERE in browser console
E assert ['https://192.168.122.4/katello/api/v2/subscriptions/auto_complete_search?organization_id=1&search= '\n '- Failed to load resource: the server responded with a status of 500 ()'] == []
E Left contains one more item: 'https://192.168.122.4/katello/api/v2/subscriptions/auto_complete_search?organization_id=1&search= - Failed to load resource: the server responded with a status of 500 ()'
E Full diff:
E [
E - ,
E + 'https://192.168.122.4/katello/api/v2/subscriptions/auto_complete_search?organization_id=1&search= '
E + '- Failed to load resource: the server responded with a status of 500 ()',
E ]
tests/test_pages.py:86: AssertionError
Actions