From bbbe2cf9503d91f98ce070f86d295016d1509ba4 Mon Sep 17 00:00:00 2001 From: Sunil Mohan Adapa Date: Thu, 12 Feb 2026 13:17:28 -0800 Subject: [PATCH] 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 Reviewed-by: James Valleroy --- plinth/modules/kiwix/tests/test_functional.py | 2 +- plinth/modules/openvpn/tests/test_functional.py | 6 ++++-- plinth/tests/functional/__init__.py | 5 +++-- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/plinth/modules/kiwix/tests/test_functional.py b/plinth/modules/kiwix/tests/test_functional.py index 504efbb81..5912c4622 100644 --- a/plinth/modules/kiwix/tests/test_functional.py +++ b/plinth/modules/kiwix/tests/test_functional.py @@ -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 diff --git a/plinth/modules/openvpn/tests/test_functional.py b/plinth/modules/openvpn/tests/test_functional.py index dc7f58675..dd901c5e1 100644 --- a/plinth/modules/openvpn/tests/test_functional.py +++ b/plinth/modules/openvpn/tests/test_functional.py @@ -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) diff --git a/plinth/tests/functional/__init__.py b/plinth/tests/functional/__init__.py index 85300f5c2..78d3f348a 100644 --- a/plinth/tests/functional/__init__.py +++ b/plinth/tests/functional/__init__.py @@ -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