datetime: Add functional test for setting time zone

Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
Joseph Nuthalapati 2018-10-10 10:15:17 -07:00 committed by James Valleroy
parent d01c36a8f5
commit f16fe404f2
No known key found for this signature in database
GPG Key ID: 77C0C75E7B650808
3 changed files with 27 additions and 0 deletions

View File

@ -31,3 +31,7 @@ Scenario: Disable network time application
Given the network time application is enabled
When I disable the network time application
Then the network time service should not be running
Scenario: Set timezone
When I set the time zone to Africa/Abidjan
Then the time zone should be Africa/Abidjan

View File

@ -47,6 +47,16 @@ def ntp_is_disabled(browser):
application.disable(browser, 'ntp')
@when(parsers.parse('I set the time zone to {time_zone:S}'))
def time_zone_set(browser, time_zone):
application.time_zone_set(browser, time_zone)
@then(parsers.parse('the time zone should be {time_zone:S}'))
def time_zone_assert(browser, time_zone):
assert time_zone == application.time_zone_get(browser)
@given(parsers.parse('the service discovery application is enabled'))
def avahi_is_enabled(browser):
application.enable(browser, 'avahi')

View File

@ -322,3 +322,16 @@ def ikiwiki_wiki_exists(browser):
browser.find_link_by_href('/plinth/apps/ikiwiki/manage/').first.click()
wiki = browser.find_link_by_href('/ikiwiki/wiki')
return bool(wiki)
def time_zone_set(browser, time_zone):
"""Set the system time zone."""
interface.nav_to_module(browser, 'datetime')
browser.select('time_zone', time_zone)
interface.submit(browser, form_class='form-configuration')
def time_zone_get(browser):
"""Set the system time zone."""
interface.nav_to_module(browser, 'datetime')
return browser.find_by_name('time_zone').first.value