The GrantPermissionRule that I successfully implemented in my Android app on 1/3/2018 no longer works. When I run my Espresso tests through Android Studio, the emulator blocks waiting for permissions. However, when I run the tests from the command line with ./gradlew dist; ./gradlew connectedDebugAndroidTest --stacktrace
it doesn't ask for the permissions. Note I do wipe data from the emulator manually before each run to ensure it's a proper test of GrantPermissionRule.
Here are the original references I used to implement GrantPermissionRule: https://www.kotlindevelopment.com/runtime-permissions-espresso-done-right/ https://developer.android.com/reference/android/support/test/rule/GrantPermissionRule.html
Versions in app/build.gradle:
- com.android.support.test.espresso:espresso-core:'3.0.1'
- com.android.support.test:runner:'1.0.1'
Has GrantPermissionRule stopped working as-advertised for anyone else?