Testing EditText errors with Espresso on Android

前端 未结 2 614
抹茶落季
抹茶落季 2021-02-19 04:51

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

2条回答
  •  孤街浪徒
    2021-02-19 05:43

    This worked for me under

            onView(withId(R.id.signin_email)).check(matches(hasErrorText("Email not valid")));
    

提交回复
热议问题