feat: support w3c actions and velocity swipe
Description
Since the facebookarchive/WebDriverAgent has been archived and the current maintained version is the Appium fork, there has been an increasing demand to utilize the new endpoints introduced in the Appium fork. Notably, the /actions endpoint is now being used for complex touch operations.
In response to this demand, I have made some minor adaptations to support these endpoints, specifically implementing support for /actions and /wda/pressAndDragWithVelocity.
Changes
- Add relevant Classes for W3CActions
- Support
/actionsendpoint - Support
/wda/pressAndDragWithVelocityendpoint
Also documented W3CActions and its relevant classes
Added support for /wda/touch/multi/perform endpoint for wda under v7.0.0
今天早上review了一下,在想是否真的需要这么多的类(TouchTap, TouchLongPress,TouchPress,TouchMovement,FingerMovement) 这些类做了什么呢, with_xy, with_origin,部分类还有with_pressure 都是用来初始化类的成员变量的,而其他的方法并没有,既然如此去掉这些类是否可行呢。
我构思了一下,下面的方法是否可行呢。去掉这些类,直接把值传过去。功能效果一样,代码确更少了。
FingerAction().move(x, y).down.pause(0.1).up()
TouchActions().press(x, y, pressure=1).pause(.1).up() # 补充疑问,为什这里是.. Actions,而上面是..Action
need a little update
今天早上review了一下,在想是否真的需要这么多的类(TouchTap, TouchLongPress,TouchPress,TouchMovement,FingerMovement) 这些类做了什么呢, with_xy, with_origin,部分类还有with_pressure 都是用来初始化类的成员变量的,而其他的方法并没有,既然如此去掉这些类是否可行呢。
我构思了一下,下面的方法是否可行呢。去掉这些类,直接把值传过去。功能效果一样,代码确更少了。
FingerAction().move(x, y).down.pause(0.1).up() TouchActions().press(x, y, pressure=1).pause(.1).up() # 补充疑问,为什这里是.. Actions,而上面是..Action
不愧是蓝哥, 这么优雅
今天早上review了一下,在想是否真的需要这么多的类(TouchTap, TouchLongPress,TouchPress,TouchMovement,FingerMovement)
这些类做了什么呢, with_xy, with_origin,部分类还有with_pressure 都是用来初始化类的成员变量的,而其他的方法并没有,既然如此去掉这些类是否可行呢。
我构思了一下,下面的方法是否可行呢。去掉这些类,直接把值传过去。功能效果一样,代码确更少了。
FingerAction().move(x, y).down.pause(0.1).up() TouchActions().press(x, y, pressure=1).pause(.1).up() # 补充疑问,为什这里是.. Actions,而上面是..Action
确实在类的实现上面是有些冗余和重复了,下周 update 下
另,TouchActions 其实是为了对齐 W3CActions 的命名,不过 W3CActions 是多个 Actions 的并集,TouchAction 应该只对应一个滑动操作,这里应该确实是和 FingerAction 对齐会更好一些(?)
今天早上review了一下,在想是否真的需要这么多的类(TouchTap, TouchLongPress,TouchPress,TouchMovement,FingerMovement) 这些类做了什么呢, with_xy, with_origin,部分类还有with_pressure 都是用来初始化类的成员变量的,而其他的方法并没有,既然如此去掉这些类是否可行呢。 我构思了一下,下面的方法是否可行呢。去掉这些类,直接把值传过去。功能效果一样,代码确更少了。
FingerAction().move(x, y).down.pause(0.1).up() TouchActions().press(x, y, pressure=1).pause(.1).up() # 补充疑问,为什这里是.. Actions,而上面是..Action确实在类的实现上面是有些冗余和重复了,下周 update 下
另,TouchActions 其实是为了对齐 W3CActions 的命名,不过 W3CActions 是多个 Actions 的并集,TouchAction 应该只对应一个滑动操作,这里应该确实是和 FingerAction 对齐会更好一些(?)
其实我们封装代码的最终目的是为了更方便的去使用,如果增加了更多的类,却没有可读性和易用性的提升,其实类的封装反而是个累赘。没有必要完全对其,毕竟最终追求的是方便。