matches(not(isDisplayed())) fails with NoMatchingViewException

前端 未结 5 627
既然无缘
既然无缘 2020-12-25 09:25

I am trying to test the absence of the UI view. The view selector is as follows:

public static ViewInteraction onMyTestUi() {
    return onView(withId(R.id.m         


        
5条回答
  •  执笔经年
    2020-12-25 09:51

    You can try this option if you check the view visibility "withEffectiveVisibility"

        onViewWithId(R.id.YOURVIEW).check(matches(ViewMatchers.withEffectiveVisibility(ViewMatchers.Visibility.GONE)))
    

提交回复
热议问题