sergio-sastre / AndroidUiTestingUtils

A set of TestRules, ActivityScenarios and utils to facilitate UI and screenshot testing under given configurations: FontSizes, Locales...
MIT License
290 stars 14 forks source link

SystemLocaleTestRule failing for the first test ONLY on first run. #15

Closed sergio-sastre closed 1 year ago

sergio-sastre commented 1 year ago

Describe the bug SystemLocaleTestRule does not always work the very first time the Tests run on a device/emulator, silently failing for the very first test ONLY with a SecurityException. Therefore, for that test ONLY is the System Locale not changed.

Environment The setup in which the bug is reproducible:

Expected behavior Must change the SystemLocale for every single test.

Additional context This is happening because the SystemLocalTestRule is trying to change the system locale before the CHANGE_CONFIGURATION permission is granted.

sergio-sastre commented 1 year ago

Fix in 1.2.2