mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-05-13 10:30:16 +00:00
functional-tests: Minor refactoring
Signed-off-by: Joseph Nuthalapati <njoseph@riseup.net> Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
This commit is contained in:
parent
eab1e577b9
commit
f10d763e6e
@ -63,9 +63,13 @@ def get_app_checkbox_id(app_name):
|
|||||||
return checkbox_id
|
return checkbox_id
|
||||||
|
|
||||||
|
|
||||||
def install(browser, app_name):
|
def _find_install_button(browser, app_name):
|
||||||
interface.nav_to_module(browser, get_app_module(app_name))
|
interface.nav_to_module(browser, get_app_module(app_name))
|
||||||
install = browser.find_by_css('.form-install input[type=submit]')
|
return browser.find_by_css('.form-install input[type=submit]')
|
||||||
|
|
||||||
|
|
||||||
|
def install(browser, app_name):
|
||||||
|
install_button = _find_install_button(browser, app_name)
|
||||||
|
|
||||||
def install_in_progress():
|
def install_in_progress():
|
||||||
selectors = [
|
selectors = [
|
||||||
@ -89,15 +93,14 @@ def install(browser, app_name):
|
|||||||
return
|
return
|
||||||
wait_for_install()
|
wait_for_install()
|
||||||
|
|
||||||
if install:
|
if install_button:
|
||||||
install.click()
|
install_button.click()
|
||||||
wait_for_install()
|
wait_for_install()
|
||||||
sleep(2) # XXX This shouldn't be required.
|
# sleep(2) # XXX This shouldn't be required.
|
||||||
|
|
||||||
|
|
||||||
def is_installed(browser, app_name):
|
def is_installed(browser, app_name):
|
||||||
interface.nav_to_module(browser, get_app_module(app_name))
|
install_button = _find_install_button(browser, app_name)
|
||||||
install_button = browser.find_by_css('.form-install input[type=submit]')
|
|
||||||
return not bool(install_button)
|
return not bool(install_button)
|
||||||
|
|
||||||
|
|
||||||
@ -410,8 +413,9 @@ def _gitweb_get_repo_url(repo, with_auth):
|
|||||||
if with_auth:
|
if with_auth:
|
||||||
password = config['DEFAULT']['password']
|
password = config['DEFAULT']['password']
|
||||||
|
|
||||||
return '{0}://{1}:{2}@{3}/gitweb/{4}'.format(
|
return '{0}://{1}:{2}@{3}/gitweb/{4}'.format(scheme,
|
||||||
scheme, config['DEFAULT']['username'], password, url, repo)
|
config['DEFAULT']['username'],
|
||||||
|
password, url, repo)
|
||||||
|
|
||||||
|
|
||||||
@contextlib.contextmanager
|
@contextlib.contextmanager
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user