def material_theme_change(self, themelist='热门', theme='落日飞车', text=True): """ :param themeList: 主题分类 :param theme: 主题名称 :param text: 是否带有字幕 :return: """ log.i('从素材中心切换到%s主题分类' % themelist) self.d(resourceId="com.quvideo.xiaoying:id/tvTitle", text=themelist).click() log.i('点击%s主题' % theme) if self.d(resourceId="com.quvideo.xiaoying:id/tvTitle", text=theme).wait(timeout=1): el = self.d(resourceId="com.quvideo.xiaoying:id/tvTitle", text=theme) else: el = self.find_element_by_swipe_up( self.d(resourceId="com.quvideo.xiaoying:id/tvTitle", text=theme)) el.click() time.sleep(0.5) self.select_material_use('主题') time.sleep(3) self.screenshot() if text: edit.edit_page().stop_video_play() self.d(resourceId="com.quvideo.xiaoying:id/item_title", text=theme).click() self.screenshot() else: pass
def test_03_background_change(self): """使用其他背景""" material.material_page().common_change("纯色") material.material_page().use_all_clips(all=True) time.sleep(2) self.screenshot() edit.edit_page().edit_back("保存并退出")
def test_03_font_change(self): """下载并使用字体""" edit.edit_page().edit_font_enter() edit.edit_page().edit_font_use() time.sleep(3) self.d.click(0.5,0.5) self.screenshot()
def test_03_transition_change(self): """使用其他转场""" material.material_page().common_change("经典") material.material_page().use_all_clips(all=True) time.sleep(2) self.screenshot() edit.edit_page().edit_back("保存并退出")
def test_03_effectFilter_change(self): """使用其他特效滤镜""" material.material_page().common_change("分屏") material.material_page().use_all_clips(all=True) time.sleep(2) self.screenshot() edit.edit_page().edit_back("保存并退出")
def test_03_filter_change(self): """使用其他调色滤镜""" material.material_page().common_change("去旅行") material.material_page().use_all_clips(all=False) time.sleep(2) self.screenshot() edit.edit_page().edit_back("保存并退出")
def test_03_sec_fun_mosaic(self): """马赛克跳转""" time.sleep(0.5) home.home_Page().click_sec_Mosaic() gallery.gallery_page().gallery_clip_add(3) time.sleep(0.5) self.assertTrue(edit.edit_page().is_maosaic_page()) self.screenshot() self.d.press("back") edit.edit_page().edit_back("直接退出")
def test_01_sec_fun_addText(self): """加字幕跳转""" self.watch_device("取消") home.home_Page().click_sec_addText() gallery.gallery_page().gallery_clip_add(3) time.sleep(0.5) self.assertTrue(edit.edit_page().is_addText_page()) self.screenshot() edit.edit_page().edit_back("保存并退出") self.unwatch_device()
def trim_swipe_new(self): log.i('左右滑动trim及微调trim,只有初次进入才能操作成功(trimbar无法定位)') log.i('original clip time is:%s 秒' % self.get_trim_time()) trim = self.d(resourceId="com.quvideo.xiaoying:id/ve_gallery").info['bounds'] unit = int(trim["right"] - trim["left"]) / 7 y = int(trim["top"] + (trim["bottom"] - trim["top"]) / 2) self.d.swipe(int(trim["left"]) + unit / 4, y, int(trim["left"]) + 3 * unit, y, duration=0.1) log.i('after left_trim swipe clip time is:%s 秒' % self.get_trim_time()) edit.edit_page().preview_swipe_left() log.i(self.get_trim_time()) self.d.swipe(int(trim["right"]) - unit / 4, y, int(trim["right"]) - 3 * unit, y, duration=0.1) log.i('after right_trim swipe time is:%s 秒' % self.get_trim_time()) edit.edit_page().preview_swipe_right() log.i(self.get_trim_time())
def test_02_theme_use(self): """查看并使用主题""" self.watch_device("我知道了|取消") material.material_page().click_material_cover() material.material_page().select_material_use("主题") time.sleep(1) self.assertTrue(gallery.gallery_page().is_gallery_page()) self.screenshot() gallery.gallery_page().gallery_clip_add(3) time.sleep(1) self.assertTrue(edit.edit_page().is_preview_page()) self.screenshot() edit.edit_page().close_pop_dialog() self.unwatch_device()
def test_02_sec_fun_mixer(self): """画中画跳转""" home.home_Page().click_sec_Mixer() time.sleep(0.5) self.assertTrue(edit.edit_page().is_mixer_page()) self.screenshot() self.d.press("back") home.home_Page().close_ad_popup()
def test_06_sec_fun_musicExtraction(self): """音频提取跳转""" home.home_Page().click_sec_musicExtraction() gallery.gallery_page().gallery_clip_add(1) time.sleep(0.5) self.assertTrue(edit.edit_page().is_musicExitraction_page()) self.screenshot() self.d.press("back") gallery.gallery_page().gallery_back()
def test_02_text_use(self): """查看并使用字幕""" material.material_page().click_material_cover() material.material_page().select_material_use("字幕") time.sleep(1) self.assertTrue(gallery.gallery_page().is_gallery_page()) self.screenshot() gallery.gallery_page().gallery_clip_add(3) time.sleep(1) self.assertTrue(edit.edit_page().is_addText_page()) self.screenshot()
def test_03_text_input(self): """输入字幕文本""" edit.edit_page().text_input("测试字幕文本输入") edit.edit_page().edit_finish() time.sleep(2) self.screenshot() # edit.edit_page().stop_video_play() edit.edit_page().edit_back("直接退出")
def test_04_text_change(self): """使用其他字幕样式""" self.d.app_start( package_name=pkg_name, activity='com.quvideo.xiaoying.templatex.ui.TemplateCenterActivity' ) # home.home_Page().click_home_more() material.material_page().select_material_type("字幕") material.material_page().text_change('动态') gallery.gallery_page().gallery_clip_add(3) time.sleep(1) self.assertTrue(edit.edit_page().is_addText_page()) self.screenshot() edit.edit_page().text_input("动态字幕文本输入") edit.edit_page().edit_finish() time.sleep(2) self.screenshot() edit.edit_page().stop_video_play() edit.edit_page().edit_back("直接退出")
def test_03_theme_material(self): """从素材中心更换带字幕主题""" time.sleep(2) edit.edit_page().stop_video_play() edit.edit_page().click_store_icon() material.material_page().material_theme_change(themelist='热门', theme='落日飞车', text=True) edit.edit_page().edit_finish()
def importTime(self, number): self.d.app_start("com.quvideo.xiaoying") home.home_Page().click_edit_btn() time.sleep(0.5) log.i('开始添加镜头') for i in range(number): el = self.d(resourceId='com.quvideo.xiaoying:id/iv_cover') el[i].click() log.i('点击下一步进入编辑页') self.d(resourceId="com.quvideo.xiaoying:id/btn_next", text='下一步').click() import_start = time.time() if edit.edit_page().is_preview_page(): import_end = time.time() time_im = str(round(import_end - import_start, 2)) else: raise Exception('导入失败') return time_im
def test_02_template_use(self): """小影学院模版-使用""" time.sleep(1) template.template_Page().clips_template_add() edit.edit_page().stop_video_play()
def test_01_project_create(self): """工程文件操作-创建工程""" home.home_Page().click_edit_btn() gallery.gallery_page().gallery_clip_add(3) edit.edit_page().stop_video_play()
def test_03_FX_change(self): """使用其他特效""" material.material_page().FX_change("玩法") edit.edit_page().edit_back("保存并退出")
def test_04_theme_preview(self): """从预览页面更换主题""" time.sleep(1) material.material_page().preview_theme_change(themelist='日常') edit.edit_page().stop_video_play() publish.publish_page().click_draft_btn()
def test_03_sticker_change(self): """使用其他贴纸""" material.material_page().sticker_change("可爱") edit.edit_page().edit_back("保存并退出")