def test_cell_insert_delete_fit(self): # 插入删除行宽列高清除 logging.info('==========test_cell_inser_delete_fit==========') cv = CreateView(self.driver) type = 'ss' 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(20): self.driver.press_keycode(45) self.driver.find_element(By.ID, 'com.yozo.office:id/formulabar_ok').click() ss = SSView(self.driver) ss.group_button_click('编辑') gv = GeneralView(self.driver) gv.font_style(type, '删除线') ele1 = '//*[@text="编辑"]' ele2 = '//*[@text="字体颜色"]' ele3 = '//*[@text="单元格填充"]' ele4 = '//*[@text="数字格式"]' ele5 = '//*[@text="插入单元格"]' ele6 = '//*[@text="删除单元格"]' ele7 = '//*[@text="设置行高列宽"]' ss.swipe_ele(ele2, ele1) ss.swipe_ele(ele3, ele1) ss.swipe_ele(ele4, ele1) ss.cell_insert('右移') ss.cell_insert('下移') ss.cell_insert('插入整行') ss.cell_insert('插入整列') ss.cell_delete('删除整列') ss.cell_delete('删除整行') ss.cell_delete('上移') ss.cell_delete('左移') ss.swipe_ele(ele5, ele1) ss.cell_set_size(5, 5) ss.group_button_click('编辑') ss.cell_clear('清除格式') gv.undo_option() ss.cell_clear('清除内容') gv.undo_option() ss.cell_clear('清除所有') gv.undo_option() ss.swipe_ele(ele6, ele7) ss.cell_fit_height() ss.cell_fit_width() time.sleep(3)
def test_ss_cell_options(self): # 插入删除行宽列高清除 logging.info('==========test_ss_cell_options==========') cv = CreateView(self.driver) cv.create_file('ss') ss = SSView(self.driver) ss.cell_edit() # x, y, width, height = ss.cell_location() # ss.tap(x - width * 2, y - height * 4) # ss.cell_edit() for i in range(20): self.driver.press_keycode(45) self.driver.find_element( By.ID, 'com.yozo.office.en:id/formulabar_ok').click() ss.group_button_click(' Edit ') gv = GeneralView(self.driver) gv.font_style(self.file_type, '删除线') ele = '//*[@resource-id="com.yozo.office.en:id/yozo_ui_option_content_container"]' ss.swipe_options(ele, 'up') ss.swipe_options(ele, 'up') ss.swipe_options(ele, 'up') ss.swipe_options(ele, 'up') ss.cell_insert('右移') ss.cell_insert('下移') ss.cell_insert('插入整行') ss.cell_insert('插入整列') ss.cell_delete('删除整列') ss.cell_delete('删除整行') ss.cell_delete('上移') ss.cell_delete('左移') ss.cell_clear('清除格式') gv.undo_option() ss.cell_clear('清除内容') gv.undo_option() ss.cell_clear('清除所有') gv.undo_option() ss.swipe_options(ele, 'up') ss.cell_set_size(5, 5) ss.group_button_click(' Edit ') ss.swipe_options(ele, 'down') ss.cell_fit_height() ss.cell_fit_width() time.sleep(1)