def test_QFXS_0009(self): """用户不在任何部门下""" gmp = GroupMessengerPage() # 等待群发信使首页加载 gmp.wait_for_page_load() gmp.click_new_message() nmp = NewMessagePage() # 等待群发信使->新建短信页面加载 nmp.wait_for_page_load() nmp.click_add_icon() sccp = SelectCompanyContactsPage() # 等待群发信使->新建短信->选择联系人页面加载 sccp.wait_for_page_load() # 1.是否直接进入企业子一层级 self.assertEquals(sccp.is_exist_corporate_grade(), True) sccp.click_back() time.sleep(2) # 2.页面是否跳转到企业层级 self.assertEquals(sccp.is_exist_corporate_grade(), False) self.assertEquals(sccp.is_exist_corporate_name(), True) sccp.click_back() nmp.wait_for_page_load() nmp.click_back() # 等待群发信使首页加载 gmp.wait_for_page_load()
def test_QFXS_0025(self): """纯空格键不支持搜索匹配""" gmp = GroupMessengerPage() # 等待群发信使首页加载 gmp.wait_for_page_load() gmp.click_new_message() nmp = NewMessagePage() # 等待群发信使->新建短信页面加载 nmp.wait_for_page_load() nmp.click_add_icon() sccp = SelectCompanyContactsPage() # 等待群发信使->新建短信->选择联系人页面加载 sccp.wait_for_page_load() search_content = " " # 输入查找信息 sccp.input_search_message(search_content) time.sleep(2) # 1.纯空格键不支持搜索匹配 self.assertEquals(sccp.is_exist_corporate_grade(), True) sccp.click_back() time.sleep(2) if sccp.is_exist_corporate_name(): sccp.click_back_by_android() nmp.wait_for_page_load() nmp.click_back() # 等待群发信使首页加载 gmp.wait_for_page_load()
def test_QFXS_0012(self): """用户同时在两个部门下""" gmp = GroupMessengerPage() # 等待群发信使首页加载 gmp.wait_for_page_load() # 确保用户在企业部门下 gmp.click_back() wbp = WorkbenchPage() # 添加本机号码到指定部门1 department_name1 = "admin_department1" Preconditions.add_phone_number_to_department(department_name1) # 添加本机号码到指定部门2 department_name2 = "admin_department2" Preconditions.add_phone_number_to_department(department_name2) workbench_name = wbp.get_workbench_name() # 解决用户部门变更后不能及时刷新的问题 wbp.click_company_contacts() ecp = EnterpriseContactsPage() ecp.wait_for_page_load() time.sleep(2) ecp.click_back() time.sleep(2) if ecp.is_exist_department_name(): ecp.click_back() wbp.wait_for_workbench_page_load() wbp.click_group_messenger() gmp.wait_for_page_load() gmp.click_new_message() nmp = NewMessagePage() # 等待群发信使->新建短信页面加载 nmp.wait_for_page_load() nmp.click_add_icon() sccp = SelectCompanyContactsPage() # 等待群发信使->新建短信->选择联系人页面加载 sccp.wait_for_page_load() # 1.跳转后是否显示企业层级:企业+部门名称(部门随机显示一个) self.assertEquals(sccp.is_exist_corporate_grade(), False) self.assertEquals(sccp.is_exist_department_by_name(workbench_name), True) self.assertEquals( (sccp.is_exist_department_by_name(department_name1) or sccp.is_exist_department_by_name(department_name2)), True) sccp.click_back() nmp.wait_for_page_load() nmp.click_back() # 等待群发信使首页加载 gmp.wait_for_page_load()
def test_QFXS_0011(self): """用户在企业部门下又在企业子一层级中,直接进入企业层级""" gmp = GroupMessengerPage() # 等待群发信使首页加载 gmp.wait_for_page_load() # 确保用户既在企业部门下又在企业子一层级 gmp.click_back() wbp = WorkbenchPage() # 添加本机号码到指定部门 department_name = "admin_department" Preconditions.add_phone_number_to_department(department_name) # 添加本机号码到和通讯录 Preconditions.add_phone_number_to_he_contacts() workbench_name = wbp.get_workbench_name() # 解决用户部门变更后不能及时刷新的问题 wbp.click_company_contacts() ecp = EnterpriseContactsPage() ecp.wait_for_page_load() time.sleep(2) ecp.click_back() time.sleep(2) if ecp.is_exist_department_name(): ecp.click_back() wbp.wait_for_workbench_page_load() wbp.click_group_messenger() gmp.wait_for_page_load() gmp.click_new_message() nmp = NewMessagePage() # 等待群发信使->新建短信页面加载 nmp.wait_for_page_load() nmp.click_add_icon() sccp = SelectCompanyContactsPage() # 等待群发信使->新建短信->选择联系人页面加载 sccp.wait_for_page_load() # 1.是否直接进入企业层级:企业+部门名称 self.assertEquals(sccp.is_exist_corporate_grade(), False) self.assertEquals(sccp.is_exist_department_by_name(workbench_name), True) self.assertEquals(sccp.is_exist_department_by_name(department_name), True) sccp.click_back() nmp.wait_for_page_load() nmp.click_back() # 等待群发信使首页加载 gmp.wait_for_page_load()