Beispiel #1
0
def step_impl(context):
    #获取参数信息
    param = context.table[0]['o_result']
    Radio().click_radio_selector_fm_ele()

    fm_no = Radio().click_radio_selector_fm_random_ele()
    #存入上下文变量
    ht.set_context_map(param, fm_no)
Beispiel #2
0
def step_impl(context):
    #获取参数信息
    param = context.table[0]['o_result']
    # 点击精选电台
    Radio().click_radio_qt_category_ele()
    #点击栏目
    title = Radio().click_radio_qt_category_title_ele()
    # 保存到上下文变量中
    ht.set_context_map(param, title)
Beispiel #3
0
def step_impl(context):
    #     获取出参
    param = context.table[0]['o_result']
    # 点击预览电台控件
    Radio().click_radio_preview_ele()
    #判断当前是否在刷新
    # fm_no = Radio().get_radio_no_playing_txt()
    #等待8s
    time.sleep(8)
    #点击预览控件停止预览
    Radio().click_radio_preview_ele()
    fm_no2 = Radio().get_radio_no_playing_txt()
    #存放选中电台
    ht.set_context_map(param, fm_no2)
Beispiel #4
0
def step_impl(context):
    #获取参数信息
    param = context.table[0]['o_result']

    name = Radio().click_radio_qt_category_list_name_random_ele()
    # 保存到上下文变量中
    ht.set_context_map(param, name)
Beispiel #5
0
def step_impl(context):
    # 获取第一个参数
    param = context.table[0]['chk_fm_no']
    if str(param).startswith('o_'):
        chk_fm_no = ht.get_context_map(param)
    else:
        chk_fm_no = param
    # 获取第二个参数
    chk_is_faved = context.table[0]['chk_is_faved']
    # 切换到fm_tab页
    Radio().click_radio_selector_fm_ele()
    #查询是否被收藏
    is_faved = Radio().get_radio_selector_fm_is_faved_by_no(chk_fm_no)

    if not str(is_faved).lower().__eq__(str(chk_is_faved).lower()):
        uit.raise_Exception_info('验证指定FM《' + chk_fm_no + '》 是否被收藏失败')
Beispiel #6
0
def step_impl(context):
    # 获取参数
    param = context.table[0]['o_result']
    fm_no = Radio().click_radio_search_list_title_random_ele()
    if str(fm_no).startswith('FM') or str(fm_no).startswith('AM'):
        ht.set_context_map(param, fm_no[2:])
    else:
        ht.set_context_map(param, fm_no)
Beispiel #7
0
def step_impl(context):
    # 获取参数
    chk_is_playing = context.table[0]['chk_is_playing']
    # 获取当前播放状态
    time.sleep(2)
    is_playing = Radio().get_radio_is_playing()
    if not str(chk_is_playing).lower().__eq__(str(is_playing).lower()):
        uit.raise_Exception_info('电台播放状态不一致')
Beispiel #8
0
def step_impl(context):
    # 获取参数内容
    chk_key_word = context.table[0]['chk_key_word']
    # 获取当前输入框内容
    key_word = Radio().get_radio_search_keyword_txt()
    #     校验是否相同
    if chk_key_word != key_word:
        uit.raise_Exception_info('输入框内容不一致,期望值为《' + chk_key_word + '》, 实际值为《' +
                                 key_word + '》')
Beispiel #9
0
def step_impl(context):
    #获取参数--蜻蜓FM栏目名称
    param1 = context.table[0]['chk_qt_title']
    param2 = context.table[0]['chk_is_faved']
    if str(param1).startswith('o_'):
        chk_qt_title = ht.get_context_map(param1)
    else:
        chk_qt_title = param1
    #获取是否被收藏
    if str(param2).startswith('o_'):
        chk_is_faved = ht.get_context_map(param2)
    else:
        chk_is_faved = param2
    # 获取收藏记录
    Radio().click_radio_qt_collected_ele()
    is_faved = Radio().get_radio_qt_collected_title_is_exists(chk_qt_title)
    # 验证是否被收藏
    if not str(is_faved).lower().__eq__(str(chk_is_faved).lower()):
        uit.raise_Exception_info('验证蜻蜓FM是否被收藏失败')
Beispiel #10
0
def step_impl(context):
    # 获取参数
    param = context.table[0]['o_result']

    context.execute_steps('''
    当< 点击听歌识曲
    ''')
    name = Radio().click_radio_ide_audio()
    #保存歌曲名到上下文
    ht.set_context_map(param, name)
Beispiel #11
0
def step_impl(context):
    #获取参数
    param = context.table[0]['chk_qt_name']
    if str(param).startswith('o_'):
        chk_qt_name = ht.get_context_map(param)
    else:
        chk_qt_name = param
    #获取最近收听数据
    ele = Radio().get_radio_qt_latest_name_ele()
    #校验第一个应该为最近收听内容
    size = len(ele)
    if size > 0:
        qt_name = ele[0].text.strip()
        if chk_qt_name != qt_name:
            uit.raise_Exception_info('验证最近收听记录失败,期望值为《' + chk_qt_name +
                                     '》,实际值为《' + qt_name + '》')
        else:
            Radio().hide_radio_qt_drawer_ele()
    else:
        uit.raise_Exception_info('最近收听记录为空')
Beispiel #12
0
def step_impl(context):
    # 获取参数
    param = context.table[0]['chk_name']
    if str(param).startswith('o_'):
        chk_name = ht.get_context_map(param)
    else:
        chk_name = param
        # 获取当前播放的节目 名称
        name = Radio().get_radio_name_playing_txt()
    if chk_name == name:
        uit.raise_Exception_info('正在播放的FM节目名称不一致,期望值不应该为《' + chk_name +
                                 '》,实际值为《' + name + '》')
Beispiel #13
0
def step_impl(context):
    # 获取参数
    param = context.table[0]['chk_fm_no']
    if str(param).startswith('o_'):
        chk_fm_no = ht.get_context_map(param)
    else:
        chk_fm_no = param

    fm_no = Radio().get_radio_no_playing_txt()
    if fm_no == chk_fm_no:
        uit.raise_Exception_info('收音机编号不一致,期望值不应该为《' + chk_fm_no + '》,实际值为《' +
                                 fm_no + '》')
Beispiel #14
0
def step_impl(context):
    #获取参数
    param = context.table[0]['chk_qt_title']
    if str(param).startswith('o_'):
        chk_qt_title = ht.get_context_map(param)
    else:
        chk_qt_title = param
    # 获取当前的标题
    qt_title = Radio().get_radio_qt_title_playing_txt()

    if chk_qt_title != qt_title:
        uit.raise_Exception_info('正在播放的蜻蜓FM栏目标题不一致,期望值为《' + chk_qt_title +
                                 '》,实际值为《' + qt_title + '》')
Beispiel #15
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)
Beispiel #16
0
def step_impl(context):
    Radio().click_radio_fav_or_cancel_ele()
Beispiel #17
0
def step_impl(context):
    Radio().click_radio_qt_fav_ele()
Beispiel #18
0
def step_impl(context):
    Radio().click_radio_next_ele()
Beispiel #19
0
def step_impl(context):

    Radio().click_radio_selector_fm_faved()
Beispiel #20
0
def step_impl(context):
    # 获取参数信息
    key_word = context.table[0]['key_word']
    Radio().input_radio_search_keyword_ele(key_word)
Beispiel #21
0
def step_impl(context):
    Radio().click_radio_prev_ele()
Beispiel #22
0
def step_impl(context):
    Radio().chk_radio_is_home_page()
Beispiel #23
0
def step_impl(context):
    #获取参数
    param = context.table[0]['o_result']
    value = Radio().click_radio_list_his_name_random_ele()
    # 保存到上下文变量
    ht.set_context_map(param, value)
Beispiel #24
0
def step_impl(context):
    #获取对象
    Radio().scroll_radio_weitiao_ele()
Beispiel #25
0
def step_impl(context):
    if not Radio().get_radio_ide_status():
        uit.raise_Exception_info('听歌识曲验证失败,未识别到歌曲')
Beispiel #26
0
def step_impl(context):
    Radio().click_radio_search_cancel_ele()
Beispiel #27
0
def step_impl(context):
    Radio().click_radio_pause_or_play_ele()
Beispiel #28
0
def step_impl(context):
    #获取出参
    o_title_faved = context.table[0]['o_result']
    title_faved = Radio().click_radio_qt_collected_title_ele()
    #     存入上下文变量
    ht.set_context_map(o_title_faved, title_faved)
Beispiel #29
0
def step_impl(context):
    fm_no = context.table[0]['fm_no']
    Radio().click_radio_selector_fm_ele()
    Radio().click_radio_selector_fm_by_no_ele(fm_no)
Beispiel #30
0
def step_impl(context):
    # 点击fm标签页
    Radio().click_radio_selector_ele()