def test_wp_pic_width_to_height(self, type1='wp'): self.insert_one_pic(type1) wp = WPView(self.driver) if type1 == 'wp': s = wp.swipe_option('up') while not wp.exist('//*[@text=" Text Wrapping "]'): wp.swipe(s[0], s[1], s[2], s[3]) wp.text_wrap(' Square ') ele1 = '//*[@resource-id="com.yozo.office.en:id/yozo_ui_wp_option_id_picture_broad"]' ele2 = '//*[@text=" Text Wrapping "]' wp.swipe_ele(ele1, ele2) cc = "com.yozo.office.en:id/yozo_ui_%s_option_id_picture_edit" % type1 wp.get_element('//*[@resource-id="%s"]' '/android.widget.FrameLayout[5]' % cc).click() # 属性调整大小 wp.shape_option_5()
def test_wp_pic_order(self, type1='wp'): # type1 = 'wp' self.insert_one_pic(type1) wp = WPView(self.driver) s = wp.swipe_option('up') if type1 == 'wp': while not wp.exist('//*[@text=" Text Wrapping "]'): wp.swipe(s[0], s[1], s[2], s[3]) wp.text_wrap(' Square ') cc = "com.yozo.office.en:id/yozo_ui_%s_option_id_picture_edit" % type1 if type1 == 'wp': while not wp.exist('//*[@resource-id="%s"]' % cc): wp.swipe(s[2], s[3], s[0], s[1]) wp.get_element('//*[@resource-id="%s"]' '/android.widget.FrameLayout[5]' % cc).click() # 属性调整大小 wp.shape_option_5() if wp.exist( '//*[@resource-id="com.yozo.office.en:id/yozo_ui_option_content_container"]' ): wp.fold_expand() pic_png = 'drag_pic.png' touch(wp.template_object(pic_png)) touch(wp.template_object('copy.png')) touch(wp.template_object(pic_png)) touch(wp.template_object('paste.png')) touch(wp.template_object(pic_png)) touch(wp.template_object('paste.png')) if not wp.exist( '//*[@resource-id="com.yozo.office.en:id/yozo_ui_option_content_container"]' ): wp.fold_expand() ele1 = '//*[@text=" Picture "]' ele2 = '//*[@text=" Outline "]' wp.swipe_ele(ele2, ele1) wp.shape_layer(' Bring to Front ') wp.shape_layer(' Send Backward ') wp.shape_layer(' Bring Forward ') wp.shape_layer(' Send to Back ') if type1 == 'wp': wp.shape_layer(' Behind Text ') wp.shape_layer(' In Front of Text ')
def test_wp_font_attr(self): logging.info('==========test_wp_font_attr===========') cv = CreateView(self.driver) cv.create_file(self.file_type) time.sleep(1) wp = WPView(self.driver) wp.group_button_click(' Edit ') wp.font_size(16) wp.font_style(self.file_type, '倾斜') wp.font_color(self.file_type, 3) ele1 = '//*[@text=" Edit "]' ele2 = '//*[@text=" Font Color "]' ele3 = '//*[@text=" Highlight Color "]' ele4 = '//*[@text=" Columns "]' wp.swipe_ele(ele2, ele1) time.sleep(1) wp.tap(450, 450) for i in range(100): self.driver.press_keycode(random.randint(29, 54)) wp.group_button_click(' Edit ') wp.drag_coordinate(450, 500, 200, 500) wp.high_light_color(self.file_type, 3) wp.bullets_numbers(self.file_type, 6, 14) wp.text_align(self.file_type, '右对齐') wp.swipe_ele(ele3, ele1) wp.text_line_space(self.file_type, 2.5) wp.text_indent(self.file_type, '右缩进') wp.swipe_ele(ele4, ele1) wp.text_columns(4) wp.text_columns(3) wp.text_columns(2) time.sleep(3)