Splitties
Splitties copied to clipboard
Add Espresso Split
I think it would be useful to have a split for Espresso testing. I'll follow up on this ticket with more specific ideas, but one off the top of my head would be to replace this:
onView(withId(R.id.someInput)).perform(clearText(), typeText("Adam"), closeSoftKeyboard())
With something like:
enterText(R.id.someInput, "Adam")
Which reduce even more Espresso boilerplate. I will think about this, though, because the above example isn't really flexible and may not be exactly what the user wants to do. In any case, I think it's a worthy discussion.
I think your enterText
example is nice. For cases where you would not want to clear the text, there may be an addText
extension, and both may have a closeSoftKeyboard
parameter that would default to true
.
I'm interested in seeing other examples like this as you come across Espresso boilerplate in codebases.