linkedin / test-butler

Reliable Android Testing, at your service
Apache License 2.0
1.05k stars 92 forks source link

Ability to change date/time of emulator #72

Open agramian opened 7 years ago

agramian commented 7 years ago

It would be useful to provide a way to change the emulator's date and time for certain tests that vary the UI or logic based on the current device time.

Kisty commented 6 years ago

This would be helpful. Especially when testing alarms in AlarmManager.

One option is to use ShadowAlarmManager#getScheduledAlarms() in Robolectric, to check for scheduled alarms.

This answer might help in adding it to Test Butler.

In the meantime, you could add a custom layer of indirection or use joda-time