android - Espresso - why is matchesSafely called twice for View Matchers? -
i had following function find particular view when multiple elements have same r.id:
which called doing:
onview(withindex(withid(r.id.design_menu_item_text), 2)).check(matches(withtext("logout"))) this approach fails saying no element @ index <2> found.
however, if use following approach instead, works:
debugging - looks though approach works because matchessafely function goes through views twice, , needs have return true both times in order work. since first approach fail on second loop through of views (the index no longer match in case), fails.
is correct - in goes through views twice? , if so, why espresso this?


Comments
Post a Comment