pagekite: Fix functional tests

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
This commit is contained in:
Sunil Mohan Adapa 2020-03-26 13:44:29 -07:00 committed by Veiko Aasa
parent 0b5b384651
commit 89b7301962
No known key found for this signature in database
GPG Key ID: 478539CAE680674E
4 changed files with 4 additions and 27 deletions

View File

@ -11,7 +11,7 @@ Background:
Scenario: Enable pagekite application
Given the pagekite application is disabled
When I enable the pagekite application
Then pagekite should be enabled
Then the pagekite service should be running
Scenario: Configure pagekite application
Given the pagekite application is enabled
@ -24,10 +24,10 @@ Scenario: Backup and restore pagekite
And I create a backup of the pagekite app data
And I configure pagekite with host afterbackup.example.com, port 8082, kite name afterbackup.example.com and kite secret afterbackupsecret
And I restore the pagekite app data backup
Then pagekite should be enabled
Then the pagekite service should be running
And pagekite should be configured with host beforebackup.example.com, port 8081, kite name beforebackup.example.com and kite secret beforebackupsecret
Scenario: Disable pagekite application
Given the pagekite application is enabled
When I disable the pagekite application
Then pagekite should be disabled
Then the pagekite service should not be running

View File

@ -197,16 +197,6 @@ def backup_restore_from_upload(session_browser, app_name,
os.remove(path)
@then('pagekite should be enabled')
def pagekite_assert_enabled(session_browser):
assert system.pagekite_is_enabled(session_browser)
@then('pagekite should be disabled')
def pagekite_assert_disabled(session_browser):
assert not system.pagekite_is_enabled(session_browser)
@when(
parsers.parse(
'I configure pagekite with host {host:S}, port {port:d}, kite name {kite_name:S} and kite secret {kite_secret:w}'

View File

@ -41,13 +41,6 @@ def get_app_module(app_name):
return module
def get_app_checkbox_id(app_name):
checkbox_id = 'app-toggle-input'
if app_name in app_checkbox_id:
checkbox_id = app_checkbox_id[app_name]
return checkbox_id
def _find_install_button(browser, app_name):
interface.nav_to_module(browser, get_app_module(app_name))
return browser.find_by_css('.form-install input[type=submit]')
@ -101,7 +94,7 @@ def _change_app_status(browser, app_name, change_status_to='enabled'):
and change_status_to == 'enabled'):
interface.submit(browser, element=button)
else:
checkbox_id = get_app_checkbox_id(app_name)
checkbox_id = app_checkbox_id[app_name]
_change_status(browser, app_name, checkbox_id, change_status_to)
if app_name in apps_with_loaders:

View File

@ -257,12 +257,6 @@ def download_file_logged_in(browser, url, suffix=''):
return temp_file.name
def pagekite_is_enabled(browser):
"""Return whether pagekite is enabled."""
nav_to_module(browser, 'pagekite')
return browser.find_by_id('app-toggle-input').checked
def pagekite_configure(browser, host, port, kite_name, kite_secret):
"""Configure pagekite basic parameters."""
nav_to_module(browser, 'pagekite')