sergio-sastre / AndroidUiTestingUtils

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

"Error while connecting UiAutomation" first time SystemTestRule is used directly or indirectly on an emulator/device with API 23-27 #46

Closed sergio-sastre closed 1 year ago

sergio-sastre commented 1 year ago

Describe the bug We get UiAutomation errors ONLY when running for the first time screenshot tests that use SystemTestRule or ActivityScenarioForActivityRule(systemLocale = "myLocale") on emulators/devices with API 23-27. Afterwards the error does not happen anymore.

Environment The setup in which the bug is reproducible:

Expected behavior No UiAutomator error happening

Additional context This happens because the CHANGE_CONFIGURATION permission is granted on SystemTestRule creation. We should delay it till needed -> we do change the locale. At that moment the test is already running and UiAutomator is available

sergio-sastre commented 1 year ago

fixed in 1.2.4