Click on not fully visible imageButton with Espresso

前端 未结 7 1082
臣服心动
臣服心动 2021-01-31 09:05

I have a custom ImageButton that is not fully visible, by design, so when I perform a click action I get this error:

android.support.test.espresso.P         


        
7条回答
  •  有刺的猬
    2021-01-31 09:47

    I don't think there is any easy, elegant solution to this. The 90% constraint is hardcoded in GeneralClickAction, and the class is final so we can't override getConstraints.

    I would write your own ViewAction based on GeneralClickAction's code, skipping the isDisplayingAtLeast check.

提交回复
热议问题