Esempio n. 1
0
def step_impl(context):
    """
    点击屏幕中央位置,如播放视频界面,图片全屏界面
    :param context:
    :return:
    """
    d.click(d_width / 2, d_height / 2)
Esempio n. 2
0
def step_impl(context):
    ele = music.get_music_mylove_btn()
    if ele.wait.exists():
        x_coordinate, y_coordinate = uit.get_clickcoord_by_ele(ele)
        d.click(x_coordinate, y_coordinate)
    else:
        uit.raise_Exception_info('最爱音乐按钮不存在')
Esempio n. 3
0
def step_impl(context):
    # 获取专辑名称
    artist_name = context.table[0]['artist_name']

    ele = music.get_artist_from_artist_list_by_artist_name(artist_name)
    if ele.wait.exists():
        x_coordinate, y_coordinate = uit.get_clickcoord_by_ele(ele)
        d.click(x_coordinate, y_coordinate)
    else:
        uit.raise_Exception_info('指定歌手不存在')
Esempio n. 4
0
def step_impl(context):
    # 获取音乐名称
    music_name = context.table[0]['music_name']

    ele = music.get_music_from_collect_list_by_music_name(music_name)
    if ele.wait.exists():
        x_coordinate, y_coordinate = uit.get_clickcoord_by_ele(ele)
        d.click(x_coordinate, y_coordinate)
    else:
        uit.raise_Exception_info('指定音乐不存在')
Esempio n. 5
0
 def click_bottom_app(self, text):
     '''
     点击底部控制栏各个应用
     :param text: 应用名称,eg“导航”
     :return:
     '''
     if text.strip() in Bottom_App_Coord.keys():
         x, y = Bottom_App_Coord[text]
         d.click(x, y)
     else:
         uit.raise_Exception_info("输入的底部应用未找到")
Esempio n. 6
0
def step_impl(context):
    """
    点击主页底部五个应用
    :param context:
    :return:
    """
    app_name = context.table[0]['app_name']
    if app_name in HOME_APP_COORD.keys():
        x, y = HOME_APP_COORD.get(app_name)
        d.click(x, y)
    else:
        uit.raise_Exception_info('指定应用名称不存在')
Esempio n. 7
0
def step_impl(context):
    """
    点击拨号键盘
    :param context:
    :return:
    """
    dial_ele = btphone.get_phone_dial_tab_ele()
    if dial_ele.wait.exists():
        pos_x, pos_y = uit.get_clickcoord_by_ele(dial_ele)
        d.click(pos_x, pos_y)
    else:
        uit.raise_Exception_info('拨号键盘控件不存在')
Esempio n. 8
0
def step_impl(context):
    """
    点击最近通话
    :param context:
    :return:
    """
    calllog_ele = btphone.get_phone_calllog_tab_ele()
    if calllog_ele.wait.exists():
        pos_x, pos_y = uit.get_clickcoord_by_ele(calllog_ele)
        d.click(pos_x, pos_y)
    else:
        uit.raise_Exception_info('最近通话控件不存在')
Esempio n. 9
0
def step_impl(context):
    """
    点击通讯录
    :param context:
    :return:
    """
    contacts_ele = btphone.get_phone_contacts_tab_ele()
    if contacts_ele.wait.exists():
        pos_x, pos_y = uit.get_clickcoord_by_ele(contacts_ele)
        d.click(pos_x, pos_y)
    else:
        uit.raise_Exception_info('通讯录控件不存在')
Esempio n. 10
0
def step_impl(context):
    """
    点击通讯录中指定联系人
    :param context:
    :return:
    """
    # 获取联系人名称
    name = context.table[0]['contact']
    contact_ele = btphone.get_phone_contact_by_name(name)
    if contact_ele.wait.exists():
        pos_x, pos_y = uit.get_clickcoord_by_ele(contact_ele)
        d.click(pos_x, pos_y)
    else:
        uit.raise_Exception_info('指定联系人在通讯录中不存在')
Esempio n. 11
0
def step_impl(context):
    """
    点击图片文件, 图片文件带有后缀
    :param context:
    :return:
    """
    # 获取图片文件名参数
    photo_name = context.table[0]['photo_name']
    photo_ele = photo.get_photo_by_name(photo_name)

    if photo_ele.wait.exists():
        pos_x, pos_y = uit.get_clickcoord_by_ele(photo_ele)
        d.click(pos_x, pos_y)
    else:
        uit.raise_Exception_info('指定图片文件不存在')
Esempio n. 12
0
def step_impl(context):
    """
    点击图片文件夹 文件夹名称不包含图片数量
    :param context:
    :return:
    """
    # 获取文件夹名称
    folder_name = context.table[0]['folder_name']
    folder_ele = photo.get_photo_folder_by_name(folder_name)

    if folder_ele.wait.exists():
        pos_x, pos_y = uit.get_clickcoord_by_ele(folder_ele)
        d.click(pos_x, pos_y)
    else:
        uit.raise_Exception_info('指定文件夹不存在')
Esempio n. 13
0
 def execute_radio_FM_prev(self):
     '''
     收音机下一台点击坐标,注意使用
     :return: 点击动作完成
     '''
     # x, y = uit.get_clickcoord_from_bounds(resourceId='com.pateo.radio:id/new_frequency_iv_sub')
     return d.click(250, 414)
Esempio n. 14
0
 def execute_radio_FM_playorpause(self):
     '''
     收音机播放与暂停点击坐标的动作,注意使用
     :return: 点击动作完成
     '''
     x, y = uit.get_clickcoord_from_bounds(
         resourceId='com.pateo.radio:id/new_frequency_iv')
     return d.click(x, y)
Esempio n. 15
0
def step_impl(context):
    # 获取应用名称
    app_name = context.table[0]['app_name']
    print(app_name)

    if app_name == '收音机':
        radio_ele = home.get_home_radio_layout()
        if radio_ele.wait.exists():
            radio_ele.click()
        else:
            uit.raise_Exception_info('收音机控件没有找到')
    elif app_name == '音乐':
        music_ele = home.get_home_music_layout()
        if music_ele.wait.exists():
            pos_x, pos_y = uit.get_clickcoord_by_ele(music_ele)
            d.click(pos_x, pos_y)
        else:
            uit.raise_Exception_info('音乐控件没有找到')
    else:
        x_coordinate, y_coordinate = uit.get_clickcoord_from_bounds(text=app_name)
        d.click(x_coordinate, y_coordinate)
Esempio n. 16
0
def step_impl(context):
    x_coordinate, y_coordinate = music.get_music_play_pause_coordinate()
    d.click(x_coordinate, y_coordinate)