I can't make ViewActions.closeSoftKeyboard() work in Espresso 2.2.2
<p>I'm trying to test an app and I require to hide the keyboard, because I cannot click button because of it. So, I added Espresso in build.gradle:</p>

<pre><code>androidTestCompile 'com.android.support.test.espresso:espresso-core:2.2.2'
</code></pre>

<p>and tried to use this from <code>android.support.test.espresso.action.ViewActions</code> library:</p>

<pre><code>ViewActions.closeSoftKeyboard();
</code></pre>

<p>Test runs successfully, but fails after typing some text in EditText in my layout. And keyboard is still there, showing.</p>

<p>P.S. I realized it was keyboard's fault after <a href="https://stackoverflow.com/a/29792724/4279735">reading this answer.</a></p>