def test_wp_shape_text_attr(self): # 自选图形文本属性,仅WP和PG logging.info('==========test_wp_shape_text_attr==========') cv = CreateView(self.driver) cv.create_file(self.file_type) gv = GeneralView(self.driver) gv.group_button_click(' Insert ') gv.insert_shape(self.file_type, 1) gv.tap(680, 750) gv.pop_menu_click('editText') time.sleep(1) gv.group_button_click(' Edit ') gv.font_name(self.file_type, 'AndroidClock') gv.font_size(15) gv.font_style(self.file_type, '倾斜') gv.font_color(self.file_type, 6, 29) gv.swipe_ele('//*[@text=" Font Color "]', '//*[@text=" Edit "]') time.sleep(1) for i in range(20): self.driver.press_keycode(random.randint(29, 54)) time.sleep(1) gv.swipe_ele('//*[@text=" Highlight Color "]', '//*[@text=" Edit "]') gv.drag_coordinate(680, 750, 680, 600) gv.high_light_color(self.file_type, 6, random.randint(1, 15)) gv.bullets_numbers(self.file_type, 6, 10) gv.text_align(self.file_type, '分散对齐') gv.text_align(self.file_type, '右对齐') gv.text_line_space(self.file_type, 1.5) gv.text_line_space(self.file_type, 3) gv.text_indent(self.file_type, '右缩进') gv.text_indent(self.file_type, '右缩进') gv.text_indent(self.file_type, '左缩进') time.sleep(3)
def test_shape_text_attr_pg(self): # 自选图形文本属性,仅WP和PG logging.info('==========test_shape_text_attr_pg==========') type = 'pg' cv = CreateView(self.driver) cv.create_file(type) gv = GeneralView(self.driver) gv.group_button_click('插入') gv.insert_shape(type, 1) gv.group_button_click('编辑') gv.font_name(type, 'AndroidClock') gv.font_size(15) gv.font_style(type, '倾斜') gv.font_color(type, 6, 29) gv.swipe_ele('//*[@text="字体颜色"]', '//*[@text="编辑"]') time.sleep(1) gv.tap(550, 450) time.sleep(1) gv.tap(550, 450, 6) time.sleep(1) for i in range(20): self.driver.press_keycode(random.randint(29, 54)) time.sleep(1) gv.group_button_click('编辑') # gv.high_light_color(type,6,6) gv.bullets_numbers(type, 6, 10) gv.text_align(type, '分散对齐') gv.text_align(type, '右对齐') gv.text_line_space(type, 1.5) gv.text_line_space(type, 3) gv.text_indent(type, '右缩进') gv.text_indent(type, '右缩进') gv.text_indent(type, '左缩进') time.sleep(3)
def test_shape_text_attr_pg(self): # 自选图形文本属性,仅WP和PG logging.info('==========test_shape_text_attr_pg==========') cv = CreateView(self.driver) cv.create_file(self.file_type) gv = GeneralView(self.driver) gv.group_button_click(' Insert ') gv.insert_shape(self.file_type, 1) gv.group_button_click(' Edit ') gv.font_name(self.file_type, 'AndroidClock') gv.font_size(15) gv.font_style(self.file_type, '倾斜') gv.font_color(self.file_type, 6, 29) gv.swipe_ele('//*[@text=" Font Color "]', '//*[@text=" Edit "]') gv.fold_expand() time.sleep(1) x, y = gv.find_pic_position('drag_all') gv.tap(x, y) # 进入 Edit gv.pop_menu_click('editText') for i in range(20): self.driver.press_keycode(random.randint(29, 54)) time.sleep(1) gv.group_button_click(' Edit ') gv.bullets_numbers('pg', 6, 10) gv.text_align(self.file_type, '分散对齐') gv.text_align(self.file_type, '右对齐') gv.text_line_space(self.file_type, 1.5) gv.text_line_space(self.file_type, 3) gv.text_indent(self.file_type, '右缩进') gv.text_indent(self.file_type, '右缩进') gv.text_indent(self.file_type, '左缩进') time.sleep(3)
def test_ss_cell_select(self): logging.info('==========test_ss_cell_select==========') cv = CreateView(self.driver) ss = SSView(self.driver) cv.create_file('ss') ss.cell_edit() self.driver.press_keycode(45) self.driver.press_keycode(45) self.driver.press_keycode(45) self.driver.press_keycode(45) self.driver.find_element( By.ID, 'com.yozo.office.en:id/formulabar_ok').click() gv = GeneralView(self.driver) gv.group_button_click(' Edit ') gv.font_name(self.file_type) gv.font_size(23) gv.font_style(self.file_type, '加粗') gv.font_style(self.file_type, '倾斜') gv.font_style(self.file_type, '删除线') gv.font_style(self.file_type, '下划线') gv.font_color(self.file_type) ele = '//*[@resource-id="com.yozo.office.en:id/yozo_ui_option_content_container"]' ss.swipe_options(ele, 'up') ss.cell_color() ss.cell_align('水平居中', '下对齐')
def test_font_attr(self): logging.info('==========test_font_attr==========') cv = CreateView(self.driver) cv.create_file('ss') time.sleep(1) cv.tap(110 + 263 * 1.5, 295 + 55 * 1.5) # 双击进入编辑 cv.tap(110 + 263 * 1.5, 295 + 55 * 1.5) for i in range(5): self.driver.press_keycode(45) self.driver.find_element(By.ID, 'com.yozo.office:id/formulabar_ok').click() gv = GeneralView(self.driver) gv.group_button_click('编辑') type = 'ss' gv.font_name(type) gv.font_size(23) gv.font_style(type, '加粗') gv.font_style(type, '倾斜') gv.font_style(type, '删除线') gv.font_style(type, '下划线') gv.font_color(type)
def test_ss_cell_edit(self): logging.info('==========test_ss_cell_edit==========') cv = CreateView(self.driver) ss = SSView(self.driver) cv.create_file('ss') ss.cell_edit() gv = GeneralView(self.driver) gv.group_button_click(' Edit ') gv.font_name(self.file_type) gv.font_size(23) gv.font_style(self.file_type, '加粗') gv.font_style(self.file_type, '倾斜') gv.font_style(self.file_type, '删除线') gv.font_style(self.file_type, '下划线') gv.font_color(self.file_type) for i in range(5): self.driver.press_keycode(45) self.driver.find_element( By.ID, 'com.yozo.office.en:id/formulabar_ok').click()