def del_message_group(self): flag=True time.sleep(2) mess = MessagePage() mess.wait_for_page_load() # 点击 + # 删除原来的群 while flag: mess.click_add_icon() # 点击 发起群聊 mess.click_group_chat() # 选择联系人界面,选择一个群 sc = SelectContactsPage() sc.click_select_one_group() time.sleep(1) from pages.groupset.GroupChatSet import GroupChatSetPage if self.get_elements(self.__locators['aaa']): self.click_element(self.__locators['aaa']) time.sleep(1) gcp = GroupChatPage() group_set = GroupChatSetPage() time.sleep(1) gcp.click_setting() time.sleep(1) sc.page_up() time.sleep(1) group_set.click_delete_and_exit() time.sleep(3) else: self.click_back_by_android() break
def create_multi_contacts_group(self,groupname='aaa',num=1,times=1): time.sleep(2) mess = MessagePage() mess.wait_for_page_load() # 点击 + mess.click_add_icon() # 点击 发起群聊 mess.click_group_chat() # 选择联系人界面,选择一个群 sc = SelectContactsPage() sc.click_select_one_group() time.sleep(1) from pages.groupset.GroupChatSet import GroupChatSetPage if self.get_elements(self.__locators['aaa']): self.click_element(self.__locators['aaa']) time.sleep(1) gcp = GroupChatPage() group_set = GroupChatSetPage() time.sleep(1) gcp.click_setting() time.sleep(1) sc.page_up() time.sleep(1) group_set.click_delete_and_exit() time.sleep(3) else: self.click_back_by_android() # mess.click_create_group() # 点击 + mess.click_add_icon() # 点击 发起群聊 mess.click_group_chat() mess.click_contact_group() while times>0: self.page_up() els=self.get_elements(self.__locators['aaa']) if els is None: break for i in range(num): time.sleep(1) els[i].click() times-=1 time.sleep(1) mess.click_sure_button() time.sleep(1) mess.click_group_name() time.sleep(1) mess.set_group_name(text=groupname) time.sleep(1) mess.click_sure_button() time.sleep(1)
def create_message_group(self,text='aaa'): time.sleep(2) mess = MessagePage() mess.wait_for_page_load() # 点击 + mess.click_add_icon() # 点击 发起群聊 mess.click_group_chat() # 选择联系人界面,选择一个群 sc = SelectContactsPage() sc.click_select_one_group() time.sleep(1) from pages.groupset.GroupChatSet import GroupChatSetPage if self.get_elements(self.__locators['aaa']): self.click_element(self.__locators['aaa']) time.sleep(1) gcp = GroupChatPage() group_set = GroupChatSetPage() time.sleep(1) gcp.click_setting() time.sleep(1) sc.page_up() time.sleep(1) group_set.click_delete_and_exit() time.sleep(3) else: self.click_back_by_android() # mess.click_create_group() # 点击 + mess.click_add_icon() # 点击 发起群聊 mess.click_group_chat() mess.click_contact_group() mess.click_text("大佬2") time.sleep(1) mess.click_text("大佬3") time.sleep(1) mess.click_sure_button() time.sleep(1) mess.click_group_name() time.sleep(1) mess.set_group_name(text=text) time.sleep(1) mess.click_sure_button() time.sleep(1)