mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-07-22 11:59:33 +00:00
Functional tests: assert that module installation succeeded
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
parent
bcd84ab92f
commit
5632326802
@ -25,6 +25,7 @@ from support import application
|
||||
@given(parsers.parse('the {app_name:w} application is installed'))
|
||||
def application_is_installed(browser, app_name):
|
||||
application.install(browser, app_name)
|
||||
assert(application.is_installed(browser, app_name))
|
||||
|
||||
|
||||
@given(parsers.parse('the {app_name:w} application is enabled'))
|
||||
|
||||
@ -85,6 +85,12 @@ def install(browser, app_name):
|
||||
sleep(2) # XXX This shouldn't be required.
|
||||
|
||||
|
||||
def is_installed(browser, app_name):
|
||||
interface.nav_to_module(browser, get_app_module(app_name))
|
||||
install_button = browser.find_by_css('.form-install input[type=submit]')
|
||||
return not bool(install_button)
|
||||
|
||||
|
||||
def _change_status(browser, app_name, change_status_to='enabled',
|
||||
checkbox_id=None):
|
||||
interface.nav_to_module(browser, get_app_module(app_name))
|
||||
|
||||
@ -113,8 +113,8 @@ def create_admin_account(browser, username, password):
|
||||
submit(browser)
|
||||
|
||||
|
||||
def submit(browser, element=None, form_class=None):
|
||||
with wait_for_page_update(browser):
|
||||
def submit(browser, element=None, form_class=None, expected_url=None):
|
||||
with wait_for_page_update(browser, expected_url=expected_url):
|
||||
if element:
|
||||
element.click()
|
||||
elif form_class:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user