Skip to content

Commit

Permalink
Drop Foreman < 2.5 support
Browse files Browse the repository at this point in the history
Foreman 2.5 changed the IDs in the navigation which broke the tests. By
now those old versions are retired and we can simplify the code.
  • Loading branch information
ekohl committed Apr 8, 2024
1 parent a09a84c commit 9d203ec
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions tests/test_pages.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,15 +61,9 @@ def test_menu_item(selenium, user, url):
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'))
)
account_menu = WebDriverWait(selenium, 10).until(
EC.presence_of_element_located((By.CLASS_NAME, 'user-nav-item'))
)
assert account_menu.text == user.name, 'Logged in user shows the correct name'

expected_parsed_url = urlparse(url)
Expand Down

0 comments on commit 9d203ec

Please sign in to comment.