Drag & Drop Espresso

前端 未结 2 643
轮回少年
轮回少年 2021-01-04 13:50

Is it possible to perform drag & drop action via Espresso? I need to move one view down (in straight line) in order to accept some conditions in my automation test.

2条回答
  •  悲&欢浪女
    2021-01-04 14:25

    You can use GeneralSwipeAction to perform drag & drop.

    public static ViewAction swipeUp() {  
    return new GeneralSwipeAction(Swipe.FAST, GeneralLocation.BOTTOM_CENTER,  
        GeneralLocation.TOP_CENTER, Press.FINGER);  
    }
    

    You can customize the location to meet your requirement as well.

提交回复
热议问题