Ejemplo n.º 1
0
    def test_insert_chart1(self, file_type):
        logging.info('==========test_insert_chart1==========')
        cv = CreateView(self.driver)
        cv.create_file(file_type)
        gv = GeneralView(self.driver)
        ss = SSView(self.driver)

        time.sleep(1)
        if file_type == 'ss':
            x, y, width, height = ss.cell_location()
            for i in range(3):
                cv.tap(x + width * 0.5, y + height * (i + 0.5))
                ss.cell_edit()  # 双击进入编辑
                self.driver.press_keycode(random.randint(7, 16))
            gv.drag_coordinate(x, y + height * 2, x, y)

        gv.group_button_click(' Insert ')
        if file_type == 'pg':
            ele1 = '//*[@text=" Slide "]'
            ele2 = '//*[@text=" Picture "]'
            gv.swipe_ele(ele2, ele1)
        gv.insert_chart_insert(' Column Chart ', random.randint(1, 9))
        gv.chart_color(random.randint(1, 8))
        gv.chart_element(file_type, '大标题', 1, 1, 1)
        gv.chart_element_XY('x', 'x', 0, 1, 1, 1, 1, 1)
        gv.chart_element_XY('y', 'y', 0, 1, 1, 0, 1, 0)
        self.driver.find_element(
            By.ID, 'com.yozo.office.en:id/yozo_ui_option_back_button').click()
        gv.change_row_column()
        time.sleep(3)
Ejemplo n.º 2
0
    def test_insert_chart(self, type):  # 插入图表,仅ss,pg
        logging.info('==========test_insert_chart==========')
        chart_list = ['柱形图', '条形图', '折线图', '饼图', '散点图', '面积图', '圆环图', '雷达图', '圆柱图', '圆锥图',
                      '棱锥图']
        cv = CreateView(self.driver)
        cv.create_file(type)
        gv = GeneralView(self.driver)

        time.sleep(1)
        if type == 'ss':
            for i in range(3):
                cv.tap(110 + 263 * 1.5, 295 + 55 * (1.5 + i))  # 双击进入编辑
                cv.tap(110 + 263 * 1.5, 295 + 55 * (1.5 + i))
                self.driver.press_keycode(random.randint(7, 16))
            gv.drag_coordinate(110 + 263 * 2, 295 + 55 * 2, 110 + 263 * 2, 295 + 55 * 4)

        for i in chart_list:
            gv.group_button_click('插入')
            gv.insert_chart_insert(i, random.randint(1, 9))
            gv.chart_template()
        ele1 = '//*[@text="图表类型"]'
        ele2 = '//*[@text="图表元素"]'
        gv.swipe_ele(ele2, ele1)
        gv.shape_layer('下移一层')
        gv.shape_layer('置于底层')
        gv.shape_layer('上移一层')
        gv.shape_layer()

        time.sleep(3)
Ejemplo n.º 3
0
    def test_merge_wrap(self):
        logging.info('==========test_merge_wrap==========')
        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(20):
            self.driver.press_keycode(45)
        self.driver.find_element(By.ID, 'com.yozo.office:id/formulabar_ok').click()
        cv.drag_coordinate(110 + 263 * 2, 295 + 55 * 2, 110 + 263 * 3, 295 + 55 * 2)

        ss = SSView(self.driver)
        ss.group_button_click('编辑')
        ele1 = '//*[@text="编辑"]'
        ele2 = '//*[@text="字体颜色"]'
        ele3 = '//*[@text="单元格填充"]'
        ele4 = '//*[@text="数字格式"]'
        ss.swipe_ele(ele2, ele1)
        ss.swipe_ele(ele3, ele1)
        ss.swipe_ele(ele4, ele1)
        ss.cell_merge_split()
        ss.cell_merge_split()
        ss.cell_auto_wrap()
        ss.cell_auto_wrap()
        time.sleep(3)
Ejemplo n.º 4
0
    def test_copy(self):  # 复制,先不写
        logging.info('==========test_zoom==========')
        cv = CreateView(self.driver)
        cv.create_file('ss', 0)
        time.sleep(1)

        cv.tap(110 + 263, 295 + 55)  # 选中单元格
        cv.drag_coordinate(110 + 263 * 2, 295 + 55 * 2, 110 + 263 * 3,
                           295 + 55 * 2)
Ejemplo n.º 5
0
    def test_pop_cell_row_col1(self):  # 单元格、行、列相关操作
        logging.info('==========test_pop_cell_row_col1==========')
        cv = CreateView(self.driver)
        cv.create_file(self.file_type)
        gv = GeneralView(self.driver)
        ss = SSView(self.driver)
        time.sleep(1)
        x, y, width, height = ss.cell_location()  # 新建默认B8
        ss.cell_edit()  # 进入 Edit
        for i in range(8):
            self.driver.press_keycode(random.randint(29, 54))
        self.driver.find_element(
            By.ID, 'com.yozo.office.en:id/formulabar_ok').click()
        time.sleep(0.5)
        cv.tap(x + width * 0.5, y + height * 0.5)  # 复制粘贴
        gv.pop_menu_click('copy')
        cv.tap(x + width * 1.5, y + height * 1.5)
        cv.tap(x + width * 1.5, y + height * 1.5)
        gv.pop_menu_click('paste')

        cv.tap(x + width * 0.5, y + height * 0.5)
        gv.pop_menu_click('cut')
        cv.tap(x + width * 2.5, y + height * 2.5)
        cv.tap(x + width * 2.5, y + height * 2.5)
        gv.pop_menu_click('paste')

        x, y = gv.find_pic_position('drag_point2')  # 多选单元格
        gv.drag_coordinate(x, y, x + width, y + height)
Ejemplo n.º 6
0
    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)
Ejemplo n.º 7
0
    def test_pop_cell_row_col3(self):  # 单元格、行、列相关操作
        logging.info('==========test_pop_cell_row_col3==========')
        cv = CreateView(self.driver)
        cv.create_file(self.file_type)
        gv = GeneralView(self.driver)
        ss = SSView(self.driver)
        time.sleep(1)

        x, y, width, height = ss.cell_location()  # 新建默认B8
        cv.tap(x + width * 0.5, y - height * 5.5)
        ss.cell_edit()  # 进入 Edit
        for i in range(8):
            self.driver.press_keycode(random.randint(29, 54))
        self.driver.find_element(
            By.ID, 'com.yozo.office.en:id/formulabar_ok').click()
        time.sleep(0.5)

        x1, y1, x2, y2 = ss.row_col_loc()
        ss.tap(x2 + width * 1.5, y2 - 10)
        gv.pop_menu_click('insert')
        ss.tap(x2 + width * 1.5, y2 - 10)
        gv.pop_menu_click('delete')
        ss.tap(x2 + width * 1.5, y2 - 10)
        gv.pop_menu_click('copy')
        ss.tap(x2 + width * 2.5, y2 - 10)
        x3, y3 = gv.find_pic_position('copy')
        x4, y4 = gv.find_pic_position('insert')
        gv.swipe(x3, y3, x4, y4)
        time.sleep(1)
        gv.pop_menu_click('paste')
        ss.tap(x2 + width * 1.5, y2 - 10)
        gv.pop_menu_click('cut')
        ss.tap(x2 + width * 2.5, y2 - 10)
        gv.pop_menu_click('paste')
        ss.tap(x2 + width * 1.5, y2 - 10)
        gv.pop_menu_click('hide')
        ss.tap(x2 + width * 1.5, y2 - 10)
        x3, y3 = gv.find_pic_position('hide')
        x4, y4 = gv.find_pic_position('copy')
        gv.swipe(x3, y3, x4, y4)
        time.sleep(1)
        gv.pop_menu_click('hide_cancel')
        ss.tap(x2 + width * 1.5, y2 - 10)
        x, y = gv.find_pic_position('column_right')
        gv.drag_coordinate(x, y, x + width, y)
        gv.drag_coordinate(x, y2 - 10, x + width, y2 - 10)
Ejemplo n.º 8
0
    def test_cell_attr(self):
        logging.info('==========test_cell_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)
        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:id/formulabar_ok').click()

        ss = SSView(self.driver)
        ss.group_button_click('编辑')
        time.sleep(1)
        self.driver.swipe(200, 1856, 200, 1150, 2000)
        ss.cell_align('水平居中', '下对齐')
Ejemplo n.º 9
0
 def test_table_style(self):  # 表格样式
     logging.info('==========test_table_style==========')
     cv = CreateView(self.driver)
     cv.create_file('ss')
     time.sleep(1)
     cv.tap(110 + 263 * 1.5, 295 + 55 * 1.5)
     cv.drag_coordinate(110 + 263 * 2, 295 + 55 * 2, 110 + 263 * 3, 295 + 55 * 4)
     ss = SSView(self.driver)
     ss.group_button_click('编辑')
     ele1 = '//*[@text="编辑"]'
     ele2 = '//*[@text="字体颜色"]'
     ele3 = '//*[@text="单元格填充"]'
     ele4 = '//*[@text="数字格式"]'
     ele5 = '//*[@text="插入单元格"]'
     ss.swipe_ele(ele2, ele1)
     ss.swipe_ele(ele3, ele1)
     ss.swipe_ele(ele4, ele1)
     ss.swipe_ele(ele5, ele1)
     ss.table_style()
Ejemplo n.º 10
0
 def test_table_style(self):  # 表格样式
     logging.info('==========test_table_style==========')
     cv = CreateView(self.driver)
     cv.create_file('ss', 0)
     time.sleep(1)
     cv.tap(110 + 263 * 1.5, 295 + 55 * 1.5)
     cv.drag_coordinate(110 + 263 * 2, 295 + 55 * 2, 110 + 263 * 3,
                        295 + 55 * 4)
     ss = SSView(self.driver)
     ss.group_button_click('编辑')
     ele1 = '//*[@resource-id="com.yozo.office:id/yozo_ui_ss_option_id_font_name"]'
     ele2 = '//*[@text="单元格填充"]'
     ele3 = '//*[@text="数字格式"]'
     ele4 = '//*[@text="插入单元格"]'
     ele5 = '//*[@text="设置行高列宽"]'
     ss.swipe_ele(ele2, ele1)
     ss.swipe_ele(ele3, ele2)
     ss.swipe_ele(ele4, ele3)
     ss.swipe_ele(ele5, ele4)
     ss.table_style()
Ejemplo n.º 11
0
 def test_table_style(self):  # 表格样式
     logging.info('==========test_table_style==========')
     cv = CreateView(self.driver)
     cv.create_file('ss')
     time.sleep(1)
     cv.tap(110 + 263 * 1.5, 295 + 55 * 1.5)
     cv.drag_coordinate(110 + 263 * 2, 295 + 55 * 2, 110 + 263 * 3,
                        295 + 55 * 4)
     ss = SSView(self.driver)
     ss.group_button_click(' Edit ')
     ele1 = '//*[@text=" Edit "]'
     ele2 = '//*[@text=" Font Color "]'
     ele3 = '//*[@text=" Cell Fill "]'
     ele4 = '//*[@text=" Number Format "]'
     ele5 = '//*[@text=" Insert Cell "]'
     ss.swipe_ele(ele2, ele1)
     ss.swipe_ele(ele3, ele1)
     ss.swipe_ele(ele4, ele1)
     ss.swipe_ele(ele5, ele1)
     ss.table_style()
Ejemplo n.º 12
0
    def test_num_style(self):
        logging.info('==========test_num_style==========')
        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)
        self.driver.press_keycode(15)
        self.driver.press_keycode(7)
        self.driver.press_keycode(7)
        self.driver.press_keycode(7)
        self.driver.find_element(By.ID, 'com.yozo.office:id/formulabar_ok').click()

        ss = SSView(self.driver)
        ss.group_button_click('编辑')
        ele1 = '//*[@text="编辑"]'
        ele2 = '//*[@text="字体颜色"]'
        ele3 = '//*[@text="单元格填充"]'
        ss.swipe_ele(ele2, ele1)
        ss.swipe_ele(ele3, ele1)
        ss.cell_num_style()
Ejemplo n.º 13
0
    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)
Ejemplo n.º 14
0
    def test_num_style(self):
        logging.info('==========test_cell_border==========')
        cv = CreateView(self.driver)
        cv.create_file('ss', 0)
        time.sleep(1)
        cv.tap(110 + 263 * 1.5, 295 + 55 * 1.5)  # 双击进入编辑
        cv.tap(110 + 263 * 1.5, 295 + 55 * 1.5)
        self.driver.press_keycode(15)
        self.driver.press_keycode(7)
        self.driver.press_keycode(7)
        self.driver.press_keycode(7)
        self.driver.find_element(By.ID,
                                 'com.yozo.office:id/formulabar_ok').click()

        ss = SSView(self.driver)
        ss.group_button_click('编辑')
        ele1 = '//*[@resource-id="com.yozo.office:id/yozo_ui_ss_option_id_font_name"]'
        ele2 = '//*[@text="单元格填充"]'
        ele3 = '//*[@text="数字格式"]'
        ss.swipe_ele(ele2, ele1)
        ss.swipe_ele(ele3, ele2)
        ss.cell_num_style()
Ejemplo n.º 15
0
    def test_insert_chart(self, file_type):  # Insert 图表,仅ss,pg
        logging.info('==========test_insert_chart==========')
        chart_list = [
            ' Column Chart ', ' Bar Chart ', ' Line Chart ', ' Pie Chart ',
            ' Scatter Chart ', ' Area Chart ', ' Doughnut Chart ',
            ' Radar Chart ', ' Bubble Chart ', ' Cylind Chart ',
            ' Cone Chart ', ' Pyramid Chart '
        ]
        cv = CreateView(self.driver)
        cv.create_file(file_type)
        gv = GeneralView(self.driver)
        ss = SSView(self.driver)

        time.sleep(1)
        if file_type == 'ss':
            x, y, width, height = ss.cell_location()
            for i in range(3):
                cv.tap(x + width * 0.5, y + height * (i + 0.5))
                ss.cell_edit()  # 双击进入编辑
                self.driver.press_keycode(random.randint(7, 16))
            gv.drag_coordinate(x, y + height * 2, x, y)

        for i in range(3):
            gv.group_button_click(' Insert ')
            if file_type == 'pg' and i == 0:
                ele1 = '//*[@text=" Slide "]'
                ele2 = '//*[@text=" Picture "]'
                gv.swipe_ele(ele2, ele1)
            gv.insert_chart_insert(chart_list[i], random.randint(1, 9))
            gv.chart_template()
        ele1 = '//*[@text=" Chart "]'
        ele2 = '//*[@text=" Chart Type "]'
        gv.swipe_ele(ele2, ele1)
        gv.shape_layer(' Send Backward ')
        gv.shape_layer(' Send to Back ')
        gv.shape_layer(' Bring Forward ')
        gv.shape_layer(' Bring to Front ')

        time.sleep(3)
Ejemplo n.º 16
0
    def test_pop_menu_cell_text(self):
        logging.info('==========test_pop_menu_cell_text==========')
        cv = CreateView(self.driver)
        cv.create_file(self.file_type)
        gv = GeneralView(self.driver)
        ss = SSView(self.driver)
        time.sleep(1)

        x, y, width, height = ss.cell_location()  # 新建默认B8
        cv.tap(x + width * 0.5, y - height * 5.5)  # 点击B2
        ss.cell_edit()  # 进入 Edit
        for i in range(15):
            self.driver.press_keycode(random.randint(29, 54))
        # time.sleep(1)
        gv.drag_coordinate(x + 200, y - height * 5.5, x + 50, y - height * 5.5)
        gv.pop_menu_click('copy')
        gv.tap(x + width * 0.5, y - height * 5.5)
        gv.pop_menu_click('paste')
        gv.drag_coordinate(x + 200, y - height * 5.5, x + 50, y - height * 5.5)
        gv.pop_menu_click('cut')
        gv.tap(x + width * 0.5, y - height * 5.5)
        gv.pop_menu_click('paste')

        gv.tap(x + width * 0.5, y - height * 5.5)
        gv.pop_menu_click('newline')

        self.driver.find_element(
            By.ID, 'com.yozo.office.en:id/formulabar_ok').click()
        gv.tap(x + width * 0.5, y - height * 5.5)
        gv.pop_menu_click('fill_data')
        x1, y1 = gv.find_pic_position('fill_down')
        gv.drag_coordinate(x1, y1, x1, y1 + height * 2)

        gv.tap(x + width * 0.5, y - height * 5.5)
        time.sleep(1)
        x2, y2 = gv.find_pic_position('fill_data')
        gv.swipe(x2, y2, x2 - width * 2, y2)
        gv.pop_menu_click('clear_content')
Ejemplo n.º 17
0
    def test_insert_chart1(self, type):
        logging.info('==========test_insert_chart1==========')
        cv = CreateView(self.driver)
        cv.create_file(type)
        gv = GeneralView(self.driver)

        time.sleep(1)
        if type == 'ss':
            for i in range(3):
                cv.tap(110 + 263 * 1.5, 295 + 55 * (1.5 + i))  # 双击进入编辑
                cv.tap(110 + 263 * 1.5, 295 + 55 * (1.5 + i))
                self.driver.press_keycode(random.randint(7, 16))
            gv.drag_coordinate(110 + 263 * 2, 295 + 55 * 2, 110 + 263 * 2, 295 + 55 * 4)

        gv.group_button_click('插入')
        gv.insert_chart_insert('柱形图', random.randint(1, 9))
        gv.chart_color(random.randint(1, 8))
        gv.chart_element(type, '大标题', 1, 1)
        gv.chart_element_XY('x', 0, 1, 1, 1, 1, 1)
        gv.chart_element_XY('y', 0, 1, 1, 0)
        self.driver.find_element(By.ID, 'com.yozo.office:id/yozo_ui_option_back_button').click()
        gv.change_row_column()
        time.sleep(3)
Ejemplo n.º 18
0
 def test_data_table(self):  # 数据排序,工作表格式
     logging.info('==========test_data_table==========')
     cv = CreateView(self.driver)
     cv.create_file('ss')
     time.sleep(1)
     for i in range(10):
         time.sleep(1)
         cv.tap(110 + 263 * 1.5, 295 + 55 * (1.5 + i))  # 双击进入编辑
         cv.tap(110 + 263 * 1.5, 295 + 55 * (1.5 + i))
         self.driver.press_keycode(random.randint(7, 16))
     ss = SSView(self.driver)
     ss.group_button_click('查看')
     time.sleep(1)
     ss.data_sort('降序')
     ss.data_sort('升序')
     ss.sheet_style('隐藏编辑栏')
     ss.sheet_style('隐藏编辑栏')
     ss.sheet_style('隐藏表头')
     ss.sheet_style('隐藏表头')
     ss.sheet_style('隐藏网格线')
     # ss.sheet_style('冻结窗口') 功能未完成
     # ss.sheet_style('取消冻结')
     ss.sheet_style('100%')
     time.sleep(3)
Ejemplo n.º 19
0
    def test_formula1(self):  # 其他类型公式
        logging.info('==========test_formula1==========')
        cv = CreateView(self.driver)
        cv.create_file('ss')
        time.sleep(1)
        for i in range(10):
            cv.tap(110 + 263 * 1.5, 295 + 55 * (1.5 + i))  # 双击进入编辑
            cv.tap(110 + 263 * 1.5, 295 + 55 * (1.5 + i))
            self.driver.press_keycode(random.randint(7, 16))
        ss = SSView(self.driver)

        cv.tap(110 + 263 * 2.5, 295 + 55 * 0.5)
        ss.formula_all('最近使用', 'MAX')
        cv.tap(110 + 263 * 1.5, 295 + 55 * 1.5)
        self.driver.find_element(By.ID, 'com.yozo.office:id/formulabar_ok').click()

        cv.tap(110 + 263 * 2.5, 295 + 55 * 1.5)
        ss.formula_all('数学和三角', 'ABS')
        cv.tap(110 + 263 * 1.5, 295 + 55 * 1.5)
        self.driver.find_element(By.ID, 'com.yozo.office:id/formulabar_ok').click()

        cv.tap(110 + 263 * 2.5, 295 + 55 * 2.5)
        ss.formula_all('财务', 'DOLLARDE')
        cv.tap(110 + 263 * 1.5, 295 + 55 * 1.5)
        time.sleep(0.5)
        cv.tap(110 + 263 * 1.5, 295 + 55 * 5.5)
        self.driver.find_element(By.ID, 'com.yozo.office:id/formulabar_ok').click()

        cv.tap(110 + 263 * 2.5, 295 + 55 * 3.5)
        ss.formula_all('逻辑', 'AND')
        cv.tap(110 + 263 * 1.5, 295 + 55 * 1.5)
        time.sleep(0.5)
        cv.tap(110 + 263 * 1.5, 295 + 55 * 5.5)
        self.driver.find_element(By.ID, 'com.yozo.office:id/formulabar_ok').click()

        cv.tap(110 + 263 * 2.5, 295 + 55 * 4.5)
        ss.formula_all('文本', 'ASC')
        cv.tap(110 + 263 * 1.5, 295 + 55 * 1.5)
        self.driver.find_element(By.ID, 'com.yozo.office:id/formulabar_ok').click()

        cv.tap(110 + 263 * 2.5, 295 + 55 * 5.5)
        ss.formula_all('日期和时间', 'NOW')
        self.driver.find_element(By.ID, 'com.yozo.office:id/formulabar_ok').click()

        cv.tap(110 + 263 * 2.5, 295 + 55 * 6.5)
        ss.formula_all('查找与引用', 'COLUMN')
        cv.tap(110 + 263 * 1.5, 295 + 55 * 1.5)
        self.driver.find_element(By.ID, 'com.yozo.office:id/formulabar_ok').click()

        cv.tap(110 + 263 * 2.5, 295 + 55 * 7.5)
        ss.formula_all('统计', 'AVERAGE')
        cv.tap(110 + 263 * 1.5, 295 + 55 * 1.5)
        self.driver.find_element(By.ID, 'com.yozo.office:id/formulabar_ok').click()

        # cv.tap(110 + 263 * 2.5, 295 + 55 * 8.5)
        # ss.formula_all('工程', 'DEC2BIN')
        # cv.tap(110 + 263 * 1.5, 295 + 55 * 1.5)
        # self.driver.find_element(By.ID, 'com.yozo.office:id/formulabar_ok').click()

        cv.tap(110 + 263 * 2.5, 295 + 55 * 9.5)
        ss.formula_all('信息', 'ISBLANK')
        cv.tap(110 + 263 * 1.5, 295 + 55 * 1.5)
        self.driver.find_element(By.ID, 'com.yozo.office:id/formulabar_ok').click()

        cv.tap(110 + 263 * 2.5, 295 + 55 * 10.5)
        ss.formula_all('所有公式', 'ABS')
        cv.tap(110 + 263 * 1.5, 295 + 55 * 1.5)
        self.driver.find_element(By.ID, 'com.yozo.office:id/formulabar_ok').click()
Ejemplo n.º 20
0
    def test_formula(self):
        logging.info('==========test_formula==========')
        cv = CreateView(self.driver)
        cv.create_file('ss')
        time.sleep(1)
        for i in range(10):
            cv.tap(110 + 263 * 1.5, 295 + 55 * (1.5 + i))  # 双击进入编辑
            cv.tap(110 + 263 * 1.5, 295 + 55 * (1.5 + i))
            self.driver.press_keycode(random.randint(7, 16))
        ss = SSView(self.driver)

        cv.tap(110 + 263 * 2.5, 295 + 55 * 1.5)  # 求和
        ss.auto_sum('求和')
        for i in range(10):
            time.sleep(1)
            cv.tap(110 + 263 * 1.5, 295 + 55 * (1.5 + i))
        self.driver.find_element(By.ID, 'com.yozo.office:id/formulabar_ok').click()

        cv.tap(110 + 263 * 2.5, 295 + 55 * 2.5)  # 平均值
        ss.auto_sum('平均值')
        for i in range(10):
            time.sleep(1)
            cv.tap(110 + 263 * 1.5, 295 + 55 * (1.5 + i))
        self.driver.find_element(By.ID, 'com.yozo.office:id/formulabar_ok').click()

        cv.tap(110 + 263 * 2.5, 295 + 55 * 3.5)  # 计数
        ss.auto_sum('计数')
        for i in range(10):
            time.sleep(1)
            cv.tap(110 + 263 * 1.5, 295 + 55 * (1.5 + i))
        self.driver.find_element(By.ID, 'com.yozo.office:id/formulabar_ok').click()

        cv.tap(110 + 263 * 2.5, 295 + 55 * 4.5)  # 最大值
        ss.auto_sum('最大值')
        for i in range(10):
            time.sleep(1)
            cv.tap(110 + 263 * 1.5, 295 + 55 * (1.5 + i))
        self.driver.find_element(By.ID, 'com.yozo.office:id/formulabar_ok').click()

        cv.tap(110 + 263 * 2.5, 295 + 55 * 5.5)  # 最小值
        ss.auto_sum('最小值')
        for i in range(10):
            time.sleep(1)
            cv.tap(110 + 263 * 1.5, 295 + 55 * (1.5 + i))
        self.driver.find_element(By.ID, 'com.yozo.office:id/formulabar_ok').click()
        time.sleep(3)