From 6cf5aed49d997e2c3ad7b20fc8167e2c9483d19f Mon Sep 17 00:00:00 2001 From: Martijn Wargers Date: Thu, 3 Dec 2015 17:23:05 +0100 Subject: [PATCH] Bug 1230183 - Re-enable test_lockscreen_time_check.py --- .../gaia-ui-tests/gaiatest/apps/lockscreen/app.py | 2 +- .../gaiatest/apps/settings/regions/date_and_time.py | 2 +- .../tests/functional/lockscreen/manifest.ini | 1 - .../lockscreen/test_lockscreen_time_check.py | 12 +++++------- 4 files changed, 7 insertions(+), 10 deletions(-) diff --git a/tests/python/gaia-ui-tests/gaiatest/apps/lockscreen/app.py b/tests/python/gaia-ui-tests/gaiatest/apps/lockscreen/app.py index 8f615beb7ae8..8d4021efe96b 100644 --- a/tests/python/gaia-ui-tests/gaiatest/apps/lockscreen/app.py +++ b/tests/python/gaia-ui-tests/gaiatest/apps/lockscreen/app.py @@ -55,7 +55,7 @@ def time(self): @property def time_in_datetime(self): - return datetime.strptime(self.time, '%I:%M %p') + return datetime.strptime(self.time, '%H:%M') def unlock(self): self._slide_to_unlock('homescreen') diff --git a/tests/python/gaia-ui-tests/gaiatest/apps/settings/regions/date_and_time.py b/tests/python/gaia-ui-tests/gaiatest/apps/settings/regions/date_and_time.py index e5d117dea1ec..5aea3a3c38f8 100644 --- a/tests/python/gaia-ui-tests/gaiatest/apps/settings/regions/date_and_time.py +++ b/tests/python/gaia-ui-tests/gaiatest/apps/settings/regions/date_and_time.py @@ -101,7 +101,7 @@ def get_current_time_text(self): @property def get_current_time_datetime(self): - return datetime.strptime(self.get_current_time_text, '%I:%M %p') + return datetime.strptime(self.get_current_time_text, '%H:%M') @property def screen_element(self): diff --git a/tests/python/gaia-ui-tests/gaiatest/tests/functional/lockscreen/manifest.ini b/tests/python/gaia-ui-tests/gaiatest/tests/functional/lockscreen/manifest.ini index 34144a372500..28c6ed04ebfe 100644 --- a/tests/python/gaia-ui-tests/gaiatest/tests/functional/lockscreen/manifest.ini +++ b/tests/python/gaia-ui-tests/gaiatest/tests/functional/lockscreen/manifest.ini @@ -29,4 +29,3 @@ carrier = true skip-if = device == "desktop" # Due to the Bug 1133803, test requires active sim with data connection carrier = true -disabled = Bug 1167848 - Disable test_lockscreen_time_check.py until bug 1141258 is fixed diff --git a/tests/python/gaia-ui-tests/gaiatest/tests/functional/lockscreen/test_lockscreen_time_check.py b/tests/python/gaia-ui-tests/gaiatest/tests/functional/lockscreen/test_lockscreen_time_check.py index edd3ba8d614e..d24cd1482562 100644 --- a/tests/python/gaia-ui-tests/gaiatest/tests/functional/lockscreen/test_lockscreen_time_check.py +++ b/tests/python/gaia-ui-tests/gaiatest/tests/functional/lockscreen/test_lockscreen_time_check.py @@ -24,12 +24,16 @@ def test_lockscreen_time_check(self): self.settings = Settings(self.marionette) self.settings.launch() datetime_setting = self.settings.open_date_and_time() - old_time = datetime_setting.get_current_time_datetime # Auto time update is by default set to true, turn it off to make region change datetime_setting.toggle_automatic_time_update() self.assertFalse(datetime_setting.is_autotime_enabled, 'Autotime still enabled') + # Change to 24 hour format, so lockscreen shows no ambiguous time + datetime_setting.disable_default_format() + datetime_setting.select_time_format('24-hour') + old_time = datetime_setting.get_current_time_datetime + # change the region. since no one will be in Atlantic Ocean timezone, change in time # will be guaranteed. datetime_setting.set_region('Atlantic Ocean') @@ -56,12 +60,6 @@ def test_lockscreen_time_check(self): self.marionette.switch_to_frame() self.device.lock() - # wait until device is off and turn back on to check that the time is changed - Wait(self.marionette, timeout=20).until( - lambda m: not self.device.is_screen_enabled) - self.device.turn_screen_on() - self.marionette.switch_to_frame() - # Check it reverted to the correct time, and compare it with the previously shown time # Allow 4 minutes difference max difference = lock_screen.time_in_datetime - old_time