AdevintaSpain / Barista

:coffee: The one who serves a great Espresso
Other
1.7k stars 120 forks source link

Provide methods that receive any custom Matcher #224

Open Sloy opened 6 years ago

Sloy commented 6 years ago

The changes proposed in https://github.com/SchibstedSpain/Barista/pull/223 raised the discussion of just having simple methods for searching views by id and text, or having more combinations for special cases.

Allowing a third variant to search by any Matcher<View> would allow users to use their own custom rules for any special case.

For example:

clickOn(R.id.button)

clickOn("Button")

val customMatcher = allOf(withId(R.id.button), isEnabled()))
clickOn(customMatcher)

This would apply to Interactions and Assertions.

Opinions?

alorma commented 6 years ago

Go for it!

SmasSive commented 6 years ago

That's nice! And easy with Kotlin! 💃

EsteveAguilera commented 5 years ago

Hey @SmasSive, any progress with this issue?