I cannot get ViewActions.closeSoftKeyboard () to work in Espresso 2.2.2

I am trying to test the application and I need to hide the keyboard because I cannot press a button because of this. So, I added Espresso to build.gradle:

androidTestCompile 'com.android.support.test.espresso:espresso-core:2.2.2'

and tried using this from the library android.support.test.espresso.action.ViewActions:

ViewActions.closeSoftKeyboard();

Testing succeeds but fails after entering some text in the EditText in my layout. And the keyboard is still there, showing.

PS I realized that it was a keyboard error after reading this answer.

+4
source share
1 answer

ViewAction , ViewInteraction. , perform() : onView()..perform(typeText(..), closeSoftKeyboard()), , Espresso : Espresso.closeSoftKeyboard()

+12

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


All Articles