Exemple #1
0
 def wp_check_approve_setup(self):
     ov = OpenView(self.driver)
     ov.open_file('欢迎使用永中Office.docx')
     gv = GeneralView(self.driver)
     gv.switch_write_read()
     wv = WpView(self.driver)
     wv.switch_option('审阅')
 def test_wp_shape_fill_color(self):
     # 设置形状填充色及透明度
     logging.info('==========test_wp_shape_fill_color==========')
     self.shapeatt_setup()
     wv = WpView(self.driver)
     self.assertTrue(wv.shape_fill_color(),
                     msg='Filling color transparency fail')
 def test_wp_pic_surround(self):
     # 设置图片环绕
     logging.info('==========test_wp_pic_surround==========')
     self.choose_pic_setup()
     wp = WpView(self.driver)
     wp.surround('picture')
     time.sleep(10)
Exemple #4
0
 def wp_insert_setup(self):
     ov = OpenView(self.driver)
     ov.open_file('欢迎使用永中Office.docx')
     gv = GeneralView(self.driver)
     gv.switch_write_read()
     wv = WpView(self.driver)
     wv.switch_option('插入')
Exemple #5
0
 def test_wp_shape_delete(self):
     # 形状 删除
     logging.info('==========test_wp_shape_delete==========')
     self.shapeatt_setup()
     wv = WpView(self.driver)
     # connect_device(wv.get_phone_dev())
     wv.object_delete()
     time.sleep(10)
 def test_wp_pic_fixed_rotate(self):
     # 图片旋转
     logging.info('==========test_wp_pic_fixed_rotation==========')
     self.choose_pic_setup()
     gv = GeneralView(self.driver)
     gv.fold_expand()
     wp = WpView(self.driver)
     wp.pic_fixed_rotate()
 def test_wp_shape_shadow(self):
     # 设置形状阴影和三维效果
     logging.info('==========test_wp_shape_broad==========')
     self.shapeatt_setup()
     gv = GeneralView(self.driver)
     gv.fold_expand()
     wv = WpView(self.driver)
     wv.shape_effect()
 def test_wp_shape_surround(self):
     # 设置形状文字环绕效果
     logging.info('==========test_wp_shape_surround==========')
     self.shapeatt_setup()
     gv = GeneralView(self.driver)
     gv.fold_expand()
     wv = WpView(self.driver)
     wv.surround('shape')
 def test_wp_shape_broad_width(self):
     # 设置形状轮廓粗细
     logging.info('==========test_wp_shape_broad==========')
     self.shapeatt_setup()
     gv = GeneralView(self.driver)
     gv.fold_expand()
     wv = WpView(self.driver)
     wv.shape_broad_width()
 def test_wp_shape_type(self):
     # 形状轮廓类型
     logging.info('==========test_wp_shape_broad==========')
     self.shapeatt_setup()
     gv = GeneralView(self.driver)
     gv.fold_expand()
     wv = WpView(self.driver)
     wv.shape_broad_type()
 def test_wp_shape_move(self):
     # 文本框移动
     logging.info('==========test_wp_shape_move==========')
     self.shapeatt_setup()
     wv = WpView(self.driver)
     connect_device(wv.get_phone_dev())
     wv.text_box_move()
     time.sleep(10)
Exemple #12
0
 def test_wp_swipe(self):
     # WORD文档滚屏
     logging.info('==========test_wp_swipe==========')
     ov = OpenView(self.driver)
     ov.open_file('欢迎使用永中Office.docx')
     gv = GeneralView(self.driver)
     gv.switch_write_read()
     wp = WpView(self.driver)
     wp.swipeup()
    def test_wp_shape_control_point(self):
        # 手势拖拉形状控制点
        logging.info('==========test_wp_shape_control_point==========')
        self.shapeatt_setup()
        wv = WpView(self.driver)
        connect_device(wv.get_phone_dev())

        wv.shape_control_point()
        time.sleep(10)
    def test_wp_shape_rotate_90(self):
        # 形状旋转90度
        logging.info('==========test_wp_shape_rotate_90==========')
        self.shapeatt_setup()
        wv = WpView(self.driver)
        connect_device(wv.get_phone_dev())

        wv.object_rotate_90()
        time.sleep(10)
 def test_wp_pic_change_size(self):
     # 设置图片宽高
     logging.info('==========test_wp_pic_change_size==========')
     self.choose_pic_setup()
     gv = GeneralView(self.driver)
     gv.fold_expand()
     wp = WpView(self.driver)
     wp.pic_change_size()
     time.sleep(5)
 def test_wp_shape_text_select(self):
     # 文本框内容选取
     logging.info('==========test_wp_shape_text_select==========')
     self.shapeatt_setup()
     wv = WpView(self.driver)
     connect_device(wv.get_phone_dev())
     wv.text_box_text_select()
     self.assertTrue(
         exists(Template(r'../Res/res_delete.png',
                         resolution=(1080, 1920))))
Exemple #17
0
 def test_wp_text_select(self):
     # 文本选取
     logging.info('==========test_wp_fonts==========')
     ov = OpenView(self.driver)
     ov.open_file('欢迎使用永中Office.docx')
     gv = GeneralView(self.driver)
     wv = WpView(self.driver)
     gv.switch_write_read()
     # # connect_device(ov.get_phone_dev())
     # touch((542, 629), duration=1)
     # TouchAction(self.driver).long_press(x=542, y=629).wait(1000).release().perform()
     wv.l_press(542, 629)
     touch(wv.T_res_select_5)
     time.sleep(10)
 def test_wp_self_adaption(self):
     # 阅读自适应
     logging.info('==========test_wp_self_adaption==========')
     ov = OpenView(self.driver)
     ov.open_file('欢迎使用永中Office.docx')
     wp_lookup = WpView(self.driver)
     wp_lookup.self_adaption()
     A_self = ov.exist(
         "//*[@resource-id='com.yozo.office:id/yozo_ui_app_frame_title_container']"
     )
     B_self = ov.exist(
         "//*[@resource-id='com.yozo.office:id/yozo_ui_app_frame_option_container']"
     )
     self.assertFalse(A_self, msg='self_adaption title_container exist!')
     self.assertFalse(B_self, msg='self_adaption option_container exist!')
 def test_wp_pic_save_album(self):
     # 保存图片至相册
     logging.info('==========test_wp_pic_save_album==========')
     self.choose_pic_setup()
     wp = WpView(self.driver)
     connect_device(wp.get_phone_dev())
     wp.adjust_object_place()
     wp.pic_save_to_album()
     self.assertTrue(wp.get_toast_message('图片保存成功'), 'picture save to album fail')
 def test_wp_pic_layer(self):  # 有缺陷,嵌入型图片永远在底层
     # 设置图片叠放次序
     logging.info('==========test_wp_pic_layer==========')
     self.test_wp_pic_copy_paste()
     wp = WpView(self.driver)
     wp.choose_pic()
     wp.surround_peripheral()
     self.driver.keyevent(4)
     self.driver.keyevent(4)
     wp.pic_layer()
 def test_wp_jump(self):
     logging.info('==========test_wp_bookmark==========')
     ov = OpenView(self.driver)
     ov.open_file('欢迎使用永中Office.docx')
     gv = GeneralView(self.driver)
     gv.switch_write_read()
     wv = WpView(self.driver)
     wv.switch_option('查看')
     wp_lookup = WpView(self.driver)
     wp_lookup.wp_jump()
     time.sleep(2)
    def test_wp_find_replace(self):
        logging.info('==========test_wp_find_replace==========')
        ov = OpenView(self.driver)
        ov.open_file('欢迎使用永中Office.docx')
        gv = GeneralView(self.driver)
        gv.switch_write_read()
        wv = WpView(self.driver)
        wv.switch_option('查看')
        wp_lookup = WpView(self.driver)

        wp_lookup.wp_find_replace()
 def test_wp_pic_delete(self):
     logging.info('==========test_wp_pic_delete==========')
     self.choose_pic_setup()
     wp = WpView(self.driver)
     connect_device(wp.get_phone_dev())
     wp.adjust_object_place()
     wp.object_delete()
     time.sleep(10)
 def test_wp_shape_layer(self):
     # 设置形状叠放次序
     logging.info('==========test_wp_shape_surround==========')
     self.shapeatt_setup()
     wv = WpView(self.driver)
     gv = GeneralView(self.driver)
     gv.switch_write_read()
     gv.switch_write_read()
     wv.switch_option('插入')
     wv.insert_text_box()
     gv.fold_expand()
     wv.shape_layer()
 def test_wp_pic_control_point(self):
     logging.info('==========test_wp_pic_control_point==========')
     self.choose_pic_setup()
     wp = WpView(self.driver)
     connect_device(wp.get_phone_dev())
     wp.adjust_object_place()
     # 手势拖拉大小控制点
     wp.pic_control_point()
     time.sleep(10)
 def test_wp_pic_rotate_90(self):
     # 图片旋转90度
     logging.info('==========test_wp_pic_rotate_90==========')
     self.choose_pic_setup()
     wp = WpView(self.driver)
     connect_device(wp.get_phone_dev())
     wp.adjust_object_place()
     wp.object_rotate_90()
     time.sleep(10)
 def test_wp_bookmark(self):
     logging.info('==========test_wp_bookmark==========')
     ov = OpenView(self.driver)
     ov.open_file('欢迎使用永中Office.docx')
     gv = GeneralView(self.driver)
     gv.switch_write_read()
     wv = WpView(self.driver)
     wv.switch_option('查看')
     wp_lookup = WpView(self.driver)
     self.assertTrue(wp_lookup.wp_bookmark(), msg='test_wp_bookmark fail')
 def test_wp_line_space_size(self):
     # 多倍行距
     logging.info('==========test_wp_line_space_size==========')
     self.test_wp_text_select()
     wv = WpView(self.driver)
     wv.switch_option('编辑')
     wv.line_space_size()
 def test_wp_fonts_column(self):
     # 设置分栏
     logging.info('==========test_wp_fonts_column==========')
     self.test_wp_text_select()
     wv = WpView(self.driver)
     wv.switch_option('编辑')
     wv.column()
 def test_wp_fonts_align_indent(self):
     # 设置字体对齐、缩进量
     logging.info('==========test_wp_fonts_align_indent==========')
     self.test_wp_text_select()
     wv = WpView(self.driver)
     wv.switch_option('编辑')
     wv.align_indent()