Пример #1
0
    def create_contacts_if_not_exits(self, name, number):
        """
        导入联系人数据
        :param name:
        :param number:
        :return:
        """
        from pages import ContactDetailsPage
        detail_page = ContactDetailsPage()

        self.wait_for_page_load()
        # 创建联系人
        self.click_search_box()
        from pages import ContactListSearchPage
        contact_search = ContactListSearchPage()
        contact_search.wait_for_page_load()
        contact_search.input_search_keyword(name)
        if contact_search.is_contact_in_list(name):
            contact_search.click_back()
        else:
            contact_search.click_back()
            self.click_add()
            from pages import CreateContactPage
            create_page = CreateContactPage()
            create_page.wait_for_page_load()
            create_page.hide_keyboard_if_display()
            create_page.create_contact(name, number)
            detail_page.wait_for_page_load()
            detail_page.click_back_icon()
Пример #2
0
    def create_contacts_if_not_exits(self, name, number):
        """
        导入联系人数据
        :param name:
        :param number:
        :return:
        """
        from pages import ContactDetailsPage
        detail_page = ContactDetailsPage()

        self.wait_for_page_load()
        # 创建联系人
        self.click_search_box()
        from pages import ContactListSearchPage
        contact_search = ContactListSearchPage()
        contact_search.wait_for_page_load()
        contact_search.input_search_keyword(name)
        if contact_search.is_contact_in_list(name):
            contact_search.click_back()
        else:
            contact_search.click_back()
            self.click_element(self.__class__.__locators['联系-手机联系人'])
            self.click_add()
            from pages import CreateContactPage
            create_page = CreateContactPage()
            create_page.wait_for_page_load()
            create_page.hide_keyboard_if_display()
            create_page.create_contact(name, number)
            detail_page.wait_for_page_load()
            detail_page.click_back_icon()
            time.sleep(1)
            # current_mobile().back()
            self.click_back()
    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()