I want to test if an EditText field has an error (set with editText.setError(\"Cannot be blank!\")).
I\'ve created an Espresso test case with the new AndroidStu
You change editText.check(matches(isDisplayed())); to editText.check(matches(hasErrorText("Cannot be blank!")));
editText.check(matches(isDisplayed()));
editText.check(matches(hasErrorText("Cannot be blank!")));
This worked for me under
onView(withId(R.id.signin_email)).check(matches(hasErrorText("Email not valid")));