Ejemplo n.º 1
0
def step_impl(context):
    navi_dest = Navi().get_navi_ready_to_dest_ele()
    dest_time = Navi().get_navi_to_dest_time_ele()
    if navi_dest.wait.exists():
        navi_dest.click.wait()
        if dest_time.wait.exists(timeout=20000):
            dest_time.wait.gone(timeout=15000)
    else:
        uit.raise_Exception_info('导航到指定地址控件不存在')
Ejemplo n.º 2
0
def step_impl(context):
    compass = Navi().get_navi_Compass_ele()
    curroad = Navi().get_navi_current_road_name_ele()
    pager = Navi().get_navi_navipager_ele()
    time_indicator = Navi().get_navi_time_indicator_ele()

    if not compass.wait.exists() and curroad.wait.exists(
    ) and pager.wait.exists() and time_indicator.wait.exists():
        uit.raise_Exception_info('导航界面元素检查失败,缺少元素信息')
Ejemplo n.º 3
0
def step_impl(context):
    curroad = Navi().get_navi_current_road_name_ele()
    search = Navi().get_navi_search_ele()
    if search.wait.exists():
        search.click.wait()
    elif curroad.wait.exists():
        curroad.click()
        search.click.wait()
    else:
        uit.raise_Exception_info('导航搜索控件打开失败')
Ejemplo n.º 4
0
def step_impl(context):
    compass = Navi().get_navi_Compass_ele()
    sitelite = Navi().get_navi_satellite_ele()
    curroad = Navi().get_navi_current_road_name_ele()
    zoomseekbar = Navi().get_navi_zoomSeekBar_ele()

    if not compass.wait.exists() and sitelite.wait.exists() \
            and \
            (curroad.wait.exists() or zoomseekbar.wait.exists()):
        uit.raise_Exception_info('导航主界面元素校验失败')
Ejemplo n.º 5
0
def step_impl(context):
    addr = context.table[0]['address']
    if str(addr).startswith('o_'):
        addr = ht.get_context_map(addr)

    # 获取删除控件并点击
    del_ele = Navi().get_navi_his_fav_del_ele(addr)
    if del_ele.wait.exists():
        del_ele.click()
    # 点击完成控件 完成删除操作
    ok_ele = d(text='完成')
    if ok_ele.wait.exists():
        ok_ele.click()
Ejemplo n.º 6
0
def step_impl(context):
    # 获取目的地地址出参
    param = context.table[0]['o_result']
    ele = Navi().get_navi_ready_dest_ele()
    if ele.wait.exists():
        ht.set_context_map(param, ele.text.strip())
    else:
        uit.raise_Exception_info('导航目的地控件不存在')
Ejemplo n.º 7
0
def step_impl(context):
    title = context.table[0]['nearby_title']
    if str(title).startswith('o_'):
        title = ht.get_context_map(title)

    # 验证搜索结果的标题是否一致
    nearby_title = Navi().get_navi_nearby_title_ele()
    if nearby_title.wait.exists():
        txt = nearby_title.text.strip()
        if txt != title:
            uit.raise_Exception_info('搜索附近的XXX标题不一致,期望值为:' + title +
                                     ', 实际值是: ' + txt)
    else:
        uit.raise_Exception_info('搜索附近的XXX的标题控件不存在')

    # 验证是否有查询结果
    nearby_name = Navi().get_navi_nearby_name_ele()
    if not nearby_name.wait.exists():
        uit.raise_Exception_info('搜索附近的XXX的结果为空')
Ejemplo n.º 8
0
def step_impl(context):
    address = context.table[0]['address']
    o_result = context.table[0]['o_result']

    search_key = Navi().get_navi_search_key_ele()
    if search_key.wait.exists():
        search_key.set_text(ht.unicode_input(address))
    else:
        uit.raise_Exception_info('搜索框控件不存在')

    list_item = Navi().get_navi_search_addr_list_title()

    if list_item.wait.exists(timeout=ht.LONG_TIME_OUT):
        size = len(list_item)
        idx = random.randint(0, size - 1)
        e = list_item[idx]
        ret = e.text.strip()
        e.click.wait()
        # 返回选择的地址并存入上下文
        ht.set_context_map(o_result, ret)
    else:
        uit.raise_Exception_info('没有搜索到对应的城市')
Ejemplo n.º 9
0
def step_impl(context):
    # 获取参数信息
    addr = context.table[0]['address']
    is_faved = context.table[0]['is_faved']
    if str(addr).startswith('o_'):
        addr = ht.get_context_map(addr)

    list_view = Navi().get_navi_search_listview_ele()
    if list_view.wait.exists():
        if list_view.info['scrollable']:
            flag = list_view.scroll.vert.to(text=addr)

        else:
            ele = d(text=addr)
            flag = ele.wait.exists()

        if str(flag).lower() != is_faved.lower():
            uit.raise_Exception_info('验证是否被收藏状态不一致,期望值为:' + is_faved +
                                     ', 实际值为:' + str(flag))
    else:
        uit.raise_Exception_info('收藏列表不存在')
Ejemplo n.º 10
0
    def back_to_launcher(self):
        # 获取当前包名
        package_name = d.info['currentPackageName']

        while package_name != 'com.qinggan.app.launcher':
            if 'com.qinggan.app.carmodule.ui'.__eq__(package_name):
                pass
            elif 'com.qinggan.app.serviceui'.__eq__(package_name):
                pass
            elif 'com.qiyi.video.auto'.__eq__(package_name):
                Video().back_to_launcher()
            elif 'com.pateonavi.naviapp'.__eq__(package_name):
                Navi().back_to_launcher()
            elif 'com.qinggan.app.music'.__eq__(package_name):
                Audio().back_to_launcher()
            elif 'cn.kuwo.kwmusiccar'.__eq__(package_name):
                Audio().back_from_kuwo()
            elif 'com.qinggan.app.radio'.__eq__(package_name):
                Radio().back_to_launcher()
            elif 'com.qinggan.app.qplay'.__eq__(package_name):
                Qplay().back_to_launcher()
            elif 'com.qinggan.app.setting'.__eq__(package_name):
                SysSetting().back_to_launcher()
            elif 'com.qinggan.app.ivokaUI'.__eq__(package_name):
                time.sleep(10)
            elif 'com.qinggan.app.gesture'.__eq__(package_name):
                Gesture().back_to_launcher()
            else:
                if uit.crash_handler():
                    print('回到主界面有CRASH')
                else:
                    uit.raise_Exception_info('应用停留界面没有返回主界面处理,请联系维护人员添加')
                    break

            package_name = d.info['currentPackageName']
        # 在主界面
        Launcher().back_to_main()
        # 升级后取消修复
        d.click(1150, 80)
        time.sleep(2)
Ejemplo n.º 11
0
def step_impl(context):
    addr = context.table[0]['address']
    if str(addr).startswith('o_'):
        addr = ht.get_context_map(addr)

    list_view = Navi().get_navi_search_listview_ele()
    if list_view.wait.exists():
        if list_view.info['scrollable']:
            flag = list_view.scroll.vert.to(text=addr)
            if flag:
                ele = d(text=addr)
                if ele.wait.exists():
                    ele.click.wait()
                else:
                    uit.raise_Exception_info('指定收藏地址不存在')
            else:
                uit.raise_Exception_info('指定收藏地址不存在')
        else:
            ele = d(text=addr)
            if ele.wait.exists():
                ele.click.wait()
    else:
        uit.raise_Exception_info('收藏列表不存在')
Ejemplo n.º 12
0
def step_impl(context):
    city_name = context.table[0]['city_name']

    city_search = Navi().get_navi_search_city_bar_ele()
    # 点击城市控件
    if city_search.wait.exists():
        city_search.click.wait()
    else:
        uit.raise_Exception_info('搜索城市控件不存在')

    search_key = Navi().get_navi_search_key_ele()
    if search_key.wait.exists():
        search_key.set_text(ht.unicode_input(city_name))
    else:
        uit.raise_Exception_info('搜索框控件不存在')
    # 搜索列表
    list_item = Navi().get_navi_search_city_list_item()
    if list_item.wait.exists(timeout=ht.LONG_TIME_OUT):
        for e in list_item:
            if e.text.strip() == city_name:
                e.click.wait()
                break
    else:
        uit.raise_Exception_info('没有搜索到对应的城市')
Ejemplo n.º 13
0
def step_impl(context):
    fav_ele = Navi().get_navi_search_fav_ele()
    if fav_ele.wait.exists():
        fav_ele.click.wait()
    else:
        uit.raise_Exception_info('收藏控件不可见')
Ejemplo n.º 14
0
def step_impl(context):
    fav_ele = Navi().get_navi_ready_dest_fav_ele()
    if fav_ele.wait.exists():
        fav_ele.click()
    else:
        uit.raise_Exception_info('地址收藏控件不可见')
Ejemplo n.º 15
0
def step_impl(context):
    Navi().chk_navi_is_home()