Functional tests: fix waiting for redirects

wait_for_page_update has an 'expected_url' argument that you can use
to make the browser wait until it reaches an expected URL after a
redirect.

Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
Michael Pimmer authored and James Valleroy committed 2018-11-17 16:22:22 -05:00
1 parent 33dde221d1
commit bcd84ab92f
2 files changed
+23 -9

No files matched your search

+3 -2
View File
@@ -210,7 +210,8 @@ def backup_restore(browser, app_name):
browser.find_link_by_href(
'/plinth/sys/backups/restore-archive/_functional_test_' +
app_name + '/').first.click()
submit(browser)
with wait_for_page_update(browser, expected_url='/plinth/sys/backups/'):
submit(browser)
def backup_upload_and_restore(browser, app_name, downloaded_file_path):
@@ -222,7 +223,7 @@ def backup_upload_and_restore(browser, app_name, downloaded_file_path):
# submit upload form
submit(browser)
# submit restore form
with wait_for_page_update(browser):
with wait_for_page_update(browser, expected_url='/plinth/sys/backups/'):
submit(browser)