Issue
I need to perform simple test - text view matching. It is simple thing with:
onView(withId(R.id.titleTextView)).check(matches(withText("Special Offer: First 3 Minutes Free")));
But this part "First 3 Minutes Free" randomly changes with "Get $1.99 for calls" after each activity start.
How can I verify both cases? Operator ||
is not allowed in Espresso...
Solution
Use Hamcrest anyOf
inside withText
method:
onView(withId(R.id.titleTextView)).check(matches(withText(anyOf(is("Special Offer: First 3 Minutes Free"),is("Special Offer: Get $1.99 for calls")))));
Answered By - Saeed Masoumi
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.