Checking if a button is clickable in espresso test, android studio
问题 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 ? Thank you 回答1: Why not? You can use isClickable() Matcher. onView(withId(R.id.your_button)).check(matches(isClickable())); 回答2: i always combine more tests for my button @Test public void buttonIsEnabled() { onView(withId(R.id. your_button)).check(matches