Created
August 29, 2019 17:18
-
-
Save razir/b4face95f9f60a373785ac4aeb635ce9 to your computer and use it in GitHub Desktop.
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 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))) | |
fun ViewInteraction.withHint(text: Int) = check(matches(ViewMatchers.withHint(text))) | |
fun ViewInteraction.typeText(text: String) = perform(ViewActions.typeText(text)) | |
fun ViewInteraction.closeSoftKeyboard() = perform(ViewActions.closeSoftKeyboard()) | |
fun ViewInteraction.click() = perform(ViewActions.click()) | |
fun ViewInteraction.isEnabled() = check(matches(ViewMatchers.isEnabled())) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment