问题描述
由于新的sdk 26的android设备上运行测试会导致测试失败>自动填充功能可在意式浓缩咖啡尝试单击时隐藏字段.
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.
我正在Firebase测试实验室上运行测试,因此无法在测试设备上手动禁用它们.
Im running my tests on firebase test lab so I cannot disable them manually on my tests devices.
一些图片:
Espresso无法立即单击密码字段,因为自动填充对话框隐藏了我的字段和fail
.
Espresso cant click now password field since the autofill dialog is hiding my field and fail
.
使用AutofillManager#disableAutofillServices()
仅禁用#2.对话,但#3.还在那里.
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
这应禁用自动填充服务.与在系统设置中手动关闭自动填充服务相同.它至少可以在模拟器上运行.但这需要root访问.
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.
禁用自动填充服务的另一种方法是更改autofill_service
设置.
Another way to disable the autofill service is to change the autofill_service
settings.
adb shell settings put secure autofill_service null
这篇关于如何从Android Oreo禁用新的自动填充功能以进行浓缩咖啡测试的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!