def test_QFXS_0013(self): """1、点击“+”,添加接收人 2、添加人数小于当前企业剩余条数""" mess = MessagePage() mess.open_workbench_page() wp = WorkbenchPage() wp.wait_for_page_load() # 点击群发信使 wp.click_group_messenger() # 等待页面加载 mgp = MessageGroupPage() mgp.wait_for_page_load() # 点击新建短信 mgp.click_build_message() mgp.wait_for_edit_message_page_load() # 点击收件人 mgp.click_addressee() # 点击指定联系人 sccp = SelectCompanyContactsPage() sccp.wait_for_page_load() sccp.click_one_contact("飞信电话") if not sccp.is_left_head_exit(): raise AssertionError("找不到搜索栏左侧被点击人员人名和头像") #返回 sccp.click_back() time.sleep(2) if sccp.is_exist_corporate_name(): sccp.click_back_by_android() mgp.wait_for_edit_message_page_load() mgp.click_close()
def test_QFXS_0010(self): """1、搜索不存在的用户名称""" mess = MessagePage() mess.open_workbench_page() wp = WorkbenchPage() wp.wait_for_page_load() # 点击群发信使 wp.click_group_messenger() # 等待页面加载 mgp = MessageGroupPage() mgp.wait_for_page_load() # 点击新建短信 mgp.click_build_message() mgp.wait_for_edit_message_page_load() # 点击收件人 mgp.click_addressee() # 点击本机号码 sccp = SelectCompanyContactsPage() sccp.wait_for_page_load() import random a=str(random.random()) #搜索框输入不存在用户名 sccp.input_search_message(a) if not sccp.is_toast_exist("无搜索结果"): raise AssertionError("没有提示 无搜索结果") sccp.click_back() time.sleep(2) if sccp.is_exist_corporate_name(): sccp.click_back_by_android() mgp.wait_for_edit_message_page_load() mgp.click_close()
def test_QFXS_0008(self): """1、点击用户本人头像""" mess = MessagePage() mess.open_workbench_page() wp = WorkbenchPage() wp.wait_for_page_load() #点击群发信使 wp.click_group_messenger() #等待页面加载 mgp=MessageGroupPage() mgp.wait_for_page_load() #点击新建短信 mgp.click_build_message() mgp.wait_for_edit_message_page_load() #点击收件人 mgp.click_addressee() #点击本机号码 sccp=SelectCompanyContactsPage() sccp.wait_for_page_load() phone_number = current_mobile().get_cards(CardType.CHINA_MOBILE)[0] sccp.click_text(phone_number) if not sccp.is_toast_exist("该联系人不可选"): raise AssertionError("没有toast提示该联系人不可选") sccp.click_back() time.sleep(2) sccp.click_back() mgp.wait_for_edit_message_page_load() mgp.click_close()
def test_QFXS_0011(self): """1、再次点击头像,取消选择人员""" mess = MessagePage() mess.open_workbench_page() wp = WorkbenchPage() wp.wait_for_page_load() # 点击组织架构,添加联系人 wp.click_organization() org=Organization() org.wait_for_page_load() if not org.is_exit_element_by_text_swipe("飞信电话"): org.click_text("添加联系人") time.sleep(2) org.click_text("从手机通讯录添加") sccp = SelectCompanyContactsPage() sccp.wait_for_page_load() # 飞信电话 or 和飞信电话 sccp.click_one_contact("飞信电话") sccp.click_sure() time.sleep(1) org.click_back_by_android() time.sleep(2) org.wait_for_page_load() org.click_back() wp.wait_for_page_load() # 点击群发信使 wp.click_group_messenger() # 等待页面加载 mgp = MessageGroupPage() mgp.wait_for_page_load() # 点击新建短信 mgp.click_build_message() mgp.wait_for_edit_message_page_load() # 点击收件人 mgp.click_addressee() # 点击指定联系人 sccp = SelectCompanyContactsPage() sccp.wait_for_page_load() sccp.click_one_contact("飞信电话") time.sleep(3) sccp.click_text("飞信电话") if sccp.is_left_head_exit(): raise AssertionError("搜索栏左侧被取消人员人名和头像没有被移除") #返回 sccp.click_back() time.sleep(2) if sccp.is_exist_corporate_name(): sccp.click_back_by_android() mgp.wait_for_edit_message_page_load() mgp.click_close()