-
Notifications
You must be signed in to change notification settings - Fork 275
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: support w3c actions and velocity swipe #160
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
need a little update
Also documented |
Added support for |
今天早上review了一下,在想是否真的需要这么多的类(TouchTap, TouchLongPress,TouchPress,TouchMovement,FingerMovement) 我构思了一下,下面的方法是否可行呢。去掉这些类,直接把值传过去。功能效果一样,代码确更少了。 FingerAction().move(x, y).down.pause(0.1).up()
TouchActions().press(x, y, pressure=1).pause(.1).up() # 补充疑问,为什这里是.. Actions,而上面是..Action |
need a little update |
不愧是蓝哥, 这么优雅 |
确实在类的实现上面是有些冗余和重复了,下周 update 下 另,TouchActions 其实是为了对齐 W3CActions 的命名,不过 W3CActions 是多个 Actions 的并集,TouchAction 应该只对应一个滑动操作,这里应该确实是和 FingerAction 对齐会更好一些(?) |
其实我们封装代码的最终目的是为了更方便的去使用,如果增加了更多的类,却没有可读性和易用性的提升,其实类的封装反而是个累赘。没有必要完全对其,毕竟最终追求的是方便。 |
Returns: | ||
Self for method chaining | ||
""" | ||
if second < 0: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这段是有有必要,直接second<0抛出ValueError是否更好
def swipe_with_velocity(self, x1: Union[int, float], y1: Union[int, float], x2: Union[int, float], y2: Union[int, float], | ||
press_duration: float, hold_duration: float, velocity: float): | ||
""" | ||
Press down and drag with velocity, appium forked version of wda only |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
最好注明一下appium wda开始支持的版本
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
/actions
endpoint/wda/pressAndDragWithVelocity
endpoint