Skip to content

chore: update tests due to day light saving #428

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Nov 8, 2019
Merged
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
10 changes: 5 additions & 5 deletions tests/runtimes/android/android_runtime_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -627,10 +627,10 @@ def test_440_tns_run_android_new_date_work_as_expected_when_changing_timezone(se
period=5)
assert test_result, "Select time zone Button is missing on the device"
Device.click(self.emulator, text="Select time zone")
test_result = Wait.until(lambda: Device.is_text_visible(self.emulator, "Pacific Daylight Time", True),
test_result = Wait.until(lambda: Device.is_text_visible(self.emulator, "Los Angeles", True),
timeout=30, period=5)
assert test_result, "Pacific Daylight Time Button is missing on the device"
Device.click(self.emulator, text="Pacific Daylight Time")
assert test_result, "Los Angeles Button is missing on the device."
Device.click(self.emulator, text="Los Angeles")

else:
output = Adb.run_adb_command("shell am start -a android.settings.DATE_SETTINGS", self.emulator.id,
Expand All @@ -654,10 +654,10 @@ def test_440_tns_run_android_new_date_work_as_expected_when_changing_timezone(se
period=5)
assert test_result, "TAP Button is missing on the device"
Device.click(self.emulator, text="TAP", case_sensitive=True)
assert_result = Wait.until(lambda: "GMT-0700 (PDT)" in File.read(log.log_file), timeout=240, period=5)
assert_result = Wait.until(lambda: "GMT-0800 (PST)" in File.read(log.log_file), timeout=240, period=5)
assert assert_result, "Missing log for time! Logs: " + File.read(log.log_file)
# Generate regex for asserting date and time
date_to_find_los_angeles = los_angeles_time.strftime(r'%a %b %d %Y %H:.{2}:.{2}') + r" GMT\-0700 \(PDT\)"
date_to_find_los_angeles = los_angeles_time.strftime(r'%a %b %d %Y %H:.{2}:.{2}') + r" GMT\-0800 \(PST\)"
# Assert date time is correct
assert_result = Wait.until(lambda: re.search(date_to_find_los_angeles, File.read(log.log_file)), timeout=20,
period=5)
Expand Down