mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-09-19 04:59:01 +00:00
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:
parent
0b5b384651
commit
89b7301962
@ -11,7 +11,7 @@ Background:
|
|||||||
Scenario: Enable pagekite application
|
Scenario: Enable pagekite application
|
||||||
Given the pagekite application is disabled
|
Given the pagekite application is disabled
|
||||||
When I enable the pagekite application
|
When I enable the pagekite application
|
||||||
Then pagekite should be enabled
|
Then the pagekite service should be running
|
||||||
|
|
||||||
Scenario: Configure pagekite application
|
Scenario: Configure pagekite application
|
||||||
Given the pagekite application is enabled
|
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 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 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
|
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
|
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
|
Scenario: Disable pagekite application
|
||||||
Given the pagekite application is enabled
|
Given the pagekite application is enabled
|
||||||
When I disable the pagekite application
|
When I disable the pagekite application
|
||||||
Then pagekite should be disabled
|
Then the pagekite service should not be running
|
||||||
|
|||||||
@ -197,16 +197,6 @@ def backup_restore_from_upload(session_browser, app_name,
|
|||||||
os.remove(path)
|
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(
|
@when(
|
||||||
parsers.parse(
|
parsers.parse(
|
||||||
'I configure pagekite with host {host:S}, port {port:d}, kite name {kite_name:S} and kite secret {kite_secret:w}'
|
'I configure pagekite with host {host:S}, port {port:d}, kite name {kite_name:S} and kite secret {kite_secret:w}'
|
||||||
|
|||||||
@ -41,13 +41,6 @@ def get_app_module(app_name):
|
|||||||
return module
|
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):
|
def _find_install_button(browser, app_name):
|
||||||
interface.nav_to_module(browser, get_app_module(app_name))
|
interface.nav_to_module(browser, get_app_module(app_name))
|
||||||
return browser.find_by_css('.form-install input[type=submit]')
|
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'):
|
and change_status_to == 'enabled'):
|
||||||
interface.submit(browser, element=button)
|
interface.submit(browser, element=button)
|
||||||
else:
|
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)
|
_change_status(browser, app_name, checkbox_id, change_status_to)
|
||||||
|
|
||||||
if app_name in apps_with_loaders:
|
if app_name in apps_with_loaders:
|
||||||
|
|||||||
@ -257,12 +257,6 @@ def download_file_logged_in(browser, url, suffix=''):
|
|||||||
return temp_file.name
|
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):
|
def pagekite_configure(browser, host, port, kite_name, kite_secret):
|
||||||
"""Configure pagekite basic parameters."""
|
"""Configure pagekite basic parameters."""
|
||||||
nav_to_module(browser, 'pagekite')
|
nav_to_module(browser, 'pagekite')
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user