def test_QYTXL_0010(self): """模糊搜索(数字、中文、英文)""" # 进入企业通讯录首页 Preconditions.enter_enterprise_contacts_page() ecp = EnterpriseContactsPage() # 点击搜索框 ecp.click_search_box() search_name = "陈" ecp.input_search_message(search_name) time.sleep(2) # 1.检查搜索结果是否模糊匹配关键字 self.assertEquals(ecp.is_search_contacts_name_match(search_name), True) search_name2 = "zh" ecp.input_search_message(search_name2) time.sleep(2) # 2.检查搜索结果是否模糊匹配关键字 self.assertEquals(ecp.is_search_contacts_name_match("郑海"), True) search_number = "138028" ecp.input_search_message(search_number) time.sleep(2) # 3.检查搜索结果是否模糊匹配关键字 self.assertEquals(ecp.is_search_contacts_number_match(search_number), True) ecp.click_return() time.sleep(1) ecp.click_back() time.sleep(1) ecp.click_back() wbp = WorkbenchPage() wbp.wait_for_workbench_page_load()
def test_QYTXL_0011(self): """网络异常下搜索企业通讯录联系人""" # 进入企业通讯录首页 Preconditions.enter_enterprise_contacts_page() ecp = EnterpriseContactsPage() # 设置手机网络断开 ecp.set_network_status(0) # 点击搜索框 ecp.click_search_box() search_name = "大佬1" ecp.input_search_message(search_name) # 1.页面是否出现网络异常提示 self.assertEquals(ecp.is_toast_exist("网络连接异常"), True) ecp.hide_keyboard() time.sleep(3) self.assertEquals(ecp.is_text_present("网络出错,轻触屏幕重新加载"), True) ecp.click_return() time.sleep(1) ecp.click_back_by_android(2) wbp = WorkbenchPage() wbp.wait_for_workbench_page_load()
def test_QYTXL_0012(self): """搜索企业通讯录联系人结果展示""" # 进入企业通讯录首页 Preconditions.enter_enterprise_contacts_page() ecp = EnterpriseContactsPage() # 点击搜索框 ecp.click_search_box() search_name = "陈丹丹" ecp.input_search_message(search_name) time.sleep(2) # 1.是否显示头像、姓名、号码、公司部门(没公司部门的不显示) self.assertEquals(ecp.is_exists_contacts_image(), True) self.assertEquals(ecp.is_exists_contacts_name(), True) self.assertEquals(ecp.is_exists_contacts_number(), True) self.assertEquals(ecp.is_exists_value_by_name(search_name), True) ecp.click_return() time.sleep(1) ecp.click_back() time.sleep(1) ecp.click_back() wbp = WorkbenchPage() wbp.wait_for_workbench_page_load()
def test_QYTXL_0013(self): """点击搜索结果已保存到本地的RCS用户进入联系人详情页""" # 进入企业通讯录首页 Preconditions.enter_enterprise_contacts_page() ecp = EnterpriseContactsPage() # 点击搜索框 ecp.click_search_box() search_name = "大佬1" ecp.input_search_message(search_name) time.sleep(2) ecp.click_contacts_by_name(search_name) cdp = ContactDetailsPage() cdp.wait_for_page_load() # 1.是否显示用户的详情信息(副号拨打没做验证,需要提供满足条件的测试号码) self.assertEquals(cdp.is_exists_contacts_name(), True) self.assertEquals(cdp.is_exists_contacts_number(), True) self.assertEquals(cdp.is_exists_contacts_image(), True) self.assertEquals(cdp.is_exists_value_by_name("公司"), True) self.assertEquals(cdp.is_exists_value_by_name("职位"), True) self.assertEquals(cdp.is_exists_value_by_name("邮箱"), True) self.assertEquals(cdp.is_exists_message_icon(), True) self.assertEquals(cdp.is_exists_call_icon(), True) self.assertEquals(cdp.is_exists_voice_call_icon(), True) self.assertEquals(cdp.is_exists_video_call_icon(), True) self.assertEquals(cdp.is_exists_dial_hefeixin_icon(), True) self.assertEquals(cdp.is_exists_share_card_icon(), True) # 返回工作台 cdp.click_back_icon() time.sleep(1) ecp.click_return() time.sleep(1) ecp.click_back() time.sleep(1) ecp.click_back() wbp = WorkbenchPage() wbp.wait_for_workbench_page_load()
def test_QYTXL_0015(self): """点击搜索结果已保存到本地的本机用户进入联系人详情页""" # 进入企业通讯录首页 Preconditions.enter_enterprise_contacts_page() ecp = EnterpriseContactsPage() # 点击搜索框 ecp.click_search_box() search_number = current_mobile().get_cards(CardType.CHINA_MOBILE)[0] ecp.input_search_message(search_number) time.sleep(2) ecp.click_contacts_by_number(search_number) cdp = ContactDetailsPage() cdp.wait_for_page_load() time.sleep(2) # 确保本机用户已保存到本地 if cdp.is_exists_save_contacts_icon(): cdp.click_save_contacts_icon() ccp = CreateContactPage() ccp.wait_for_page_load() ccp.save_contact() time.sleep(2) # 1.是否显示用户的详情信息(副号拨打没做验证,需要提供满足条件的测试号码) self.assertEquals(cdp.is_exists_contacts_name(), True) self.assertEquals(cdp.is_exists_contacts_number(), True) self.assertEquals(cdp.is_exists_contacts_image(), True) self.assertEquals(cdp.is_exists_value_by_name("公司"), True) self.assertEquals(cdp.is_exists_value_by_name("职位"), True) self.assertEquals(cdp.is_exists_value_by_name("邮箱"), True) self.assertEquals(cdp.is_exists_message_icon(), True) self.assertEquals(cdp.is_exists_call_icon(), True) self.assertEquals(cdp.is_exists_voice_call_icon(), True) self.assertEquals(cdp.is_exists_video_call_icon(), True) self.assertEquals(cdp.is_exists_dial_hefeixin_icon(), True) self.assertEquals(cdp.is_exists_share_card_icon(), True) # 点击分享名片 cdp.click_share_card_icon() scp = SelectContactsPage() scp.wait_for_page_load() scp.click_select_one_group() sog = SelectOneGroupPage() sog.wait_for_page_load() name = "群聊1" # 分享名片到一个普通群 sog.selecting_one_group_by_name(name) time.sleep(2) sog.click_text("发送名片") # 2.是否提示已发送 self.assertEquals(sog.is_toast_exist("已发送"), True) time.sleep(2) # 3.验证消息、电话、语音视频、视频电话、副号拨打(需要提供满足条件的测试号码)、和飞信电话是否置灰,不可点击 self.assertEquals(cdp.message_icon_is_enabled(), False) self.assertEquals(cdp.call_icon_is_enabled(), False) self.assertEquals(cdp.voice_call_icon_is_enabled(), False) self.assertEquals(cdp.video_call_icon_is_enabled(), False) self.assertEquals(cdp.dial_hefeixin_icon_is_enabled(), False) # 返回消息页面验证是否发送成功 cdp.click_back_icon() time.sleep(1) ecp.click_return() time.sleep(1) ecp.click_back() time.sleep(1) ecp.click_back() wbp = WorkbenchPage() wbp.wait_for_workbench_page_load() mp = MessagePage() mp.open_message_page() mp.wait_for_page_load() mp.choose_chat_by_name(name) time.sleep(2) cwp = ChatWindowPage() cwp.wait_for_msg_send_status_become_to('发送成功', 10) gcp = GroupChatPage() # 返回工作台 gcp.click_back() mp.wait_for_page_load() mp.open_workbench_page() wbp.wait_for_workbench_page_load()