Beispiel #1
0
    def test_gallery_giveup(self):
        """相册-放弃操作."""
        sc.logger.info('相册-放弃操作')
        fun_name = 'test_gallery_giveup'

        start_x = self.width // 2
        start_bottom = self.height - self.height // 4
        sc.driver.find_element_by_id('com.quvideo.xiaoying:id/icon1').click()
        el_video = sc.driver.find_element_by_id(
            'com.quvideo.xiaoying:id/img_click_mask')
        el_video.click()
        sc.capture_screen(fun_name, self.img_path)
        sc.driver.find_element_by_id(
            'com.quvideo.xiaoying:id/xiaoying_com_btn_left').click()
        sc.capture_screen(fun_name, self.img_path)
        sc.driver.find_element_by_android_uiautomator('text("视频")').click()
        sc.driver.find_element_by_android_uiautomator('text("图片")').click()
        sc.swipe_by_ratio(start_x, start_bottom, 'up', 0.5, 500)
        sc.find_by_ids('com.quvideo.xiaoying:id/img_icon', fun_name,
                       self.img_path)
        sc.driver.find_element_by_id(
            'com.quvideo.xiaoying:id/xiaoying_com_btn_left').click()
        sc.driver.find_element_by_android_uiautomator('text("丢弃")').click()
        sc.capture_screen(fun_name, self.img_path)
        sc.logger.info('相册-放弃操作相关操作测试完成')
Beispiel #2
0
    def test_preview_delete(self):
        """音乐库-删除已下载音乐."""
        sc.logger.info('音乐库-删除已下载音乐')
        fun_name = 'test_preview_delete'

        sc.driver.find_element_by_id(
            'com.quvideo.xiaoying:id/txtview_bgm_name').click()
        sc.logger.info('点击删除按钮')
        sc.driver.find_element_by_id(
            'com.quvideo.xiaoying:id/music_rubbish_icon').click()
        sc.logger.info('依次选择已下载音乐')
        sc.find_by_ids('com.quvideo.xiaoying:id/music_item_check_box',
                       fun_name, self.img_path)
        sc.logger.info('再次点击删除按钮')
        sc.driver.find_element_by_id(
            'com.quvideo.xiaoying:id/music_rubbish_icon').click()
        sc.capture_screen(fun_name, self.img_path)
        sc.logger.info('音乐库-删除已下载音乐测试完成')
Beispiel #3
0
    def test_create_craft(self):
        """创建一个草稿视频."""
        sc.logger.info('创建一个草稿视频')
        fun_name = 'test_create_craft'

        time.sleep(1)
        sc.logger.info('点击创作中心主按钮')
        sc.driver.find_element_by_id(
            'com.quvideo.xiaoying:id/img_creation').click()
        sc.logger.info('点击“剪辑”按钮')
        sc.driver.find_element_by_id('com.quvideo.xiaoying:id/icon1').click()
        el_video_list = sc.driver.find_elements_by_id(
            'com.quvideo.xiaoying:id/img_click_mask')
        for i in range(3):
            el_video_list[i].click()
            sc.logger.info('点击“添加”按钮')
            sc.driver.find_element_by_id(
                'com.quvideo.xiaoying:id/imgbtn_import').click()
            try:
                WebDriverWait(sc.driver, 60).until(
                    lambda V_improt: V_improt.
                    find_element_by_android_uiautomator('text("下一步")'))
                sc.logger.info('点击“下一步”按钮')
            except TimeoutError as t:
                sc.logger.error('导入视频超时', t)
                return False
            except Exception as e:
                sc.logger.error('导入视频出错', e)
                return False
        sc.logger.info('点击“视频”按钮')
        sc.driver.find_element_by_android_uiautomator('text("视频")').click()
        sc.logger.info('点击“图片”按钮')
        sc.driver.find_element_by_android_uiautomator('text("图片")').click()
        sc.find_by_ids('com.quvideo.xiaoying:id/img_icon', fun_name,
                       self.img_path)
        sc.logger.info('点击“下一步”按钮')
        sc.driver.find_element_by_android_uiautomator('text("下一步")').click()
        sc.logger.info('点击“存草稿”按钮')
        sc.driver.find_element_by_android_uiautomator('text("存草稿")').click()

        sc.logger.info('返回创作中心主界面')
        sc.driver.press_keycode(4)
        sc.logger.info('创建一个草稿视频完成')
Beispiel #4
0
    def test_edit_add_clips(self):
        """剪辑-添加镜头-相册添加."""
        sc.logger.info('剪辑-添加镜头-相册添加')
        fun_name = 'test_edit_add_clips'

        start_x = self.width - self.width // 4
        start_bottom = self.height - self.height // 10

        time.sleep(1)
        sc.logger.info('点击创作中心主按钮')
        sc.driver.find_element_by_id('com.quvideo.xiaoying:id/img_creation').click()
        sc.logger.info('点击“更多草稿”')
        sc.driver.find_element_by_android_uiautomator('text("更多草稿")').click()

        sc.logger.info('点击草稿封面')
        el_draft = sc.driver.find_element_by_id('com.quvideo.xiaoying:id/xiaoying_studio_img_project_thumb')
        el_draft.click()
        sc.logger.info('点击“剪辑”')
        sc.driver.find_element_by_android_uiautomator('text("剪辑")').click()

        sc.swipe_by_ratio(start_x, start_bottom, 'left', 0.6, 500)
        time.sleep(1)

        el_edit_list = sc.driver.find_elements_by_id('com.quvideo.xiaoying:id/title')
        for el_item in el_edit_list:
            if el_item.text == '添加镜头':
                sc.logger.info('开始点击“添加镜头”')
                el_item.click()
                break
        sc.logger.info('点击“视频”下拉按钮')
        sc.driver.find_element_by_android_uiautomator('text("视频")').click()
        sc.logger.info('点击“图片”')
        sc.driver.find_element_by_android_uiautomator('text("图片")').click()
        sc.find_by_ids('com.quvideo.xiaoying:id/img_click_mask', fun_name, self.img_path)
        sc.driver.find_element_by_android_uiautomator('text("下一步")').click()
        sc.capture_screen(fun_name, self.img_path)

        sc.logger.info('返回创作中心主界面')
        for i in range(3):
            time.sleep(1)
            sc.driver.press_keycode(4)

        sc.logger.info('剪辑-添加镜头-相册添加测试完成')
Beispiel #5
0
    def test_gallery_storyboard(self):
        """相册-storyboard."""
        sc.logger.info('相册-storyboard')
        fun_name = 'test_gallery_storyboard'

        sc.driver.find_element_by_id('com.quvideo.xiaoying:id/icon1').click()
        el_video_list = sc.driver.find_elements_by_id(
            'com.quvideo.xiaoying:id/img_click_mask')

        for i in range(3):
            el_video_list[i].click()
            sc.driver.find_element_by_id(
                'com.quvideo.xiaoying:id/imgbtn_import').click()
            try:
                WebDriverWait(sc.driver, 60).until(
                    lambda V_improt: V_improt.
                    find_element_by_android_uiautomator('text("下一步")'))
            except TimeoutError as t:
                sc.logger.error('导入视频超时', t)
                return False
            except Exception as e:
                sc.logger.error('导入视频出错', e)
                return False
        sc.driver.find_element_by_android_uiautomator('text("视频")').click()
        sc.driver.find_element_by_android_uiautomator('text("图片")').click()
        sc.find_by_ids('com.quvideo.xiaoying:id/img_icon', fun_name,
                       self.img_path)
        sc.driver.find_element_by_id(
            'com.quvideo.xiaoying:id/btn_expand').click()
        el_storyboard_del = sc.driver.find_element_by_id(
            'com.quvideo.xiaoying:id/img_delete')
        el_storyboard_del.click()
        sc.capture_screen(fun_name, self.img_path)
        sc.driver.find_element_by_id(
            'com.quvideo.xiaoying:id/xiaoying_com_btn_left').click()
        sc.driver.find_element_by_android_uiautomator('text("保存")').click()
        sc.capture_screen(fun_name, self.img_path)
        sc.driver.find_element_by_id(
            'com.quvideo.xiaoying:id/xiaoying_com_btn_left').click()
        sc.logger.info('相册-storyboard相关操作测试完成')
Beispiel #6
0
    def test_gallery_img(self):
        """相册-图片."""
        sc.logger.info('相册-图片')
        fun_name = 'test_gallery_img'

        sc.driver.find_element_by_id('com.quvideo.xiaoying:id/icon1').click()
        sc.driver.find_element_by_android_uiautomator('text("视频")').click()
        sc.driver.find_element_by_android_uiautomator('text("图片")').click()
        sc.driver.find_element_by_android_uiautomator('text("其他相册")').click()
        sc.capture_screen(fun_name, self.img_path)
        sc.driver.find_element_by_android_uiautomator('text("全部")').click()
        sc.find_by_ids('com.quvideo.xiaoying:id/img_click_mask', fun_name,
                       self.img_path)
        sc.driver.find_element_by_android_uiautomator('text("下一步")').click()
        sc.capture_screen(fun_name, self.img_path)
        sc.driver.find_element_by_id(
            'com.quvideo.xiaoying:id/preview_layout_fake').click()
        sc.driver.find_element_by_android_uiautomator('text("存草稿")').click()
        sc.driver.find_element_by_id(
            'com.quvideo.xiaoying:id/xiaoying_com_btn_left').click()
        sc.capture_screen(fun_name, self.img_path)
        sc.logger.info('相册-图片相关操作测试完成')
Beispiel #7
0
    def test_preview_time(self):
        """预览页-时长."""
        sc.logger.info('预览页-时长')
        fun_name = 'test_preview_time'

        sc.logger.info('点击“相册MV')
        sc.driver.find_element_by_android_uiautomator('text("相册MV")').click()
        sc.logger.info('添加图片')
        sc.find_by_ids('com.quvideo.xiaoying:id/img_click_mask', fun_name,
                       self.img_path)
        sc.logger.info('点击“下一步”')
        sc.driver.find_element_by_android_uiautomator('text("下一步")').click()
        sc.driver.find_element_by_id(
            'com.quvideo.xiaoying:id/preview_layout_fake').click()
        sc.logger.info('点击“时长”')
        sc.driver.find_element_by_android_uiautomator('text("时长")').click()
        sc.capture_screen(fun_name, self.img_path)
        sc.logger.info('点击“存草稿”')
        sc.driver.find_element_by_android_uiautomator('text("存草稿")').click()
        sc.logger.info('点击左上角返回创作中心主界面')
        sc.driver.find_element_by_id(
            'com.quvideo.xiaoying:id/xiaoying_com_btn_left').click()
        sc.capture_screen(fun_name, self.img_path)
        sc.logger.info('预览页-时长测试完成')