Created
August 9, 2020 19:58
-
-
Save tatocaster/e400a44a397615c539e0bdbb5bd292d7 to your computer and use it in GitHub Desktop.
Nested Scroll View Espresso scroll viewaction
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fun nestedScrollTo(): ViewAction { | |
return object : ViewAction { | |
override fun getConstraints(): Matcher<View> { | |
return CoreMatchers.allOf(ViewMatchers.withEffectiveVisibility(ViewMatchers.Visibility.VISIBLE), | |
ViewMatchers.isDescendantOfA(CoreMatchers.anyOf( | |
ViewMatchers.isAssignableFrom(ScrollView::class.java), | |
ViewMatchers.isAssignableFrom(HorizontalScrollView::class.java), | |
ViewMatchers.isAssignableFrom(NestedScrollView::class.java))) | |
) | |
} | |
override fun getDescription(): String? { | |
return "not found" | |
} | |
override fun perform(uiController: UiController?, view: View?) { | |
ScrollToAction().perform(uiController, view) | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment