Skip to content

Instantly share code, notes, and snippets.

@ditn ditn/espresso_test_helpers.kt Secret
Created Aug 8, 2019

Embed
What would you like to do?
Espresso test extensions
fun Int.matchView(): ViewInteraction = onView(withId(this))
fun Int.checkVisible(): ViewInteraction = matchView()
.check(matches(withEffectiveVisibility(ViewMatchers.Visibility.VISIBLE)))
fun Int.checkInvisible(): ViewInteraction = matchView()
.check(matches(withEffectiveVisibility(ViewMatchers.Visibility.INVISIBLE)))
fun Int.checkGone(): ViewInteraction = matchView()
.check(matches(withEffectiveVisibility(ViewMatchers.Visibility.GONE)))
// etc etc, add as many of these as you need
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.