mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-01-21 07:55:00 +00:00
tests: functional: Introduce step def. to check if app is enabled
- Useful in case the site can't be checked and daemon is not available. Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
This commit is contained in:
parent
d71901d59c
commit
84e671c919
@ -379,6 +379,13 @@ def app_disable(browser, app_name):
|
||||
_change_app_status(browser, app_name, 'disabled')
|
||||
|
||||
|
||||
def app_is_enabled(browser, app_name):
|
||||
"""Return whether the app is enabled."""
|
||||
nav_to_module(browser, app_name)
|
||||
should_enable_field = browser.find_by_id('id_should_enable')
|
||||
return should_enable_field.value == 'False'
|
||||
|
||||
|
||||
def app_can_be_disabled(browser, app_name):
|
||||
"""Return whether the application can be disabled."""
|
||||
nav_to_module(browser, app_name)
|
||||
|
||||
@ -58,6 +58,13 @@ def app_can_be_disabled(session_browser, app_name):
|
||||
pytest.skip('network time application can\'t be disabled')
|
||||
|
||||
|
||||
@then(parsers.parse('the {app_name:w} application is {enabled:w}'))
|
||||
def app_assert_is_enabled(session_browser, app_name, enabled):
|
||||
assert enabled in ('enabled', 'disabled')
|
||||
enabled = (enabled == 'enabled')
|
||||
assert functional.app_is_enabled(session_browser, app_name) == enabled
|
||||
|
||||
|
||||
@then(parsers.parse('the {service_name:w} service should be running'))
|
||||
def service_should_be_running(session_browser, service_name):
|
||||
assert functional.eventually(functional.service_is_running,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user