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)
Exemple #2
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)