Instrumentation setup
Application modules
If you get any error due to "Activity not found" in your application module, add the following to the androidTest/manifest
System Locale
To change the System Locale via SystemLocaleTestRule (i.e. necessary for snapshot testing Activities only), you also need to add the following permission to your androidTest/manifest
. For multi-module apps, do this in the app module.
And add the TestRule to your tests
In-App Locale
AndroidUiTestingUtils also supports per-app language preferences in instrumentation tests. In order to change the In-App Locale, you need to use the InAppLocaleTestRule
. For that it is necessary to add the following dependency in your build.gradle
Use this rule to test Activities with in-app Locales that differ from the System Locale.
Last updated