@Test public void testAssertSoftKeyboardIsClosedFailure() { exception.expect(AssertionFailedError.class); exception.expectMessage(containsString("Keyboard should be closed.")); exception.expectMessage(containsString("Expected: is <true>")); exception.expectMessage(containsString("Got: <false>")); givenEditTextToOpenSoftKeyboard(); // other test works and difference is this extra check for initial closed. espDevice.assertSoftKeyboardIsClosed(); espEditText.click(); espDevice.assertSoftKeyboardIsClosed(); }
@Test public void testCloseSoftKeyboard() { givenEditTextToOpenSoftKeyboard(); espDevice.assertSoftKeyboardIsClosed(); espEditText.click(); espDevice.assertSoftKeyboardIsOpen(); espDevice.closeSoftKeyboard(); espDevice.assertSoftKeyboardIsClosed(); }