Espresso testing disable animation

后端 未结 3 1819
臣服心动
臣服心动 2020-12-30 21:42

@Test
    public void test3_PaySuccessful(){
        init();

    ViewInteraction amountEditText = onView(
            allOf(withId(R.id.et_amount), isDispl         


        
3条回答
  •  情书的邮戳
    2020-12-30 22:02

    True, you shouldn't add test code in production code. The problem here lies in the animation. If you are performing animations using Handlers and Runnables then you can't turn them off using the Developer Options. A common place where we use this to animate is in Custom views.

    But even in custom views, ensure you use either ValueAnimator, ObjectAnimator or AnimatorSet to perform your animation. Only then you can turn off animations by turning off Animator duration scale in Developer options.

    A good reference is the ProgressBar.

提交回复
热议问题