mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-04-29 10:10:19 +00:00
tests: functional: Remove handling for custom enable/disable buttons
All the apps including OpenVPN now use AppView and therefore using the standard enable/disable button. Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org> Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
parent
5761718583
commit
fcbcf1775c
@ -33,10 +33,6 @@ logger = logging.getLogger(__name__)
|
|||||||
|
|
||||||
base_url = config['DEFAULT']['url']
|
base_url = config['DEFAULT']['url']
|
||||||
|
|
||||||
_app_checkbox_id = {
|
|
||||||
'openvpn': 'id_openvpn-enabled',
|
|
||||||
}
|
|
||||||
|
|
||||||
# unlisted sites just use '/' + site_name as url
|
# unlisted sites just use '/' + site_name as url
|
||||||
_site_url = {
|
_site_url = {
|
||||||
'wiki': '/ikiwiki',
|
'wiki': '/ikiwiki',
|
||||||
@ -398,17 +394,14 @@ def uninstall(browser, app_name):
|
|||||||
def _change_app_status(browser, app_name, change_status_to='enabled'):
|
def _change_app_status(browser, app_name, change_status_to='enabled'):
|
||||||
"""Enable or disable application."""
|
"""Enable or disable application."""
|
||||||
button = browser.find_by_css('button[name="app_enable_disable_button"]')
|
button = browser.find_by_css('button[name="app_enable_disable_button"]')
|
||||||
|
if not button:
|
||||||
|
raise RuntimeError('App enable/disable button not found')
|
||||||
|
|
||||||
if button:
|
should_enable_field = browser.find_by_id('id_should_enable')
|
||||||
should_enable_field = browser.find_by_id('id_should_enable')
|
if (should_enable_field.value == 'False' and change_status_to
|
||||||
if (should_enable_field.value == 'False' and change_status_to
|
== 'disabled') or (should_enable_field.value == 'True'
|
||||||
== 'disabled') or (should_enable_field.value == 'True'
|
and change_status_to == 'enabled'):
|
||||||
and change_status_to == 'enabled'):
|
submit(browser, element=button)
|
||||||
submit(browser, element=button)
|
|
||||||
else:
|
|
||||||
checkbox_id = _app_checkbox_id[app_name]
|
|
||||||
change_checkbox_status(browser, app_name, checkbox_id,
|
|
||||||
change_status_to)
|
|
||||||
|
|
||||||
|
|
||||||
def app_enable(browser, app_name):
|
def app_enable(browser, app_name):
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user