mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-03-11 09:04:54 +00:00
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:
parent
168f662a17
commit
bbbe2cf950
@ -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
|
||||
|
||||
@ -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)
|
||||
|
||||
@ -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
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user