检查editText中的提示是否在Espresso中消失了

时间:2020-03-01 15:49:42

标签: android android-espresso

我必须在屏幕上输入登录名和密码。我想在其中写一些文本并检查值。所以我写了一个代码

@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键入了文本并且显示了可见的提示)。如何检查?

0 个答案:

没有答案
相关问题