遇到与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是不正确的? 这是我第一次喝咖啡,所以也许我忽略了什么?