Issue
I have a recycler view which should contain 3 items in an unknown order.
I know how to get a recycled item by position and how to check for text
onView(withId(...)).check(matches(atPosition(0, hasDescendant(withText(A)))));
But I don't know how I can say withText(A)
or withText(B)
I googled but cant see anything like an OR hamcrest matcher
Solution
You can use Matchers.anyOf()
. For example:
onView(anyOf(withText("X"), withText("Y"))).check(matches(isDisplayed()))
Answered By - Kevin Coppock
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.