mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-05-27 10:44:33 +00:00
tests: Recover from server restart during installation
Signed-off-by: Joseph Nuthalapati <njoseph@thoughtworks.com> Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
parent
42e2995abc
commit
c382df927a
@ -66,10 +66,22 @@ def install(browser, app_name):
|
||||
browser.is_element_present_by_css(selector)
|
||||
for selector in selectors)
|
||||
|
||||
def is_server_restarting():
|
||||
return browser.is_element_present_by_css('.neterror')
|
||||
|
||||
def wait_for_install():
|
||||
if install_in_progress():
|
||||
sleep(1)
|
||||
elif is_server_restarting():
|
||||
sleep(1)
|
||||
browser.visit(browser.url)
|
||||
else:
|
||||
return
|
||||
wait_for_install()
|
||||
|
||||
if install:
|
||||
install.click()
|
||||
while install_in_progress():
|
||||
sleep(1)
|
||||
wait_for_install()
|
||||
sleep(2) # XXX This shouldn't be required.
|
||||
|
||||
|
||||
@ -91,7 +103,7 @@ def disable(browser, app_name):
|
||||
|
||||
|
||||
def wait_for_config_update(browser, app_name):
|
||||
while len(browser.find_by_css('.running-status.loading')) != 0:
|
||||
while browser.is_element_present_by_css('.running-status.loading'):
|
||||
sleep(0.1)
|
||||
|
||||
|
||||
|
||||
@ -42,7 +42,7 @@ def is_available(browser, site_name):
|
||||
browser.visit(config['DEFAULT']['url'] + get_site_url(site_name))
|
||||
sleep(3)
|
||||
browser.reload()
|
||||
return browser.title != '404 Not Found'
|
||||
return '404' not in browser.title
|
||||
|
||||
|
||||
def access_url(browser, site_name):
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user