I do not think this is a matter of deception. I am writing a simple espresso test, and part of it involves clicking the “Ok” button in the diner.
Espresso.onView(allOf(withId(android.support.design.R.id.snackbar_text), withText(R.string.permission_snackbar))) .check(matches(isDisplayed())); Espresso.onView(withText("Ok")).perform(click());
It throws
android.support.test.espresso.PerformException: executing a “Single-click to view” error with the text: “Good.” Called: java.lang.RuntimeException: the action will not be executed because the target view does not meet one or more of the following restrictions : The user is given at least 90 percent of the field of view. Target view: "AppCompatButton {id = 2131558552, res-name = snackbar_action, visibility = VISIBLE, width = 264, height = 144, has-focus = false, has-focusable = true, has-window-focus = true, is-clickable = true, is-enabled = true, is-focus = false, is-focusable = true, is-layout-request = false, is-selected = false, root-is- layout-request = false, has-input-connection = false, x = 684.0, y = 53.0, text = Ok, input-type = 0, ime-target = false, has-links = false} "
Any ideas?
java android android-espresso android-snackbar
user user
source share