Barista icon indicating copy to clipboard operation
Barista copied to clipboard

Feature Request: add clickAny<>() support similar to assertAny<>()

Open kenyee opened this issue 5 years ago • 5 comments

assertAny() is a nice feature to let us check any views that are hard to match.

Please add a similar clickAny() method that you can specify a matcher for. Or maybe clickOn() that takes a matcher instead of just an ID or String?

Use case is if a screen has a layout that has a few other layouts included, there are duplicate IDs so you need to reference the parent of the layout you want to clean on...

kenyee avatar May 14 '19 17:05 kenyee

Hi Ken! Thanks for the suggestion :) I remember discussing something like this some time ago. I thought there was an issue already but I can't find one. Yes, in my opinion this would be a very nice feature. A clickOn(matcher: Matcher<View>) would allow people to take advantage of Barista's magic even for corner cases that aren't supported by the current API.

Would you like to contribute it with a Pull Request? That would help a lot.

Sloy avatar May 16 '19 19:05 Sloy

I can try doing a PR...should just able to copy the assertAny code for the most part :-)

kenyee avatar May 20 '19 13:05 kenyee

How's this feature evolving? I've just faced a test that fits on this feature request! 😅

EsteveAguilera avatar Nov 21 '19 10:11 EsteveAguilera

Is there a PR raised for this issue? If not, i'd like to work on this.

sharath2106 avatar Sep 06 '20 17:09 sharath2106

Hi @sharath2106, I don't think anybody is currently working on this. Feel free! :)

Sloy avatar Sep 07 '20 07:09 Sloy