def test_edit_collage_01_img(self): """剪辑-画中画-图片添加.""" sc.logger.info('剪辑-画中画-图片添加') fun_name = 'test_edit_collage_img' sc.logger.info('打开一个草稿视频') ba.home_first_click('更多草稿') sc.logger.info('点击草稿封面') ba.open_draft(iOS_elements.el_studio_draft) sc.capture_screen(fun_name, self.img_path) sc.logger.info('点击“效果”') WebDriverWait(sc.driver, 5, 1).until( lambda x: x.find_element_by_name("效果")).click() sc.capture_screen(fun_name, self.img_path) sc.logger.info('点击"画中画"') WebDriverWait(sc.driver, 5, 1).until( lambda x: x.find_element_by_name('画中画')).click() sc.capture_screen(fun_name, self.img_path) sc.logger.info('添加图片画中画') ba.collage_add('图片') sc.capture_screen(fun_name, self.img_path) sc.logger.info('确认添加') ba.effect_add_confirm() sc.logger.info('剪辑-画中画-图片添加测试完成')
def test_edit_music_01(self): """剪辑-多段配乐-添加.""" sc.logger.info('剪辑-多段配乐-添加') fun_name = 'test_music_add' sc.logger.info('打开一个草稿视频') ba.home_first_click('更多草稿') sc.logger.info('点击草稿封面') ba.open_draft(iOS_elements.el_studio_draft) sc.capture_screen(fun_name, self.img_path) sc.logger.info('点击“效果”') WebDriverWait(sc.driver, 5, 1).until( lambda x: x.find_element_by_name("效果")).click() sc.capture_screen(fun_name, self.img_path) sc.logger.info("添加一段'配乐'") ba.effects_music() sc.capture_screen(fun_name, self.img_path) sc.logger.info('确认添加') ba.effect_add_confirm() sc.capture_screen(fun_name, self.img_path) sc.logger.info('点击“存草稿”按钮') WebDriverWait(sc.driver, 5, 1).until( lambda el: el.find_element_by_name("存草稿")).click() sc.logger.info('剪辑-多段配乐-添加测试完成')
def test_edit_text(self): """剪辑-字幕-添加.""" sc.logger.info('剪辑-字幕-添加') fun_name = 'test_edit_text' sc.logger.info('点击视频剪辑') WebDriverWait(sc.driver, 3, 1).until(lambda x: x.find_element_by_xpath( iOS_elements.el_home_edit)).click() sc.logger.info('添加视频') ba.gallery_clip_add('视频', 2) sc.capture_screen(fun_name, self.img_path) sc.logger.info('点击下一步') ba.find_element_click('predicate', 10, iOS_elements.el_gallery_next) sc.capture_screen(fun_name, self.img_path) sc.logger.info('点击“效果”') WebDriverWait(sc.driver, 5, 1).until(lambda x: x.find_element_by_name("效果")).click() sc.capture_screen(fun_name, self.img_path) sc.logger.info('点击“字幕”') WebDriverWait(sc.driver, 5, 1).until(lambda x: x.find_element_by_name("字幕")).click() sc.capture_screen(fun_name, self.img_path) sc.logger.info('默认动态字幕添加') ba.effect_add_confirm() sc.capture_screen(fun_name, self.img_path) sc.logger.info('添加第二个字幕并放弃') WebDriverWait(sc.driver, 5, 1).until(lambda x: x.find_element_by_name("字幕")).click() sc.capture_screen(fun_name, self.img_path) sc.logger.info('添加一个普通字幕') ba.text_comm_add() sc.logger.info('其他设置') ba.text_other() sc.logger.info('确认添加') ba.effect_add_confirm() sc.capture_screen(fun_name, self.img_path) sc.logger.info('点击“存草稿”按钮') WebDriverWait( sc.driver, 5, 1).until(lambda el: el.find_element_by_name("存草稿")).click() sc.logger.info('剪辑-字幕-添加测试完成')
def test_template_05_text(self): """素材中心-字幕.""" sc.logger.info('素材中心-字幕') fun_name = 'test_template_text' sc.logger.info('点击“字幕”') WebDriverWait(sc.driver, 5, 1).until(lambda x: x.find_element_by_name('字幕')).click() sc.capture_screen(fun_name, self.img_path) sc.logger.info('下载并使用字幕') ba.material_used(iOS_elements.el_store_download1) sc.capture_screen(fun_name, self.img_path) sc.logger.info('添加"视频"') ba.gallery_clip_add('视频', 2) sc.logger.info('点击下一步进入预览页') ba.find_element_click('predicate', 10, iOS_elements.el_gallery_next) sc.capture_screen(fun_name, self.img_path) sc.logger.info('点击“确认”') ba.effect_add_confirm() sc.logger.info('点击“存草稿”按钮') WebDriverWait( sc.driver, 5, 1).until(lambda el: el.find_element_by_name("存草稿")).click() sc.capture_screen(fun_name, self.img_path) sc.logger.info('返回创作页') WebDriverWait(sc.driver, 5, 1).until(lambda el: el.find_element_by_name( iOS_elements.el_com_back)).click() WebDriverWait( sc.driver, 5, 1).until(lambda x: x.find_element_by_name('素材中心')).click() sc.logger.info('点击“字幕”') WebDriverWait(sc.driver, 5, 1).until(lambda x: x.find_element_by_name('字幕')).click() sc.capture_screen(fun_name, self.img_path) sc.logger.info('删除下载的字幕') ba.material_manager('字幕', iOS_elements.el_store_del) sc.capture_screen(fun_name, self.img_path) sc.logger.info('素材中心-字幕测试完成')
def test_edit_collage_02_video(self): """剪辑-画中画-视频添加.""" sc.logger.info('剪辑-画中画-视频添加') fun_name = 'test_edit_collage_video' sc.logger.info('点击"画中画"') WebDriverWait(sc.driver, 5, 1).until( lambda x: x.find_element_by_name('画中画')).click() sc.capture_screen(fun_name, self.img_path) sc.logger.info('添加视频画中画') ba.collage_add('视频') sc.capture_screen(fun_name, self.img_path) sc.logger.info('确认添加') ba.effect_add_confirm() sc.capture_screen(fun_name, self.img_path) sc.logger.info('剪辑-画中画-视频添加测试完成')
def test_edit_collage_03_gif(self): """剪辑-画中画-GIF添加.""" sc.logger.info('剪辑-画中画-GIF添加') fun_name = 'test_edit_collage_gif' sc.logger.info('点击"画中画"') time.sleep(0.5) WebDriverWait(sc.driver, 5, 1).until( lambda x: x.find_element_by_name('画中画')).click() sc.capture_screen(fun_name, self.img_path) sc.logger.info('添加gif画中画') ba.collage_add('GIF') sc.capture_screen(fun_name, self.img_path) sc.logger.info('确认添加') ba.effect_add_confirm() sc.capture_screen(fun_name, self.img_path) sc.logger.info('剪辑-画中画-GIF搜索测试完成')
def test_template_07_gif(self): """素材中心-GIF.""" sc.logger.info('素材中心-GIF') fun_name = 'test_template_gif' sc.logger.info('点击“动画贴纸”') WebDriverWait( sc.driver, 5, 1).until(lambda x: x.find_element_by_name('动画贴纸')).click() sc.capture_screen(fun_name, self.img_path) sc.logger.info('切换到“GIF”') WebDriverWait( sc.driver, 5, 1).until(lambda el: el.find_element_by_name("GIF")).click() sc.capture_screen(fun_name, self.img_path) sc.logger.info('下载并使用GIF贴纸') ba.material_used('下载') sc.capture_screen(fun_name, self.img_path) sc.logger.info('添加"视频"') ba.gallery_clip_add('视频', 2) sc.logger.info('点击下一步进入预览页') ba.find_element_click('predicate', 10, iOS_elements.el_gallery_next) sc.capture_screen(fun_name, self.img_path) sc.logger.info('点击“确认”') ba.effect_add_confirm() sc.logger.info('点击“存草稿”按钮') WebDriverWait( sc.driver, 5, 1).until(lambda el: el.find_element_by_name("存草稿")).click() sc.capture_screen(fun_name, self.img_path) sc.logger.info('返回创作页') WebDriverWait(sc.driver, 5, 1).until(lambda el: el.find_element_by_name( iOS_elements.el_com_back)).click() WebDriverWait( sc.driver, 5, 1).until(lambda x: x.find_element_by_name('素材中心')).click() sc.logger.info('向上滑动') el_text = sc.driver.find_element_by_name("字幕") coord_x = el_text.location.get('x') coord_y = el_text.location.get('y') sc.swipe_by_ratio(coord_x, coord_y, 'up', 0.7, 300) sc.logger.info('点击“动画贴纸”') WebDriverWait( sc.driver, 5, 1).until(lambda x: x.find_element_by_name('动画贴纸')).click() sc.capture_screen(fun_name, self.img_path) sc.logger.info('切换到“GIF”') WebDriverWait( sc.driver, 5, 1).until(lambda el: el.find_element_by_name("GIF")).click() sc.logger.info('删除下载的GIF贴纸') ba.material_manager('GIF贴纸', '删除') sc.capture_screen(fun_name, self.img_path) sc.logger.info('素材中心-GIF贴纸测试完成')