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)
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)
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('电台播放状态不一致')
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)
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 + '》')
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是否被收藏失败')
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('最近收听记录为空')
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 + '》')
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 + '》')
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)
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)
def step_impl(context): Radio().click_radio_pause_or_play_ele()
def step_impl(context): Radio().click_radio_qt_fav_ele()
def step_impl(context): Radio().click_radio_selector_fm_faved()
def step_impl(context): # 获取参数信息 key_word = context.table[0]['key_word'] Radio().input_radio_search_keyword_ele(key_word)
def step_impl(context): Radio().chk_radio_is_home_page()
def step_impl(context): Radio().click_radio_search_cancel_ele()
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)
def step_impl(context): # 点击fm标签页 Radio().click_radio_selector_ele()