Closed letroll closed 4 years ago
resolved by using same principle than KTextInputLayout.kt :
'''
class KClearableEditText : KBaseView
constructor(function: ViewBuilder.() -> Unit) : super(function) {
edit = getkEditText(function)
}
constructor(parent: Matcher<View>, function: ViewBuilder.() -> Unit) : super(parent, function) {
edit = getkEditText(function)
}
constructor(parent: DataInteraction, function: ViewBuilder.() -> Unit) : super(parent, function) {
edit = getkEditText(function)
}
private fun getkEditText(function: ViewBuilder.() -> Unit): KEditText {
return KEditText {
isDescendantOfA(function)
isInstanceOf(EditText::class.java)
}
}
val nameEditTextView = KClearableEditText { withId(R.id.nameClearableEditText) }
nameEditTextView.edit.typeText("toto")
'''
Hello,
In my projet I have a custom view with an EditText child. This custom view have a method setEditTextValue(text:String).
How to make a test where we use it to input text ?
I had tried with this code :