Comments (12)
Nope. The thing is why it's failing, @SmasSive . In the context @Sloy given, the app is showing "Banana" several times. As a Barista user, if I want to check if the text "Banana" is there, if there are lots of "Banana", assertDisplayed("Banana")
should give a green, not an Exception.
from barista.
Totally agree
from barista.
Sorry but I don't understand what you are trying to say @Sloy ...
You are doing assertDisplayed("Banana")
right? but Espresso fails... And AFAIK Barista is a wrapper of Espresso so, if Espresso fails, Barista should fail too.
But for sure I misunderstand something
from barista.
Yeah! Then I agree with you both
from barista.
Then... it's PR time!
from barista.
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
onView(withText(text)).check(matches(isDisplayed()));
and it finds two views with the text "Banana", it fails.
My point is: from the perspective of a Barista user, assertDisplayed()
means it's displayed any number of times, the name of the method doesn't imply the other restriction.
Better @SmasSive ?
from barista.
LOL I see I was too slow writing my comment, you both already answered.
:partyparrot:
from barista.
Welcome to the party, @Sloy ! Take some ice!
from barista.
Jajaja @Sloy now your explanation is perfect!
So let's code it out!
from barista.
Ideas?
We solved it by wrapping the withText("Banana")
matcher inside a firstOf(withText("Banana"))
matcher.
But it wouldn't work if the first banana is hidden and the second one is displayed.
from barista.
There goes my idea: #38
from barista.
Done by @Sloy !
from barista.
Related Issues (20)
- Error : Build failed Could not find com.adevinta.spain:barista:4.0.0. HOT 1
- Barista compose HOT 7
- Jsoup Library is presenting a security issue when scanning HOT 2
- API 31 - Android 12 HOT 2
- App crashes when clicking Feed HOT 1
- Explain the purpose of the sample app in the contributors page
- Failing UI tests on API 31
- make `assertRecyclerViewItemCount` accept logical condition instead of exact number
- Snackbar action
- ActivityTestRule is deprecated HOT 1
- java.lang.SecurityException: Calling from not trusted UID! with 4.1.0 and + version HOT 1
- [Discussion] Why assertNotDisplayed does not fail HOT 2
- Failed to resolve: androidx.test:core:1.5.0 HOT 16
- assertNotExist with viewmatcher
- baristaRule is causing keyDispatchingTimedOut during the automation test HOT 1
- assertContains & assertNotContains with viewMatcher HOT 1
- assertNotContains with viewMatcher
- assertTextColorIs & assertTextColorIsNot with viewMatcher
- assertTextColorIsNot with viewMatcher
- P
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from barista.