Exemplo n.º 1
0
    def test_wp_pic_pop_menu_all(self, type1='wp'):
        self.insert_one_pic(type1)
        wp = WPView(self.driver)
        s = wp.swipe_option('up')
        while not wp.exist('//*[@text=" Text Wrapping "]'):
            wp.swipe(s[0], s[1], s[2], s[3])
        wp.text_wrap(' Square ')
        # 属性调整大小
        cc = "com.yozo.office.en:id/yozo_ui_%s_option_id_picture_edit" % type1
        while not wp.exist('//*[@resource-id="%s"]' % cc):
            wp.swipe(s[2], s[3], s[0], s[1])
        wp.get_element('//*[@resource-id="%s"]'
                       '/android.widget.FrameLayout[5]' % cc).click()
        wp.shape_option_5()
        if wp.exist(
                '//*[@resource-id="com.yozo.office.en:id/yozo_ui_option_content_container"]'
        ):
            wp.fold_expand()

        touch(wp.template_object('chart_all1.png'))
        touch(wp.template_object('copy.png'))  # 复制
        touch(wp.template_object('chart_all1.png'))
        touch(wp.template_object('cut.png'))  # 剪切
        touch(wp.template_object('point.png'))
        touch(wp.template_object('paste.png'))  # 粘贴
        touch(wp.template_object('rotate_free.png'))
        swipe(wp.template_object('editText.png'),
              wp.template_object('copy.png'))
        touch(wp.template_object('rotate_90.png'))
        touch(wp.template_object('rotate_free.png'))
        touch(wp.template_object('save_to_album.png'))  # 存至相册
        touch(wp.template_object('rotate_free.png'))
        touch(wp.template_object('edit_pic.png'))  # 裁剪
        touch(wp.template_object('delete.png'))  # 删除
Exemplo n.º 2
0
    def test_wp_pic_outline_border_px(self, type1='wp'):
        # type1 = 'wp'
        self.insert_one_pic(type1)
        wp = WPView(self.driver)
        cc = "com.yozo.office.en:id/yozo_ui_%s_option_id_picture_edit" % type1
        wp.get_element('//*[@resource-id="%s"]'
                       '/android.widget.FrameLayout[5]' % cc).click()
        # 属性调整大小
        wp.shape_option_5()
        if not wp.exist(
                '//*[@resource-id="com.yozo.office.en:id/yozo_ui_option_content_container"]'
        ):
            wp.fold_expand()

        # if type1 == 'pg':
        #     cc = "com.yozo.office.en:id/yozo_ui_pg_option_id_picture_border_width"
        # elif type1 == 'wp':
        cc = "com.yozo.office.en:id/yozo_ui_wp_option_id_picture_border_width"
        # elif type1 == 'ss':
        #     cc = "com.yozo.office.en:id/yozo_ui_ss_option_id_picture_border_width"
        s = wp.swipe_option('up')
        while not wp.exist('//*[@resource-id="%s"]' % cc):
            wp.swipe(s[0], s[1], s[2], s[3])
        for i in range(1, 7):
            wp.get_element('//*[@resource-id="%s"]'
                           '/android.widget.FrameLayout[%s]' %
                           (cc, i)).click()
        # cc = 'com.yozo.office.en:id/yozo_ui_option_id_objec_border_width_select'
        for i in range(30):
            wp.get_element(
                '//*[@resource-id="com.yozo.office.en:id/yozo_ui_number_picker_arrow_right"]'
            ).click()
Exemplo n.º 3
0
 def test_wp_pic_outline_color(self, type1='wp'):
     self.insert_one_pic(type1)
     wp = WPView(self.driver)
     cc = "com.yozo.office.en:id/yozo_ui_%s_option_id_picture_edit" % type1
     wp.get_element('//*[@resource-id="%s"]'
                    '/android.widget.FrameLayout[5]' % cc).click()
     # 属性调整大小
     wp.shape_option_5()
     if not wp.exist(
             '//*[@resource-id="com.yozo.office.en:id/yozo_ui_option_content_container"]'
     ):
         wp.fold_expand()
     cc = "com.yozo.office.en:id/yozo_ui_wp_option_id_picture_broad"
     s = wp.swipe_option('up')
     while not wp.exist('//*[@resource-id="%s"]' % cc):
         wp.swipe(s[0], s[1], s[2], s[3])
     for i in range(1, 7):
         wp.get_element('//*[@resource-id="%s"]'
                        '/android.widget.FrameLayout[%s]' %
                        (cc, i)).click()
     cc = 'com.yozo.office.en:id/yozo_ui_option_id_color_all'
     list(
         map(
             lambda i: wp.get_element('//*[@resource-id="%s"]'
                                      '/android.widget.FrameLayout[%s]' %
                                      (cc, i)).click(), range(1, 43)))
Exemplo n.º 4
0
    def test_wp_pic_shadow(self, type1='wp'):
        # type1 = 'wp'
        self.insert_one_pic(type1)
        wp = WPView(self.driver)
        cc = "com.yozo.office.en:id/yozo_ui_%s_option_id_picture_edit" % type1

        wp.get_element('//*[@resource-id="%s"]'
                       '/android.widget.FrameLayout[5]' % cc).click()
        # 属性调整大小
        wp.shape_option_5()
        if not wp.exist(
                '//*[@resource-id="com.yozo.office.en:id/yozo_ui_option_content_container"]'
        ):
            wp.fold_expand()
        cc = "com.yozo.office.en:id/yozo_ui_%s_option_id_picture_effect" % type1
        for i in range(1, 7):
            wp.get_element('//*[@resource-id="%s"]'
                           '/android.widget.FrameLayout[%s]' %
                           (cc, i)).click()

        cc = 'com.yozo.office.en:id/yozo_ui_option_id_object_effect_shadow'
        for i in range(1, 6):
            wp.get_element('//*[@resource-id="%s"]'
                           '/android.widget.FrameLayout[%s]' %
                           (cc, i)).click()
Exemplo n.º 5
0
    def test_wp_shape_pop_menu_all(self, type1='wp'):
        cv = CreateView(self.driver)
        cv.create_file(type1)
        wp = WPView(self.driver)
        time.sleep(1)
        wp.pinch()
        wp.group_button_click(' Insert ')
        wp.insert_shape(type1, index=3)
        wp.fold_expand()
        touch(wp.template_object('rotate_free.png'))
        touch(wp.template_object('editText.png'))  # 编辑文字
        touch(wp.template_object('rotate_free.png'))
        touch(wp.template_object('copy.png'))  # 复制
        touch(wp.template_object('rotate_free.png'))
        touch(wp.template_object('cut.png'))  # 剪切
        touch(wp.template_object('point.png'))
        touch(wp.template_object('paste.png'))  # 粘贴
        touch(wp.template_object('rotate_free.png'))
        swipe(wp.template_object('editText.png'),
              wp.template_object('copy.png'))
        touch(wp.template_object('rotate_90.png'))
        touch(wp.template_object('rotate_free.png'))
        touch(wp.template_object('delete.png'))  # 删除

        time.sleep(10)
Exemplo n.º 6
0
 def test_wp_table_pop_menu(self):
     self.wp_insert_one_table()
     wp = WPView(self.driver)
     touch(wp.template_object('table_select.png'))
     touch(wp.template_object('copy.png'))
     touch(wp.template_object('table_select.png'))
     touch(wp.template_object('delete_table.png'))
     time.sleep(2)
     if wp.exist('//*[@text=" Font Color "]'):
         wp.fold_expand()
     text("YOZOYOZOYOZO")
     text("YOZOYOZOYOZO")
     if not exists(wp.template_object('point.png')):
         wp.get_element(
             '//*[@resource-id="com.yozo.office.en:id/yozo_ui_app_frame_office_view_container"]'
         ).click()
     touch(wp.template_object('point.png'))
     touch(wp.template_object('selectAll.png'))
     touch(wp.template_object('cut.png'))
     wp.group_button_click(' Insert ')
     wp.insert_example_table()
     touch(wp.template_object('table_select.png'))
     touch(wp.template_object('paste.png'))
     touch(wp.template_object('table_select.png'))
     touch(wp.template_object('clear.png'))
     touch(wp.template_object('table_select.png'))
     touch(wp.template_object('cut.png'))
Exemplo n.º 7
0
 def test_wp_table_merge_split(self):
     logging.info('==========%s==========' % self.__str__().split(' ')[0])
     self.wp_insert_one_table()
     wp = WPView(self.driver)
     touch(wp.template_object('table_select.png'))
     if not wp.exist(
             '//*[@resource-id="com.yozo.office.en:id/yozo_ui_option_content_container"]'
     ):
         wp.fold_expand()
     wp.table_merge_split()
     time.sleep(10)
Exemplo n.º 8
0
    def test_wp_pic_free_rotate(self, type1='wp'):
        self.insert_one_pic(type1)
        wp = WPView(self.driver)
        s = wp.swipe_option('up')
        while not wp.exist('//*[@text=" Text Wrapping "]'):
            wp.swipe(s[0], s[1], s[2], s[3])
        wp.text_wrap(' Square ')
        # 属性调整大小
        cc = "com.yozo.office.en:id/yozo_ui_%s_option_id_picture_edit" % type1
        while not wp.exist('//*[@resource-id="%s"]' % cc):
            wp.swipe(s[2], s[3], s[0], s[1])
        wp.get_element('//*[@resource-id="%s"]'
                       '/android.widget.FrameLayout[5]' % cc).click()
        wp.shape_option_5()
        if wp.exist(
                '//*[@resource-id="com.yozo.office.en:id/yozo_ui_option_content_container"]'
        ):
            wp.fold_expand()
        ele5 = wp.get_element_xy(
            '//*[@resource-id="com.yozo.office.en:id/yozo_ui_app_frame_office_view_container"]'
        )
        ele9 = wp.get_element_xy(
            '//*[@resource-id="com.yozo.office.en:id/yozo_ui_app_frame_office_view_container"]',
            x_y=9)
        while not exists(wp.template_object('rotate_free.png')):
            wp.swipe(ele5[0], ele5[1], ele9[0], ele9[1])
        # 向右移动图片
        rotate_free = loop_find(wp.template_object('rotate_free.png'))
        wp.swipe(rotate_free[0], rotate_free[1] + 200, rotate_free[0] + 200,
                 rotate_free[1] + 200)
        # 取消选中图片
        wp.tap(ele9[0], ele9[1])
        time.sleep(1)
        self.assertTrue(wp.exist('//*[@text="编辑"]'), msg='取消选中图片异常')

        # 选中图片
        wp.tap(rotate_free[0] + 200, rotate_free[1] + 200)
        time.sleep(1)
        self.assertTrue(wp.exist('//*[@text="图片"]'), msg='选中图片异常')
        # 自由旋转
        rotate_free = loop_find(wp.template_object('rotate_free.png'))
        wp.swipe(rotate_free[0], rotate_free[1], ele9[0], ele9[1])
        rotate_free2 = loop_find(wp.template_object('rotate_free.png'))
        self.assertEqual(rotate_free, rotate_free2, msg='图片自由旋转失败')
Exemplo n.º 9
0
 def test_wp_pic_order(self, type1='wp'):
     # type1 = 'wp'
     self.insert_one_pic(type1)
     wp = WPView(self.driver)
     s = wp.swipe_option('up')
     if type1 == 'wp':
         while not wp.exist('//*[@text=" Text Wrapping "]'):
             wp.swipe(s[0], s[1], s[2], s[3])
         wp.text_wrap(' Square ')
     cc = "com.yozo.office.en:id/yozo_ui_%s_option_id_picture_edit" % type1
     if type1 == 'wp':
         while not wp.exist('//*[@resource-id="%s"]' % cc):
             wp.swipe(s[2], s[3], s[0], s[1])
     wp.get_element('//*[@resource-id="%s"]'
                    '/android.widget.FrameLayout[5]' % cc).click()
     # 属性调整大小
     wp.shape_option_5()
     if wp.exist(
             '//*[@resource-id="com.yozo.office.en:id/yozo_ui_option_content_container"]'
     ):
         wp.fold_expand()
     pic_png = 'drag_pic.png'
     touch(wp.template_object(pic_png))
     touch(wp.template_object('copy.png'))
     touch(wp.template_object(pic_png))
     touch(wp.template_object('paste.png'))
     touch(wp.template_object(pic_png))
     touch(wp.template_object('paste.png'))
     if not wp.exist(
             '//*[@resource-id="com.yozo.office.en:id/yozo_ui_option_content_container"]'
     ):
         wp.fold_expand()
     ele1 = '//*[@text=" Picture "]'
     ele2 = '//*[@text=" Outline "]'
     wp.swipe_ele(ele2, ele1)
     wp.shape_layer(' Bring to Front ')
     wp.shape_layer(' Send Backward ')
     wp.shape_layer(' Bring Forward ')
     wp.shape_layer(' Send to Back ')
     if type1 == 'wp':
         wp.shape_layer(' Behind Text ')
         wp.shape_layer(' In Front of Text ')