How to execute an EditText actionDone event using Espresso

The question is in the title.

I tried something like:

    onView(withId(R.id.search_edit_text))
            .perform(typeText("some"), pressKey(KeyEvent.KEYCODE_ENTER));

But that will not work. The keyboard is still displayed, TextView.OnEditorActionListenernot being called. Any ideas?

+4
source share
1 answer

Try

onView(withId(R.id.search_edit_text))
        .perform(typeText("some"), pressImeActionButton());
+11
source

Source: https://habr.com/ru/post/1627340/


All Articles