Exemplo n.º 1
0
    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('剪辑-画中画-图片添加测试完成')
Exemplo n.º 2
0
    def test_template_03_fx(self):
        """素材中心-特效."""
        sc.logger.info('素材中心-特效')
        fun_name = 'test_template_effect'

        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.refresh('down', 0.3, 500, 1)

        try:
            sc.logger.info('点击"使用"')
            WebDriverWait(
                sc.driver, 5,
                1).until(lambda x: x.find_element_by_name("使用")).click()
        except TimeoutException:
            sc.logger.info('该素材尚未下载,下载后再"使用"')
            time.sleep(1)
            fx_cover = '//*/XCUIElementTypeCollectionView/*/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeButton'
            WebDriverWait(
                sc.driver, 5,
                1).until(lambda x: x.find_element_by_xpath(fx_cover)).click()

            WebDriverWait(
                sc.driver, 5,
                1).until(lambda x: x.find_element_by_name('下载')).click()

            WebDriverWait(
                sc.driver, 10,
                1).until(lambda x: x.find_element_by_name("使用")).click()

        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('返回创作页')
        ba.back_to_home()

        ba.home_first_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('素材中心-特效测试完成')
Exemplo n.º 3
0
    def test_template_06_sticker(self):
        """素材中心-动画贴纸."""
        sc.logger.info('素材中心-动画贴纸')
        fun_name = 'test_template_sticker'

        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, 500)

        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('返回创作页')
        ba.back_to_home()

        ba.home_first_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, 500)

        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('素材中心-动画贴纸测试完成')
Exemplo n.º 4
0
    def test_effcts_02_text(self):
        """复杂操作-添加字幕."""
        sc.logger.info('复杂操作-添加字幕')
        fun_name = 'test_effcts_text'

        sc.logger.info('点击"字幕"')
        WebDriverWait(sc.driver, 5, 1).until(
            lambda x: x.find_element_by_name('字幕')).click()

        sc.logger.info('添加动态字幕')
        for i in range(3):
            ba.loop_add_text()
            time.sleep(1)
            sc.capture_screen(fun_name, self.img_path)

        sc.logger.info('添加普通字幕')
        for i in range(3):
            ba.loop_add_comm_text()
            time.sleep(1)
            sc.capture_screen(fun_name, self.img_path)

        sc.logger.info('切换到字体')
        WebDriverWait(sc.driver, 5, 1).until(
            lambda x: x.find_element_by_name(iOS_elements.btn_text_font)).click()

        sc.logger.info('点击"下载"按钮')
        try:
            WebDriverWait(sc.driver, 5, 1).until(
                lambda x: x.find_element_by_xpath(iOS_elements.btn_font_download)).click()
        except TimeoutException:
            sc.logger.info('当前页面已无为下载字体')

        sc.logger.info('切换到字体设置页面')
        sc.driver.find_element_by_name(iOS_elements.btn_text_set).click()

        sc.logger.info('随机对齐方式')
        el_align = [iOS_elements.btn_text_c, iOS_elements.btn_text_l, iOS_elements.btn_text_r]
        sc.driver.find_element_by_name(random.choice(el_align)).click()

        sc.logger.info('点击阴影开关')
        sc.driver.find_element_by_xpath("//*/XCUIElementTypeSwitch[1]").click()

        sc.logger.info('点击字幕动画开关')
        sc.driver.find_element_by_xpath("//*/XCUIElementTypeSwitch[2]").click()

        sc.logger.info('确认添加')
        ba.effect_add_confirm()
        sc.capture_screen(fun_name, self.img_path)
        sc.logger.info('复杂操作-添加字幕测试完成')
Exemplo n.º 5
0
    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('剪辑-画中画-视频添加测试完成')
Exemplo n.º 6
0
    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搜索测试完成')
Exemplo n.º 7
0
    def test_template_04_font(self):
        """素材中心-字体."""
        sc.logger.info('素材中心-字体')
        fun_name = 'test_template_font'

        ba.home_first_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_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('返回创作页')
        ba.back_to_home()

        ba.home_first_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('素材中心-字体测试完成')
Exemplo n.º 8
0
    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()

        try:
            WebDriverWait(sc.driver, 10,
                          1).until(lambda el: el.find_element_by_xpath(
                              '//XCUIElementTypeButton[@name="1"]')).click()
        except TimeoutException:
            sc.logger.info('返回首页后,无广告弹出')
        sc.logger.info('剪辑-多段配乐-添加测试完成')
Exemplo n.º 9
0
    def test_effcts_04_collage(self):
        """复杂操作-添加画中画."""
        sc.logger.info('复杂操作-添加画中画')
        fun_name = 'test_edit_collage'

        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('点击"画中画"')
        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('点击"画中画"')
        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('复杂操作-添加画中画测试完成')