def step_impl(context): ele = music.get_music_prev_btn() cur_time = music.get_music_cur_time_ele() cur_music_name = music.get_music_name_ele() if ele.wait.exists(): # 获取当前时间秒数 before_time = cur_time.text.strip().split(':') before_seconds = int(before_time[0]) * 60 + int(before_time[1]) before_music_name = cur_music_name.text.strip() bounds = ele.info['bounds'] x = (bounds['left'] + bounds['right']) / 2 y = (bounds['bottom'] + bounds['top']) / 2 # 长按上一首按钮 d.swipe(x, y, x, y, 50) #获取快进后的时间 time_ele = music.get_music_cur_time_ele() music_name_ele = music.get_music_name_ele() after_time = time_ele.text.strip().split(':') after_seconds = int(after_time[0]) * 60 + int(after_time[1]) after_music_name = music_name_ele.text.strip() if before_seconds - after_seconds > 5 and before_music_name == after_music_name: pass else: uit.raise_Exception_info('快退异常') else: uit.raise_Exception_info('快退按钮不存在')
def step_impl(context): """ 滑动展示通讯录搜索框 :param context: :return: """ d.swipe(d_width / 2, d_height / 2, d_width / 2, d_height / 6 * 5, 20)
def step_impl(context): screen_num = int(context.table[0]['number']) # 判断是否在第一屏 while not d(text='媒体').wait.exists(): d.swipe(0, d_height / 2, d_width, d_height / 2, 20) for i in range(screen_num - 1): d.swipe(d_width / 6 * 5, d_height / 2, 0, d_height / 2, 20) time.sleep(2)
def back_to_launcher(self): ''' 回到主界面 :desription: 根据当前报名判断回到主界面的方法,然后调用相应方法回到主界面 :return: ''' d.press.home() # 判断是否在第一屏 while not d(text='媒体').wait.exists(): d.swipe(0, d_height / 2, d_width, d_height / 2, 20)
def step_impl(context): d.swipe(d_width / 2, 100, d_width / 2, d_height / 2, 10)
def step_impl(context): d.swipe(d_width / 6, d_height / 2, d_width / 6 * 5, d_height / 2, 20)
def step_impl(context): d.swipe(d_width / 2, d_height, d_width / 2, 0, 20)