Created
March 22, 2021 09:13
-
-
Save DaChelimo/9a6af1481d52bc46658e752c7533b86d to your computer and use it in GitHub Desktop.
Extensions for Espresso Testing Library
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
fun setTextInTextView(value: String?): ViewAction { | |
return object : ViewAction { | |
override fun getConstraints(): Matcher<View> { | |
return allOf(isDisplayed(), isAssignableFrom(TextView::class.java)) | |
} | |
override fun perform(uiController: UiController?, view: View) { | |
(view as TextView).text = value | |
} | |
override fun getDescription(): String { | |
return "replace text" | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment