我必须在屏幕上输入登录名和密码。我想在其中写一些文本并检查值。所以我写了一个代码
@Test
fun enterPhoneAndPassword() {
onView(withId(R.id.enter_phone_number)).perform(replaceText(TEST_PHONE_NUMBER))
onView(withId(R.id.enter_password)).perform(replaceText(TEST_PASSWORD))
onView(withId(R.id.enter_phone_number)).check(matches(withHint(R.string.phone_hint)))
onView(withId(R.id.enter_password)).check(matches(withHint(R.string.password_hint)))
onView(withId(R.id.enter_phone_number)).check(matches(withText(MASKED_PHONE_NUMBER)))
onView(withId(R.id.enter_password)).check(matches(withText(TEST_PASSWORD)))
}
但是我也想检查一下,在我键入一些文本后,edittext的提示消失了(因为在某些情况下,我看到了一些情况,旧的smarthphone键入了文本并且显示了可见的提示)。如何检查?