mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-08-26 12:46:08 +00:00
functional-tests: Fix page not fully loaded errors when taking backups
- Use a submit() function to wait for a update when visiting app pages. This prevents failures on pages which have custom javascript, including the backup app. Those errors are more common if the server hardware is slower. - Remove unnecessary wait_for_page_update() as submit() already waits for a page update. Signed-off-by: Veiko Aasa <veiko17@disroot.org> Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
This commit is contained in:
parent
7f7f4cfb52
commit
bf53fd8b17
@ -269,7 +269,8 @@ def nav_to_module(browser, module):
|
|||||||
sys_or_apps = 'sys' if module in _sys_modules else 'apps'
|
sys_or_apps = 'sys' if module in _sys_modules else 'apps'
|
||||||
required_url = base_url + f'/plinth/{sys_or_apps}/{module}/'
|
required_url = base_url + f'/plinth/{sys_or_apps}/{module}/'
|
||||||
if browser.url != required_url:
|
if browser.url != required_url:
|
||||||
browser.visit(required_url)
|
with wait_for_page_update(browser, expected_url=required_url):
|
||||||
|
browser.visit(required_url)
|
||||||
|
|
||||||
|
|
||||||
def app_select_domain_name(browser, app_name, domain_name):
|
def app_select_domain_name(browser, app_name, domain_name):
|
||||||
@ -404,10 +405,8 @@ def set_advanced_mode(browser, mode):
|
|||||||
def _click_button_and_confirm(browser, href):
|
def _click_button_and_confirm(browser, href):
|
||||||
buttons = browser.find_link_by_href(href)
|
buttons = browser.find_link_by_href(href)
|
||||||
if buttons:
|
if buttons:
|
||||||
buttons.first.click()
|
submit(browser, buttons.first)
|
||||||
with wait_for_page_update(browser,
|
submit(browser, expected_url='/plinth/sys/backups/')
|
||||||
expected_url='/plinth/sys/backups/'):
|
|
||||||
submit(browser)
|
|
||||||
|
|
||||||
|
|
||||||
def _backup_delete_archive_by_name(browser, archive_name):
|
def _backup_delete_archive_by_name(browser, archive_name):
|
||||||
@ -421,7 +420,8 @@ def backup_create(browser, app_name, archive_name=None):
|
|||||||
if archive_name:
|
if archive_name:
|
||||||
_backup_delete_archive_by_name(browser, archive_name)
|
_backup_delete_archive_by_name(browser, archive_name)
|
||||||
|
|
||||||
browser.find_link_by_href('/plinth/sys/backups/create/').first.click()
|
buttons = browser.find_link_by_href('/plinth/sys/backups/create/')
|
||||||
|
submit(browser, buttons.first)
|
||||||
browser.find_by_id('select-all').uncheck()
|
browser.find_by_id('select-all').uncheck()
|
||||||
if archive_name:
|
if archive_name:
|
||||||
browser.find_by_id('id_backups-name').fill(archive_name)
|
browser.find_by_id('id_backups-name').fill(archive_name)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user