mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-05-27 10:44:33 +00:00
tests: functional: Wait for installation to complete fully
- There is a special page which is served when race condition occurs between the setup middleware and setup view soon after an installation. In this case, a special page is shown with 'App installed' as message but this is still the setup view. Detect this case and wait for page to refresh. Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org> Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
parent
38610d8eb8
commit
a16af8c37a
@ -15,7 +15,9 @@
|
|||||||
|
|
||||||
{% if setup_state.value == 'up-to-date' %}
|
{% if setup_state.value == 'up-to-date' %}
|
||||||
|
|
||||||
{% trans "Application installed." %}
|
<div class="app-just-installed">
|
||||||
|
{% trans "Application installed." %}
|
||||||
|
</div>
|
||||||
|
|
||||||
{% elif not operations %}
|
{% elif not operations %}
|
||||||
|
|
||||||
|
|||||||
@ -342,7 +342,8 @@ def install(browser, app_name):
|
|||||||
install_button_css = '.form-install input[type=submit]'
|
install_button_css = '.form-install input[type=submit]'
|
||||||
while True:
|
while True:
|
||||||
script = 'return (document.readyState == "complete") && ' \
|
script = 'return (document.readyState == "complete") && ' \
|
||||||
'(!Boolean(document.querySelector(".app-operation")));'
|
'(!Boolean(document.querySelector(".app-operation"))) &&' \
|
||||||
|
'(!Boolean(document.querySelector(".app-just-installed")));'
|
||||||
if not browser.execute_script(script):
|
if not browser.execute_script(script):
|
||||||
time.sleep(0.1)
|
time.sleep(0.1)
|
||||||
elif browser.is_element_present_by_css('.neterror'):
|
elif browser.is_element_present_by_css('.neterror'):
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user