I'm trying to write a custom ViewAction ClickWithMessageAction(). But it seems like perform.onClick() is not clicking given element.
ClickWithMessageAction() is called from PageObject where Kakao is used
fun clickButton(){ Button{ ClickWithMessageAction(error_message) }
class ClickWithMessageAction(private val error_message: String) : ViewAction{
override fun getDescription(): String {
return "Click button"
}
override fun getConstraints(): Matcher<View> {
return isEnabled()
}
override fun perform(uiController: UiController?, view: View?) {
if (view != null){
try{
view.performClick()
}catch(e: PerformException){
throw Error(error_message)
}
}
}
}
I expect ClickWithMessageAction to click on element and post an error_message if it fails to do so.
Aucun commentaire:
Enregistrer un commentaire