Giter Club home page Giter Club logo

Comments (8)

adolli avatar adolli commented on May 3, 2024 2

目前还没有这种组合,下一个大版本会加上MotionEvent. 到时就可以自定义手势了

from airtest.

NateRiverNaz avatar NateRiverNaz commented on May 3, 2024

好的 谢谢!

from airtest.

Meteorix avatar Meteorix commented on May 3, 2024

@NateRiverNaz 你好,目前版本已经提供了MotionEvent,可以自己拼装任意操作

https://github.com/AirtestProject/Airtest/blob/master/playground/android_motionevents.py

from airtest.

sosocgx avatar sosocgx commented on May 3, 2024

@Meteorix
你好, 根据您的写了例子改了一下,变成简单的按住并拖拽指定位置的图标到指定位置的实验

from airtest.core.api import *
from airtest.core.android.minitouch import *
connect_device("Android:///")
swipe_event = [DownEvent((500, 500)), SleepEvent(1),MoveEvent((0, 0)),UpEvent(0)]
device().minitouch.perform(swipe_event)

我的问题是:
1.具体DownEvent, SleepEvent,MoveEvent 的相关API文档,我想要实现比如传入name,TextMatches 之类的.
2.哪些event可以组合成motionevent?
2.完成图标的按住并拖拽后,手机坐标还是处于图标位置调整的状态,需要按home键。这种需要触发系统事件的,应该怎么调用?

thanks in advanced!!

from airtest.

Meteorix avatar Meteorix commented on May 3, 2024
  1. 暂时还没写MotionEvent的文档,直接看看代码把,很简单的。Poco与MotionEvent的集成可能要稍等 @adolli 会更新
  2. 同样,看看代码
    class MotionEvent(object):
  3. 直接 home(),这些主要的API可以看API文档

from airtest.

adolli avatar adolli commented on May 3, 2024

如果使用poco的话,可以用以下简单写法,实现将一个图标拖拽到另一个图标上面

telephone = poco(text='电话')
folder = poco(text='文件夹')
telephone.start_gesture().hold(1).to(folder).hold(1).up()  # 最后面的up别忘了,hold时长根据实际情况调节

from airtest.

IcyW avatar IcyW commented on May 3, 2024

@Meteorix
同请问长按并拖动至指定位置的操作。
请问MotionEvent的文档写了吗~?

from airtest.

yimelia avatar yimelia commented on May 3, 2024

@IcyW
可以参考这个文档以及仓库里的playground里的相关代码:
http://airtest.netease.com/docs/cn/9_faq/3_api_faq.html#id15

from airtest.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.