the following is one of my Espresso test cases.
public void testLoginAttempt() { Espresso.onView(ViewMatchers.withId(R.id.username)).perform(View
Try:
intended(hasComponent(YourActivity.class.getName()));
Also, keep in mind
java.lang.NullPointerException is thrown if Intents.init() is not called before intended()
java.lang.NullPointerException
Intents.init()
intended()