Example #1
0
    def test_edit_fx_del(self):
        """剪辑-特效-删除&放弃."""
        sc.logger.info('剪辑-特效-删除&放弃')
        fun_name = 'test_edit_fx_del'

        sc.logger.info('点击草稿封面')
        time.sleep(0.5)
        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.screen_tap('特效', 200, 200)

        sc.logger.info('删除')
        sc.driver.find_element_by_name('删除').click()
        sc.capture_screen(fun_name, self.img_path)

        sc.logger.info('添加特效并放弃')
        WebDriverWait(sc.driver, 10,
                      1).until(lambda x: x.find_element_by_name('添加')).click()
        sc.capture_screen(fun_name, self.img_path)

        sc.logger.info('点击"下载更多"')
        el_more = 'xiaoying itembar down more'
        ba.more_download(el_more)

        sc.logger.info('使用特效')
        ba.material_used(iOS_elements.el_store_download1)

        sc.logger.info('确定')
        WebDriverWait(sc.driver, 5, 1).until(lambda x: x.find_element_by_name(
            iOS_elements.el_confirm_btn)).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(
            iOS_elements.el_cancel_btn)).click()

        sc.logger.info('确定放弃')
        sc.driver.find_element_by_name('确认').click()

        sc.logger.info('点击“存草稿”按钮')
        WebDriverWait(
            sc.driver, 5,
            1).until(lambda el: el.find_element_by_name("存草稿")).click()
        sc.logger.info('剪辑-特效-删除&放弃测试完成')
Example #2
0
    def test_template_02_filter(self):
        """素材中心-滤镜."""
        sc.logger.info('素材中心-滤镜')
        fun_name = 'test_template_filter'

        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_download2)
        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('点击“确认”')
        sc.driver.find_element_by_name(iOS_elements.el_confirm_btn).click()

        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('素材中心-滤镜测试完成')
Example #3
0
    def test_edit_filter(self):
        """剪辑-滤镜."""
        sc.logger.info('剪辑-滤镜')
        fun_name = 'test_edit_filter'

        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.logger.info('点击"下载更多"')
        btn_more = '下载更多'
        ba.more_download(btn_more)

        sc.logger.info('使用滤镜')
        ba.material_used(iOS_elements.el_store_download2)

        sc.logger.info('确认添加')
        WebDriverWait(sc.driver, 5, 1).until(lambda x: x.find_element_by_name(
            iOS_elements.el_confirm_btn)).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("存草稿")).click()
        sc.logger.info('剪辑-滤镜测试完成')
Example #4
0
    def test_template_08_transition(self):
        """素材中心-转场."""
        sc.logger.info('素材中心-转场')
        fun_name = 'test_template_transition'
        start_x = self.width // 2
        start_y = self.height // 8
        start_bottom = self.height - start_y

        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('向上滑动直到最底部')
        while True:
            try:
                sc.driver.find_element_by_name("没有更多了…").click()
                break
            except NoSuchElementException:
                sc.swipe_by_ratio(start_x, start_bottom, 'up', 0.7, 300)

        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('点击“确认”')
        sc.driver.find_element_by_name(iOS_elements.el_confirm_btn).click()

        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, 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('素材中心-动画贴纸测试完成')
Example #5
0
    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贴纸测试完成')
Example #6
0
    def test_template_01_theme(self):
        """素材中心-主题."""
        sc.logger.info('素材中心-主题')
        fun_name = 'test_template_theme'

        ba.home_first_click('素材中心')
        sc.capture_screen(fun_name, self.img_path)

        sc.logger.info('点击顶部banner')
        WebDriverWait(sc.driver, 5,
                      1).until(lambda el: el.find_element_by_accessibility_id(
                          iOS_elements.el_banner)).click()

        sc.logger.info('返回')
        try:
            WebDriverWait(
                sc.driver, 5, 1).until(lambda el: el.find_element_by_xpath(
                    '//XCUIElementTypeButton[@name="vivavideo com nav back n"]'
                )).click()
        except TimeoutException:
            WebDriverWait(
                sc.driver, 3, 1).until(lambda el: el.find_element_by_xpath(
                    '//XCUIElementTypeButton[@name="vivavideo back n"]')
                                       ).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('取消限制弹窗')
        try:
            WebDriverWait(sc.driver, 3,
                          1).until(lambda x: x.find_element_by_name(
                              iOS_elements.el_cancel)).click()
        except TimeoutException:
            sc.logger.info('限制弹窗已取消')

        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.logger.info('删除下载的主题')
        ba.material_manager('主题', iOS_elements.el_store_del)
        sc.capture_screen(fun_name, self.img_path)
        sc.logger.info('素材中心-主题测试完成')
Example #7
0
    def test_edit_sticker(self):
        """剪辑-动画贴纸-添加."""
        sc.logger.info('剪辑-动画贴纸-添加')
        fun_name = 'test_edit_sticker'

        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.sticker_comm_add()

        sc.logger.info('确认添加')
        WebDriverWait(sc.driver, 5, 1).until(lambda x: x.find_element_by_name(
            iOS_elements.el_confirm_btn)).click()
        sc.capture_screen(fun_name, self.img_path)

        sc.logger.info('添加第二个贴纸并放弃')
        WebDriverWait(sc.driver, 10,
                      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, 10,
            1).until(lambda x: x.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('确定')
        time.sleep(0.5)
        WebDriverWait(sc.driver, 5, 1).until(lambda x: x.find_element_by_name(
            iOS_elements.el_confirm_btn)).click()

        sc.logger.info('取消添加')
        WebDriverWait(sc.driver, 5, 1).until(lambda x: x.find_element_by_name(
            iOS_elements.el_cancel_btn)).click()
        sc.capture_screen(fun_name, self.img_path)

        # iOS此处有一个bug,贴纸未添加完成时,点击x,未弹出放弃弹窗(7.2.2已修复)
        sc.logger.info('确定放弃')
        try:
            WebDriverWait(
                sc.driver, 5,
                1).until(lambda x: x.find_element_by_name('确认')).click()
            sc.capture_screen(fun_name, self.img_path)
        except TimeoutException:
            sc.logger.error('iOS此处有一个bug,贴纸未添加完成时,点击x,未弹出放弃弹窗')

        sc.logger.info('点击“存草稿”按钮')
        WebDriverWait(
            sc.driver, 5,
            1).until(lambda el: el.find_element_by_name("存草稿")).click()
        sc.logger.info('剪辑-动画贴纸-添加测试完成')