-
-
Notifications
You must be signed in to change notification settings - Fork 120
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
assertDisplayed doesn't work when multiple views matches the text #37
Comments
Totally agree 😄 |
Sorry but I don't understand what you are trying to say @Sloy ... But for sure I misunderstand something 💃 |
Yeah! Then I agree with you both 👯♂️ |
Then... it's PR time! 🎉 hehehe |
Exactly, sorry for the bad explanation 😅 "Banana" appears twice in that screen, let's say it's the title of the screen and also a TextView inside the layout. With espresso, if you run My point is: from the perspective of a Barista user, Better @SmasSive ? |
LOL I see I was too slow writing my comment, you both already answered. |
Welcome to the party, @Sloy ! Take some ice! 🍸 🍹 |
Jajaja @Sloy now your explanation is perfect! |
Ideas? |
There goes my idea: #38 |
* Created test to reproduce the issue in #37 #37 * Fixed failing test with firstOf matcher * Create failing test to reproduce wrong behavior with firstOf * Fixed failing test by using allOf matcher By including the isDisplayed condition as a requirement for onView, we filter any views that matches the text but are not displayed. A bit tricky though. * Renamed firstOf to firstViewOf Because the usage is different from allOf. It's not a matcher filter, but a view filter. * Remove an unneeded parenthesis * Handle assertDisplayed for repeated texts by string resource * Added precondition for gone view in repeated views test
Done by @Sloy ! |
We found a case that I think Barista should handle.
In an Activity we had multiple views with the same text "Banana", and we were doing
assertDisplayed("Banana")
to verify that the data had been loaded and displayed.Espresso fails because multiple views match the condition
withText()
.From the perspective of someone using Barista and reading the method
assertDisplayed
, I think it should work. What do you guys think???The text was updated successfully, but these errors were encountered: