Beispiel #1
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()
Beispiel #2
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'))  # 删除
Beispiel #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)))
Beispiel #4
0
 def test_wp_table_left_rows(self):
     self.wp_insert_one_table()
     wp = WPView(self.driver)
     ele = '//*[@resource-id="com.yozo.office.en:id/yozo_ui_app_frame_office_view_container"]'
     e7 = wp.get_element_xy(ele, x_y=7)
     e9 = wp.get_element_xy(ele, x_y=9)
     #  Insert 行
     while not exists(wp.template_object('table_select.png')):
         wp.swipe(e7[0], e7[1], e9[0], e9[1])
     touch(wp.template_object('table_cols_rows.png'))
Beispiel #5
0
 def test_wp_table_attr_5_delete_table(self):
     self.wp_insert_one_table()
     wp = WPView(self.driver)
     s = wp.swipe_option('up')
     while not wp.exist(
             '//*[@resource-id="com.yozo.office.en:id/yozo_ui_wp_table_option_id_delete_table"]'
     ):
         wp.swipe(s[0], s[1], s[2], s[3])
     wp.table_delete_row_col_all(del0='row')
     wp.table_delete_row_col_all(del0='col')
     wp.table_delete_row_col_all(del0='all')
Beispiel #6
0
 def test_wp_pic_text_round(self):
     # 仅wp存在文字环绕功能
     self.insert_one_pic('wp')
     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 ')
     wp.text_wrap(' In Line with Text ')
     wp.text_wrap(' Tight ')
     wp.text_wrap(' Behind Text ')
     wp.text_wrap()
Beispiel #7
0
 def test_wp_table_attr_4_insert_row_col(self):
     self.wp_insert_one_table()
     wp = WPView(self.driver)
     s = wp.swipe_option('up')
     while not wp.exist(
             '//*[@resource-id="com.yozo.office.en:id/yozo_ui_wp_table_option_id_insert_table"]'
     ):
         wp.swipe(s[0], s[1], s[2], s[3])
     wp.table_insert_row_col(direction='up')
     wp.table_insert_row_col(direction='down')
     wp.table_insert_row_col(direction='left')
     wp.table_insert_row_col(direction='light')
Beispiel #8
0
 def test_wp_table_size(self):
     self.wp_insert_one_table()
     wp = WPView(self.driver)
     ele = '//*[@resource-id="com.yozo.office.en:id/yozo_ui_app_frame_office_view_container"]'
     e7 = wp.get_element_xy(ele, x_y=7)
     e9 = wp.get_element_xy(ele, x_y=9)
     # 改变表格大小
     while not exists(wp.template_object('table_size.png')):
         wp.swipe(e9[0], e9[1], e7[0], e7[1])
     swipe(wp.template_object('table_size.png'),
           wp.get_element_xy(ele, x_y=4))
     time.sleep(5)
Beispiel #9
0
 def test_wp_shape_text_round(self):
     # 仅wp存在文字环绕功能
     self.insert_one_shape('wp')
     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])
     list_wrap = [
         ' Square ', ' In Line with Text ', ' Tight ', ' Behind Text ',
         ' In Front of Text '
     ]
     for i in list_wrap:
         wp.text_wrap(i)
Beispiel #10
0
    def test_wp_insert_chart_list(self, chart_type):
        cv = CreateView(self.driver)
        cv.create_file('wp')
        wp = WPView(self.driver)
        wp.group_button_click(' Insert ')
        s = wp.swipe_option('up')
        while not wp.exist('//*[@text=" Chart "]'):
            wp.swipe(s[0], s[1], s[2], s[3])
        wp.get_element('//*[@text=" Chart "]').click()

        while not wp.exist('//*[@text="%s"]' % chart_type):
            wp.swipe(s[0], s[1], s[2], s[3])
        wp.get_element('//*[@text="%s"]' % chart_type).click()
        wp.chart_insert_list('%s' % chart_type)
Beispiel #11
0
 def test_wp_pic_width_to_height(self, type1='wp'):
     self.insert_one_pic(type1)
     wp = WPView(self.driver)
     if type1 == 'wp':
         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 ')
         ele1 = '//*[@resource-id="com.yozo.office.en:id/yozo_ui_wp_option_id_picture_broad"]'
         ele2 = '//*[@text=" Text Wrapping "]'
         wp.swipe_ele(ele1, ele2)
     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()
Beispiel #12
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='图片自由旋转失败')
Beispiel #13
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 ')