Espresso开放式酒吧

时间:2017-09-23 13:00:31

标签: android testing android-espresso

遇到与a link

相同的问题

但是当我使用

@Test
public void app6_7() throws Exception {
    onView(withId(R.id.email)).perform(clearText());
    onView(withId(R.id.email)).perform(typeText(userMail));
    onView(withId(R.id.password)).perform(clearText());
    onView(withId(R.id.password)).perform(typeText(userPassword));
    onView(withId(R.id.email_sign_in_button)).perform(click());
    openActionBarOverflowOrOptionsMenu(InstrumentationRegistry.getTargetContext());
    onView(withContentDescription(R.id.drawerLayout)).perform(click());
    onView(withId(R.id.nav_logout)).perform(click());

我明白了

android.support.test.espresso.NoMatchingViewException: No views in hierarchy found matching: ((is displayed on the screen to the user and with content description: is "More options") or (is displayed on the screen to the user and with class name: a string ending with "OverflowMenuButton"))

此时InstrumentationRegistry和getTargetContext是不正确的? 这是我第一次喝咖啡,所以也许我忽略了什么?

0 个答案:

没有答案