My app is a device admin, and I enable it by running
Intent intent = new Intent(DevicePolicyManager.ACTION_ADD_DEVICE_ADMIN);
and pressing "Activate" or "Enable."
Can I enable the device admin from my test APK using Espresso?
My app is a device admin, and I enable it by running
Intent intent = new Intent(DevicePolicyManager.ACTION_ADD_DEVICE_ADMIN);
and pressing "Activate" or "Enable."
Can I enable the device admin from my test APK using Espresso?
Espresso is pretty much limited to testing your own activities. The "make me a device admin" steps are in another app.
UI Automator is the way to implement cross-app testing. It is not nearly as flexible on the testing front (e.g., you do not have access to the objects of the other app), but you can perform UI actions in other apps to as part of the testing.