Running tests on android devices with sdk 26
causes them to fail because of the new Autofill feature that hides the fields when espresso are trying to click them.
Im running my tests on firebase test lab so I cannot disable them manually on my tests devices.
Some images:
Espresso cant click now password field since the autofill dialog is hiding my field and fail
.
Using AutofillManager#disableAutofillServices()
only disabled the #2. dialog but #3. is still there.
How to disable Autofill on test devices?
adb shell pm disable com.google.android.gms/com.google.android.gms.autofill.service.AutofillService
This should disable the autofill service. It is same as turning off autofill service in the system settings manually. It at least worked on the emulator. But this needs root access.
Another way to disable the autofill service is to change the autofill_service
settings.
adb shell settings put secure autofill_service null