Functional tests: assert that module installation succeeded

Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
Michael Pimmer 2018-10-31 18:24:36 +01:00 committed by James Valleroy
parent bcd84ab92f
commit 5632326802
No known key found for this signature in database
GPG Key ID: 77C0C75E7B650808
3 changed files with 9 additions and 2 deletions

View File

@ -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'))

View File

@ -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))

View File

@ -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: