当前位置: 首页>>代码示例>>Python>>正文


Python myDevice.d函数代码示例

本文整理汇总了Python中uiautomator.myDevice.d函数的典型用法代码示例。如果您正苦于以下问题:Python d函数的具体用法?Python d怎么用?Python d使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了d函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: delete_img

def delete_img():
    try:
        d(resourceId="com.hicamapp:id/bt_controllet").click.wait()
        d(resourceId="com.hicamapp:id/btn_media").click.wait()
        d(className="android.widget.RelativeLayout",index=0).child(resourceId="com.hicamapp:id/img_thumb",index=0).long_click()
        d(resourceId="com.hicamapp:id/text_media_select_all").click.wait()
        d(resourceId="com.hicamapp:id/btn_media_delete").click.wait()
        #confir button:d(text="OK").click.wait()
        d.click(540, 1684)
        d.wait.update()
    except Exception as e:
        print e
开发者ID:michael-7845,项目名称:android-lettuce,代码行数:12,代码来源:connect.py

示例2: take_picture

def take_picture(times):
    try:
        #enter controller
        d(resourceId="com.hicamapp:id/bt_controllet").click.wait()
        #create test picture
        d(resourceId="com.hicamapp:id/btn_mode").click.wait()
        d.click(904,1380)
        d.wait.update()
        i = 0
        while i < times:
            d(resourceId="resourceId=com.hicamapp:id/btn_operate_start").click.wait()
            i += 1
    except Exception as e:
        print e
开发者ID:michael-7845,项目名称:android-lettuce,代码行数:14,代码来源:connect.py

示例3: before_clear_message

def before_clear_message(scenario):
   # adding the operation before <each scenario> of <this feature>
    print "@before scenario"
    d.press("back")  
    d.press("back")
    d.press("back")
    d.press("home")
    try:
        ex.start_activity("com.android.mms/com.android.mms.ui.ConversationList")
        if d(text="无会话").exists:
            return None 
        d.press("menu")
        d(text="删除所有会话").click.wait()
        if d(text="将会删除所有会话。").exists:
            #d(text="删除").click.wait()不执行
            d(resourceId="android:id/button1").click.wait()
        assert not d(text="无会话").exists
    except:
        None
开发者ID:michael-7845,项目名称:android-lettuce,代码行数:19,代码来源:messaging_callback.py

示例4: long_click_right

def long_click_right(step, reference, cond):
    ref = get_dict_from_cond(reference)
    my = get_dict_from_cond(cond)
    d(**ref).right(**my).long_click()
    d.wait.update()
开发者ID:michael-7845,项目名称:android-lettuce,代码行数:5,代码来源:longclick.py

示例5: long_click_child

def long_click_child(step, cond, childcond):
    father = get_dict_from_cond(cond)
    child = get_dict_from_cond(childcond)
    d(**father).child(**child).long_click()
    d.wait.update()
开发者ID:michael-7845,项目名称:android-lettuce,代码行数:5,代码来源:longclick.py

示例6: long_click_left_br

def long_click_left_br(step, reference, cond):
    ref = get_dict_from_cond(reference)
    my = get_dict_from_cond(cond)
    d(**ref).left(**my).long_click.bottomright()
    d.wait.update()
开发者ID:michael-7845,项目名称:android-lettuce,代码行数:5,代码来源:longclick.py

示例7: long_click_down_tl

def long_click_down_tl(step, reference, cond):
    ref = get_dict_from_cond(reference)
    my = get_dict_from_cond(cond)
    d(**ref).down(**my).long_click.topleft()
    d.wait.update()
开发者ID:michael-7845,项目名称:android-lettuce,代码行数:5,代码来源:longclick.py

示例8: long_click_child_by_desc

def long_click_child_by_desc(step, scrollcond, cond, desc):
    scroll = get_dict_from_cond(scrollcond)
    my = get_dict_from_cond(cond)
    d(**scroll).child_by_description(desc,allow_scroll_search=True,**my).long_click()
    d.wait.update()
开发者ID:michael-7845,项目名称:android-lettuce,代码行数:5,代码来源:longclick.py

示例9: click_child_by_inst

def click_child_by_inst(step, framecond, trait):
    frame = get_dict_from_cond(framecond)
    d(**frame).child_by_instance(trait,instance=trait).long_click()
    d.wait.update()
开发者ID:michael-7845,项目名称:android-lettuce,代码行数:4,代码来源:longclick.py

示例10: dragObjTo

def dragObjTo(step, cond, x, y):
    d(description=cond).drag.to(x,y)
    d.wait.idle()
开发者ID:michael-7845,项目名称:android-lettuce,代码行数:3,代码来源:drag.py

示例11: dragObjToObj

def dragObjToObj(step, cond, cond1):
    obj = get_dict_from_cond(cond)
    obj1 = get_dict_from_cond(cond1)
    d(**obj).drag.to(**obj1)
    d.wait.idle()
开发者ID:michael-7845,项目名称:android-lettuce,代码行数:5,代码来源:drag.py

示例12: dragObjToByStep

def dragObjToByStep(step, steps, cond, x, y):
    obj = get_dict_from_cond(cond)
    d(**obj).drag.to(x,y,steps)  
    d.wait.idle()    
开发者ID:michael-7845,项目名称:android-lettuce,代码行数:4,代码来源:drag.py

示例13: before_reset

def before_reset(feature):
    d.press("back")  
    d.press("back")
    d.press("back")
    d.press("home")
    try:
        #reset screen locked
        ex.start_activity("com.android.settings/.Settings")
        d(className="android.widget.ListView").scroll.vert.to(text="安全")
        d(text="安全").click.wait()
        if d(text="滑动").exists:
            d.press("back")
        else:
            d(text="屏幕锁定").click.wait()
            d(text="滑动").click.wait()
            #assert not d(text="滑动").exists(timeout=3000)
            d.press("back")  
        
        #reset schedule power
        d(className="android.widget.ListView").scroll.vert.to(text="定时开关机")
        d(text="定时开关机").click.wait()
        
        if d(className="android.widget.ListView").child(className="android.widget.LinearLayout",index=0).child(className="android.widget.CheckBox",checked=False).exists:
            d.press("back")
        else:
            d(text="07:00").right(className="android.widget.CheckBox").click.wait()
            d.press("back")  
        
        #reset auto-rotate screen
        d(className="android.widget.ListView").scroll.vert.to(text="显示")
        d(text="显示").click.wait()
        if d(className="className=android.widget.LinearLayout",index=7).child(className="android.widget.CheckBox",checked=False).exists:
            d.press("back")  
        else:
            d(text="自动旋转屏幕").right(className="android.widget.CheckBox").click.wait()
            d.press("back")  
    except Exception as e:
        print e
开发者ID:michael-7845,项目名称:android-lettuce,代码行数:38,代码来源:settings_callback.py

示例14: click_child_by_text

def click_child_by_text(step, scrollcond, trait):
    scroll = get_dict_from_cond(scrollcond)
    d(**scroll).child_by_text(trait,allow_scroll_search=True,textContains=trait).click.wait()
开发者ID:michael-7845,项目名称:android-lettuce,代码行数:3,代码来源:click.py

示例15: connect_hicam

def connect_hicam(DeviceName):
    #connect hicam
    d(resourceId="com.hicamapp:id/text_wifi").click.wait()
    d(resourceId="com.hicamapp:id/list").scroll.vert.to(text=DeviceName)
    d(text="Devices").wait.exists(timeout=5000)
    d(text=DeviceName).click.wait()
    d(resourceId="com.hicamapp:id/list").child(className="android.widget.RelativeLayout",index=0).click.wait()
    d(text="Devices").wait.gone(timeout=5000)  
开发者ID:michael-7845,项目名称:android-lettuce,代码行数:8,代码来源:1-3_callback.py


注:本文中的uiautomator.myDevice.d函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。