在espresso测试中检查按钮是否可单击,Android Studio [英] Checking if a button is clickable in espresso test, android studio
本文介绍了在espresso测试中检查按钮是否可单击,Android Studio的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在编写测试以确定某个特定按钮不可单击或可单击.但是在我看来,没有任何方法,或者也许我找不到一种可以使用Espresso检查此功能的方法.谁能帮我吗?
I am writing tests to determine that a specific button is not clickable or is clickable. However it seems to me that there isn't any method or maybe I can't find a method that can check this feature using Espresso. Can anyone help me ?
谢谢
推荐答案
为什么不呢?您可以使用isClickable()匹配器.
Why not? You can use isClickable() Matcher.
onView(withId(R.id.your_button)).check(matches(isClickable()));
这篇关于在espresso测试中检查按钮是否可单击,Android Studio的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文