Exemple #1
0
    def test_QFXS_0019(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)
        # 1.检查搜索结果是否精准匹配关键字
        self.assertEquals(sccp.is_search_contacts_name_full_match(search_name), True)
        # 选择搜索结果
        sccp.click_contacts_by_name(search_name)
        # 2.搜索栏是否清空,是否出现已选人名和头像,是否展示已选人数/上限人数
        self.assertEquals(sccp.is_clear_search_box(search_name), True)
        self.assertEquals(sccp.is_exist_select_contacts_name("佬1"), True)
        self.assertEquals(sccp.is_exist_select_contacts_image("佬1"), True)
        self.assertEquals(sccp.is_exist_select_and_all("1"), 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()
Exemple #2
0
    def test_QFXS_0016(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()
        time.sleep(2)
        # 输入查找信息
        sccp.input_search_message("我的电脑")
        time.sleep(2)
        # 1.是否显示“无搜索结果”
        self.assertEquals(sccp.is_exist_text(), 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()
Exemple #3
0
    def test_QFXS_0018(self):
        """6-10位数字可支持模糊搜索匹配结果"""

        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_number = "13800138"
        # 输入查找信息
        sccp.input_search_message(search_number)
        time.sleep(2)
        # 1.检查搜索结果是否模糊匹配关键字
        self.assertEquals(sccp.is_search_contacts_number_match(search_number), True)
        # 选择搜索结果
        sccp.click_contacts_by_number("13800138005")
        # 2.是否成功选中,输入框是否自动清空
        self.assertEquals(sccp.is_exist_select_contacts_name("佬1"), True)
        self.assertEquals(sccp.is_clear_search_box(search_number), 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()
Exemple #4
0
    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()
Exemple #5
0
    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()
Exemple #6
0
    def test_QFXS_0033(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_number = "13800138005"
        # 输入查找信息
        sccp.input_search_message(search_number)
        time.sleep(2)
        # 点击勾选搜索出的联系人头像
        sccp.click_contacts_image()
        # 1.是否出现已选人名和头像,是否展示已选人数/上限人数
        self.assertEquals(sccp.is_exist_select_contacts_name("佬1"), True)
        self.assertEquals(sccp.is_exist_select_contacts_image("佬1"), True)
        self.assertEquals(sccp.is_exist_select_and_all("1"), 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()
Exemple #7
0
    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()
Exemple #8
0
    def test_QFXS_0020(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)
        # 1.检查搜索结果是否模糊匹配关键字
        self.assertEquals(sccp.is_search_contacts_name_match(search_name),
                          True)
        # 选择搜索结果
        sccp.click_name_attribute_by_name(search_name)
        # 2.搜索栏是否清空,是否出现已选人名和头像,是否展示已选人数/上限人数
        self.assertEquals(sccp.is_clear_search_box(search_name), True)
        self.assertEquals(sccp.is_exist_select_contacts_name("佬1"), True)
        self.assertEquals(sccp.is_exist_select_contacts_image("佬1"), True)
        self.assertEquals(sccp.is_exist_select_and_all("1"), True)
        sccp.click_back_button()
        sccp.click_back_button()
        nmp.wait_for_page_load()
        nmp.click_back_button()
        # 等待群发信使首页加载
        gmp.wait_for_page_load()
Exemple #9
0
    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()
Exemple #10
0
    def test_QFXS_0017(self):
        """11位号码精准搜索"""

        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_number = "13800138005"
        # 输入查找信息
        sccp.input_search_message(search_number)
        # 1.检查搜索结果是否完全匹配关键字
        self.assertEquals(
            sccp.is_search_contacts_number_full_match(search_number), True)
        # 选择搜索结果
        sccp.click_name_attribute_by_name(search_number)
        # 2.是否成功选中,输入框是否自动清空
        self.assertEquals(sccp.is_exist_select_contacts_name("佬1"), True)
        self.assertEquals(sccp.is_clear_search_box(search_number), True)
        sccp.click_back_button()
        sccp.click_back_button()
        nmp.wait_for_page_load()
        nmp.click_back_button()
        # 等待群发信使首页加载
        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_0035(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_contacts_by_name("大佬3")
        time.sleep(2)
        # 联系人是否为已选中状态
        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)
        # 是否展示已选人数/上限人数
        self.assertEquals(sccp.is_exist_select_and_all("3"), True)
        # 取消已选联系人
        sccp.click_contacts_by_name("大佬1")
        time.sleep(2)
        # 1.被取消联系人名和头像是否被移除,已选人数/上限人数是否改变
        self.assertEquals(sccp.is_exist_select_contacts_name("佬1"), False)
        self.assertEquals(sccp.is_exist_select_contacts_image("佬1"), False)
        self.assertEquals(sccp.is_exist_select_and_all("2"), 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_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()
    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_0036(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()
        # 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("佬1"), True)
        self.assertEquals(sccp.is_exist_select_contacts_name("佬2"), True)
        self.assertEquals(sccp.is_exist_select_and_all("2"), True)
        sccp.click_back()
        time.sleep(1)
        sccp.click_back()
        time.sleep(1)
        if sccp.is_exist_corporate_name():
            sccp.click_back_by_android()
            time.sleep(1)
        nmp.wait_for_page_load()
        nmp.click_back()
        # 等待群发信使首页加载
        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()