tests: functional: Fix expecting FreedomBox to be home page

In some cases, we are visiting / and expecting to reach the home page of
FreedomBox UI. When due to failed tests in config app, the home page is set to
something other than FreedomBox UI, these tests fail. Fix this by visiting
/freedombox explicitly instead.

Tests:

- When hope page is set to Syncthing, kiwix functional tests pass.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
Sunil Mohan Adapa 2026-02-12 13:17:28 -08:00 committed by James Valleroy
parent 168f662a17
commit bbbe2cf950
No known key found for this signature in database
GPG Key ID: 77C0C75E7B650808
3 changed files with 8 additions and 5 deletions

View File

@ -115,6 +115,6 @@ def _is_anonymous_read_allowed(browser) -> bool:
def _shortcut_exists(browser) -> bool:
"""Check that the Kiwix shortcut exists on the front page."""
browser.visit(_default_url)
browser.visit(_default_url + '/freedombox/')
links_found = browser.links.find_by_href('/kiwix')
return len(links_found) == 1

View File

@ -31,10 +31,12 @@ class TestOpenvpnApp(functional.BaseAppTests):
if not functional.user_exists(session_browser, 'nonvpnuser'):
functional.create_user(session_browser, 'nonvpnuser', groups=[])
functional.login_with_account(session_browser, base_url, 'vpnuser')
functional.login_with_account(session_browser,
base_url + '/freedombox/', 'vpnuser')
_download_profile(session_browser)
functional.login_with_account(session_browser, base_url, 'nonvpnuser')
functional.login_with_account(session_browser,
base_url + '/freedombox/', 'nonvpnuser')
_not_on_front_page(session_browser)
functional.login(session_browser)

View File

@ -368,7 +368,8 @@ def _create_admin_account(browser, username, password):
def login(browser):
"""Login to the FreedomBox interface with default test account."""
login_with_account(browser, base_url, config['DEFAULT']['username'],
login_with_account(browser, base_url + '/freedombox/',
config['DEFAULT']['username'],
config['DEFAULT']['password'])
@ -560,7 +561,7 @@ def app_can_be_disabled(browser, app_name):
# Front page utilities #
########################
def find_on_front_page(browser, app_name):
browser.visit(base_url)
browser.visit(base_url + '/freedombox/')
shortcuts = browser.links.find_by_href(f'/{app_name}/')
return shortcuts