Detox: setPermissions API for Android

Created on 28 Dec 2017  路  4Comments  路  Source: wix/Detox

With the device object how do I set the overlay permissions to true for android.

accepteenhancement looking for contributors

Most helpful comment

I do see a use case where a setPermissions API would be beneficial for testing, just like iOS, where you may want to test your UI behaves correctly if permission has been granted or denied.

All 4 comments

You just have to install it since install use -g option ( https://github.com/wix/detox/blob/419d356506f0c1751072b8c44bfc663bece4a856/detox/src/devices/android/ADB.js#L51)

from adb

 install [-lrtsdg] PACKAGE
 install-multiple [-lrtsdpg] PACKAGE...
     push package(s) to the device and install them
     -l: forward lock application
     -r: replace existing application
     -t: allow test packages
     -s: install application on sdcard
     -d: allow version code downgrade (debuggable packages only)
     -p: partial application install (install-multiple only)
     -g: grant all runtime permissions

I do see a use case where a setPermissions API would be beneficial for testing, just like iOS, where you may want to test your UI behaves correctly if permission has been granted or denied.

@raphkr Maybe you ran into this too?
A fix will be in the next release for emulators running on API lvl 23 or lower. (API lvl 24 and above worked well before.)

Hi I have noticed in detox by default all permissions are set to be true in android. Is this the true behaviour of detox

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jn3qf picture jn3qf  路  3Comments

pranaybiswas2611 picture pranaybiswas2611  路  3Comments

carlosalmonte04 picture carlosalmonte04  路  4Comments

LeoNatan picture LeoNatan  路  4Comments

gtRfnkN picture gtRfnkN  路  4Comments