如何从Android Oreo禁用新的自动填充功能以进行浓缩咖啡测试 [英] How to disable the new Autofill feature from Android Oreo for espresso tests

查看:161
本文介绍了如何从Android Oreo禁用新的自动填充功能以进行浓缩咖啡测试的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

由于新的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禁用新的自动填充功能以进行浓缩咖啡测试的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆