Espresso - How can I check if an activity is launched after performing a certain action?

后端 未结 8 1549
北海茫月
北海茫月 2020-12-02 15:34

the following is one of my Espresso test cases.

    public void testLoginAttempt() {
        Espresso.onView(ViewMatchers.withId(R.id.username)).perform(View         


        
8条回答
  •  我在风中等你
    2020-12-02 15:58

    Try:

    intended(hasComponent(YourActivity.class.getName()));

    Also, keep in mind

    java.lang.NullPointerException is thrown if Intents.init() is not called before intended()

提交回复
热议问题