예제 #1
0
    def test_shape_attr1(self):
        logging.info('==========test_shape_attr1==========')
        cv = CreateView(self.driver)
        cv.create_file('ss', 0)
        gv = GeneralView(self.driver)
        gv.group_button_click('插入')
        type = 'ss'
        gv.insert_shape('ss', 1)
        time.sleep(1)
        gv.tap(700, 767, 4)  # 双击进入编辑
        for i in range(100):
            self.driver.press_keycode(random.randint(7, 16))
        gv.group_button_click('编辑')

        gv.shape_option(type, 5, width=5, height=5)
        gv.shape_option(type, 6, top=0.5, bottom=0.5, left=0.5, right=0.5)
        ele1 = '//*[@resource-id="com.yozo.office:id/yozo_ui_ss_option_id_shape_quick_function"]'
        ele2 = '//*[@text="轮廓"]'
        ele3 = '//*[@text="效果"]'
        gv.swipe_ele(ele2, ele1)
        gv.swipe_ele(ele3, ele2)
        gv.shape_content_align(type, '右对齐', '下对齐')
        gv.shape_content_align(type)
        gv.shape_content_align(type, '水平居中', '垂直居中')
        time.sleep(3)
예제 #2
0
    def test_shape_attr1(self, file_type):  # 文本框字符属性
        logging.info('==========test_shape_attr1==========')
        cv = CreateView(self.driver)
        cv.create_file(file_type)
        gv = GeneralView(self.driver)
        x1, y1 = 0, 0
        if file_type == 'ss':
            ss = SSView(self.driver)
            x1, y1, w, h = ss.cell_location()
            self.driver.find_element(
                By.ID, 'com.yozo.office.en:id/formulabar_ok').click()

        gv.group_button_click(' Insert ')
        gv.insert_shape(file_type)
        time.sleep(1)
        x, y = gv.find_pic_position('drag_all')
        gv.tap(x, y)  # 进入编辑
        gv.pop_menu_click('editText')

        if file_type == 'ss':
            gv.fold_expand()
            gv.fold_expand()
            x, y = gv.find_pic_position('drag_all')
            gv.tap(x, y)  # 进入编辑
            gv.pop_menu_click('editText')

        for i in range(50):
            self.driver.press_keycode(random.randint(7, 16))

        if file_type == 'pg':
            gv.tap(250, 250)
            gv.tap(550, 850)
        elif file_type == 'ss':
            gv.tap(x1, y1)
            gv.tap(x, y)
        else:
            gv.tap(250, 450)
            time.sleep(1)
            gv.fold_expand()
            gv.tap(x, y)
            time.sleep(1)
        gv.fold_expand()

        gv.shape_option(file_type, 5, width=5, height=5)
        gv.shape_option(file_type, 6, top=0.5, bottom=0.5, left=0.5, right=0.5)
        ele1 = '//*[@text=" Shape "]'
        ele2 = '//*[@text=" Outline "]'
        ele3 = '//*[@text=" Effect "]'
        if file_type == 'pg':
            ele0 = '//*[@text=" Insert "]'
            gv.swipe_ele(ele0, ele1)
        gv.swipe_ele(ele2, ele1)
        gv.swipe_ele(ele3, ele1)
        gv.shape_content_align(file_type, '右对齐', '下对齐')
        gv.shape_content_align(file_type)
        gv.shape_content_align(file_type, '水平居中', '垂直居中')
        time.sleep(3)