AndroidUiTestingUtils icon indicating copy to clipboard operation
AndroidUiTestingUtils copied to clipboard

SystemLocaleTestRule failing for the first test ONLY on first run.

Open sergio-sastre opened this issue 3 years ago • 0 comments

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:

  • Device or Emulator: Device or emulator
  • API level: any API
  • AndroidUiTestingUtils version: 1.2.1
  • Affected Component: SystemLocaleTestRule and ActivityScenarioForActivityRule(systemLocale ="my_locale"), which uses SystemLocaleTestRule internally.

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 avatar Oct 17 '22 20:10 sergio-sastre