From fcbcf1775ce60fa96a4268b5043210b447dd528a Mon Sep 17 00:00:00 2001 From: Sunil Mohan Adapa Date: Sun, 16 Apr 2023 13:27:10 +0530 Subject: [PATCH] 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 Reviewed-by: James Valleroy --- plinth/tests/functional/__init__.py | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/plinth/tests/functional/__init__.py b/plinth/tests/functional/__init__.py index edcc133b6..645522c19 100644 --- a/plinth/tests/functional/__init__.py +++ b/plinth/tests/functional/__init__.py @@ -33,10 +33,6 @@ logger = logging.getLogger(__name__) base_url = config['DEFAULT']['url'] -_app_checkbox_id = { - 'openvpn': 'id_openvpn-enabled', -} - # unlisted sites just use '/' + site_name as url _site_url = { 'wiki': '/ikiwiki', @@ -398,17 +394,14 @@ def uninstall(browser, app_name): def _change_app_status(browser, app_name, change_status_to='enabled'): """Enable or disable application.""" 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') - if (should_enable_field.value == 'False' and change_status_to - == 'disabled') or (should_enable_field.value == 'True' - and change_status_to == 'enabled'): - submit(browser, element=button) - else: - checkbox_id = _app_checkbox_id[app_name] - change_checkbox_status(browser, app_name, checkbox_id, - change_status_to) + should_enable_field = browser.find_by_id('id_should_enable') + if (should_enable_field.value == 'False' and change_status_to + == 'disabled') or (should_enable_field.value == 'True' + and change_status_to == 'enabled'): + submit(browser, element=button) def app_enable(browser, app_name):