Skip to content

Instantly share code, notes, and snippets.

fun withId(id: Int) = onView(ViewMatchers.withId(id))
fun ViewInteraction.isDisplayed() = check(matches(ViewMatchers.isDisplayed()))
fun ViewInteraction.isNotDisplayed() = check(matches(not(ViewMatchers.isDisplayed())))
fun ViewInteraction.hasText(text: Int) = check(matches(ViewMatchers.withText(text)))
fun ViewInteraction.hasText(text: String) = check(matches(ViewMatchers.withText(text)))