AdevintaSpain/Barista

Barista compose

alorma opened this issue Β· 7 comments

https://developer.android.com/jetpack/compose/testing

Even compose test library is a great improvement from espresso.. I still think it's a bit verbose sometimes:

composeTestRule.onNode(matcher).assert(hasText("Button"))

Following barista philosophy this would be:

composeTestRule.assertHasText(matcher, "Button")

etc...

What do you guys think? Should we provide barista methods for testing compose?

From a user view point I think it would be great that the assertion work for both Android Views and Compose views, but I understand that it may be hard to do right (and may have some performance impact).

Another win would be to maintain the Barista API but use the Compose assertions under the hood, that way you keep all the API knowledge and Barista can work in ironing out the underlying API issues.
My biggest gripe with this approach is API discoverability (how do you know that a method applies to Compose or Android Views?)

My main idea @danieldisu is to create a separate artifact barista-compose, with similar api as barista but using compose methods

Sloy commented

I'd have to try out the compose testing libraries before giving my opinion on this πŸ™ˆ
I hope Compose doesn't need Barista, especially the weird hidden magic stuff. But who knows.

I have bad news here @alorma: I'm so focused on Flutter that I never tried Compose. So here's for the ones who work with Compose! 🍸

I'd love to see and use Barista Compose. I can contribute if you need some help to make it real! πŸš€

We have a volunteer, we have a volunteer! πŸ•ΊπŸ’ƒ

HI @costular

Thanks for the offer as a volunteer on moving barista to compose!

I've created a discussion (#441) to move it further