def test_QFXS_0007(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.进入多个部门,添加成员 sccp.click_department_by_name("测试部门1") sccp.click_contacts_by_name("大佬1") self.assertEquals(sccp.is_exist_select_contacts_name("佬1"), True) self.assertEquals(sccp.is_exist_select_and_all("1"), True) sccp.click_back() sccp.click_department_by_name("测试部门2") sccp.click_contacts_by_name("大佬2") self.assertEquals(sccp.is_exist_select_contacts_name("佬2"), True) # 2.各个部门添加成员是否累计 self.assertEquals(sccp.is_exist_select_and_all("2"), True) # 点击确定 sccp.click_sure_button() nmp.wait_for_page_load() self.assertEquals(nmp.is_exist_text("大佬1"), True) self.assertEquals(nmp.is_exist_text("大佬2"), True) nmp.click_back() time.sleep(2) nmp.click_no() # 等待群发信使首页加载 gmp.wait_for_page_load()
def test_QFXS_0005(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_name = "大佬1" # 输入查找信息 sccp.input_search_message(search_name) time.sleep(2) # 点击勾选搜索出的联系人头像 sccp.click_contacts_image() # 点击确定 sccp.click_sure_button() nmp.wait_for_page_load() # 1.搜索出的联系人是否被选择 self.assertEquals(nmp.is_exist_text(search_name), True) nmp.click_back() time.sleep(2) nmp.click_no() # 等待群发信使首页加载 gmp.wait_for_page_load()
def test_QFXS_0039(self): """直接添加接收人后再次点击'+'""" gmp = GroupMessengerPage() # 等待群发信使首页加载 gmp.wait_for_page_load() try: gmp.click_new_message() nmp = NewMessagePage() # 等待群发信使->新建短信页面加载 nmp.wait_for_page_load() except: gmp.click_back_by_android() gmp.click_new_message() nmp = NewMessagePage() # 等待群发信使->新建短信页面加载 nmp.wait_for_page_load() nmp.click_add_icon() sccp = SelectCompanyContactsPage() # 等待群发信使->新建短信->选择联系人页面加载 sccp.wait_for_page_load() # 选择两位联系人 sccp.click_contacts_by_name("大佬1") sccp.click_contacts_by_name("大佬2") # 点击确定 sccp.click_sure_button() nmp.wait_for_page_load() nmp.click_add_icon() sccp.wait_for_page_load() # 1.跳转联系人选择器后,上次添加的联系人是否为已选中状态 self.assertEquals(sccp.is_exist_select_contacts_name("佬1"), True) self.assertEquals(sccp.is_exist_select_contacts_name("佬2"), True) sccp.click_contacts_by_name("大佬3") sccp.click_sure_button() nmp.wait_for_page_load() # 2.是否添加成功,已添加与新添加用户均展示正常 self.assertEquals(nmp.is_exist_text("大佬1"), True) self.assertEquals(nmp.is_exist_text("大佬2"), True) self.assertEquals(nmp.is_exist_text("大佬3"), True) nmp.click_back() time.sleep(2) nmp.click_no() # 等待群发信使首页加载 gmp.wait_for_page_load()
def test_QFXS_0006(self): """添加成员之后再移除成员""" gmp = GroupMessengerPage() # 等待群发信使首页加载 gmp.wait_for_page_load() gmp.click_new_message() nmp = NewMessagePage() time.sleep(3) # 等待群发信使->新建短信页面加载 nmp.wait_for_page_load() nmp.click_add_icon() sccp = SelectCompanyContactsPage() # 等待群发信使->新建短信->选择联系人页面加载 sccp.wait_for_page_load() sccp.click_department_by_name("测试部门1") # 添加多个联系人 sccp.click_contacts_by_name("大佬1") sccp.click_contacts_by_name("大佬2") sccp.click_contacts_by_name("大佬3") # 是否成功选中 self.assertEquals(sccp.is_exist_select_contacts_name("佬1"), True) self.assertEquals(sccp.is_exist_select_contacts_name("佬2"), True) self.assertEquals(sccp.is_exist_select_contacts_name("佬3"), True) # 点击部门已选成员图像取消勾选 sccp.click_contacts_image_by_name("大佬1") time.sleep(2) # 点击顶部已选成员信息移除成员 sccp.click_select_contacts_name("佬2") # 点击确定 sccp.click_sure_button() time.sleep(3) nmp.wait_for_page_load() # 1.是否正常移除成员 self.assertEquals(nmp.is_exist_text("大佬1"), False) self.assertEquals(nmp.is_exist_text("大佬2"), False) self.assertEquals(nmp.is_exist_text("大佬3"), True) nmp.click_back() time.sleep(2) nmp.click_no() # 等待群发信使首页加载 gmp.wait_for_page_load()