Привет, у вас проблемы с работой. Я хочу нажать кнопку входа в систему и проверить, появляются ли ошибки проверки. Я использую проверки материального дизайна, это то, что я написал
@Test
public void click_login_with_empty_fields_gives_errors() {
onView(withId(R.id.login)).perform(click());
onView(withId(R.id.login_email2)).check(matches(hasErrorText("Email Field cannot be empty")));
onView(withId(R.id.login_password2)).check(matches(hasErrorText("Password field cannot be empty")));
}
Я получаю ошибку
androidx.test.espresso.base.DefaultFailureHandler$AssertionFailedWithCauseError: 'with error: is "Password field cannot be empty"' doesn't match the selected view.
Expected: with error: is "Password field cannot be empty"
Got: "TextInputEditText{id=2131362003, res-name=login_password2, visibility=VISIBLE, width=996, height=141, has-focus=false, has-focusable=true, has-window-focus=true