Created
September 4, 2019 06:47
-
-
Save rakib10rr3/2468ff4ef34fe82095e0fd9cb196ef5d to your computer and use it in GitHub Desktop.
This file contains hidden or 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
private fun customScroll(): ViewAction { | |
return object : ViewAction { | |
override fun getDescription(): String? { | |
return null | |
} | |
override fun getConstraints(): Matcher<View> { | |
return CoreMatchers.allOf(withEffectiveVisibility(ViewMatchers.Visibility.VISIBLE), isDescendantOfA(anyOf( | |
isAssignableFrom(ScrollView::class.java), | |
isAssignableFrom(HorizontalScrollView::class.java), | |
isAssignableFrom(NestedScrollView::class.java))) | |
) | |
} | |
override | |
fun perform(uiController: UiController, view: View) { | |
ScrollToAction().perform(uiController,view) | |
} | |
} | |
} | |
//Call it like this | |
onView(withId(R.id.contactMobileNumberTIET)).perform(customScroll(), typeText("0123456789")) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment