Skip to content
This repository has been archived by the owner on Nov 3, 2021. It is now read-only.

Bug 1230183 - Re-enable test_lockscreen_time_check.py #33502

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion tests/python/gaia-ui-tests/gaiatest/apps/lockscreen/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could call disable_automatic_update() instead.

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')
Expand All @@ -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
Expand Down