Git Product home page Git Product logo

Comments (12)

rocboronat avatar rocboronat commented on June 1, 2024 1

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.

rocboronat avatar rocboronat commented on June 1, 2024

Totally agree 😄

from barista.

SmasSive avatar SmasSive commented on June 1, 2024

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.

SmasSive avatar SmasSive commented on June 1, 2024

Yeah! Then I agree with you both 👯‍♂️

from barista.

rocboronat avatar rocboronat commented on June 1, 2024

Then... it's PR time! 🎉 hehehe

from barista.

Sloy avatar Sloy commented on June 1, 2024

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.

Sloy avatar Sloy commented on June 1, 2024

LOL I see I was too slow writing my comment, you both already answered.
:partyparrot:

from barista.

rocboronat avatar rocboronat commented on June 1, 2024

Welcome to the party, @Sloy ! Take some ice! 🍸 🍹

from barista.

SmasSive avatar SmasSive commented on June 1, 2024

Jajaja @Sloy now your explanation is perfect!
So let's code it out!

from barista.

Sloy avatar Sloy commented on June 1, 2024

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.

Sloy avatar Sloy commented on June 1, 2024

There goes my idea: #38

from barista.

rocboronat avatar rocboronat commented on June 1, 2024

Done by @Sloy !

from barista.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.