mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-01-21 07:55:00 +00:00
backups: tests: functional: Wait for pages to load after click
- So that on slow machines, the tests don't fail. Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org> Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
parent
e0aef43ece
commit
fd1b1c1cbf
@ -106,8 +106,10 @@ def _backup_schedule_disable(session_browser):
|
||||
def _backup_schedule_get(browser):
|
||||
"""Return the current schedule set for the root repository."""
|
||||
functional.nav_to_module(browser, 'backups')
|
||||
browser.links.find_by_href(
|
||||
'/plinth/sys/backups/root/schedule/').first.click()
|
||||
with functional.wait_for_page_update(browser):
|
||||
browser.links.find_by_href(
|
||||
'/plinth/sys/backups/root/schedule/').first.click()
|
||||
|
||||
without_apps = []
|
||||
elements = browser.find_by_name('backups_schedule-selected_apps')
|
||||
for element in elements:
|
||||
@ -136,8 +138,10 @@ def _backup_schedule_set(browser, enable, daily, weekly, monthly, run_at,
|
||||
without_app):
|
||||
"""Set the schedule for root repository."""
|
||||
functional.nav_to_module(browser, 'backups')
|
||||
browser.links.find_by_href(
|
||||
'/plinth/sys/backups/root/schedule/').first.click()
|
||||
with functional.wait_for_page_update(browser):
|
||||
browser.links.find_by_href(
|
||||
'/plinth/sys/backups/root/schedule/').first.click()
|
||||
|
||||
if enable:
|
||||
browser.find_by_name('backups_schedule-enabled').check()
|
||||
else:
|
||||
@ -182,7 +186,9 @@ def _open_main_page(browser):
|
||||
|
||||
def _upload_and_restore(browser, app_name, downloaded_file_path):
|
||||
functional.nav_to_module(browser, 'backups')
|
||||
browser.links.find_by_href('/plinth/sys/backups/upload/').first.click()
|
||||
with functional.wait_for_page_update(browser):
|
||||
browser.links.find_by_href('/plinth/sys/backups/upload/').first.click()
|
||||
|
||||
fileinput = browser.find_by_id('id_backups-file')
|
||||
fileinput.fill(downloaded_file_path)
|
||||
# submit upload form
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user