Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to perform actionDone event of EditText with Espresso

Question in the title.

I tried something like:

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

But it doesn't work. Keyboard is still shown and TextView.OnEditorActionListener not called. Any ideas?

like image 551
Alexandr Avatar asked Feb 04 '16 18:02

Alexandr


1 Answers

Try

onView(withId(R.id.search_edit_text))
        .perform(typeText("some"), pressImeActionButton());
like image 109
liminal Avatar answered Oct 22 '22 17:10

liminal