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
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! πΊπ