コード例 #1
0
    def test_msg_hanjiabin_0225(self):
        """
        网页消息——打开链接后的通用浏览器——右上角更多——转发到朋友圈
        """
        msg = 'http://www.baidu.com'
        cwp = self.send_one_web_msg_rcwp(msg)
        # 点击网页消息,打开网页
        cwp.click_text(msg)
        from pages.otherpages.WebMsgLoad import WebMsgLoad
        wml = WebMsgLoad()
        # 等待网页加载完毕
        wml.wait_for_loading_animation_end()
        # 点击右上角更多
        wml.click_more()
        from pages.otherpages.WebMore import WebMore
        wm = WebMore()
        # 点击转发给朋友
        wm.click_send_wechat()
        exist = wm.is_toast_exist('未安装微信')
        if not exist:

            current_activity = self.get_current_activity_name()
            if 'com.chinasofti.rcs' == current_activity:
                raise RuntimeError('转发到朋友圈失败!')
        time.sleep(2)
コード例 #2
0
 def test_msg_hanjiabin_0222(self):
     """
     网页消息——打开链接后的通用浏览器——右上角更多——转发给朋友
     """
     msg = 'http://www.baidu.com'
     cwp = self.send_one_web_msg_rcwp(msg)
     # 点击网页消息,打开网页
     cwp.click_text(msg)
     from pages.otherpages.WebMsgLoad import WebMsgLoad
     wml = WebMsgLoad()
     # 等待网页加载完毕
     wml.wait_for_loading_animation_end()
     # 点击右上角更多
     wml.click_more()
     from pages.otherpages.WebMore import WebMore
     wm = WebMore()
     # 点击转发给朋友
     wm.click_send()
     scg = SelectContactsPage()
     # 2.等待选择联系人页面加载
     scg.wait_for_page_load()
     # 3.选择最近聊天中的当前会话窗口
     contact_name = "大佬1"
     scg.select_recent_chat_by_name(contact_name)
     scg.click_sure_forward()
     # 1.验证是否发送成功
     exist = cwp.is_toast_exist('已转发')
     if not exist:
         raise RuntimeError('转发失败')
     time.sleep(2)
     wml.set_network_status(0)
     wml.click_more()
     wm.click_send()
     scg = SelectContactsPage()
     # 2.等待选择联系人页面加载
     scg.wait_for_page_load()
     # 3.选择最近聊天中的当前会话窗口
     contact_name = "大佬1"
     scg.select_recent_chat_by_name(contact_name)
     scg.click_sure_forward()
     # 1.验证是否发送成功
     exist = wm.is_toast_exist('已转发')
     if not exist:
         raise RuntimeError('转发失败')
     wml.click_back()
     scp = SingleChatPage()
     scp.click_back()
     mp = MessagePage()
     mp.wait_for_page_load()
     # 5.是否存在消息发送失败的标识
     present = mp.is_iv_fail_status_present()
     if not present:
         raise RuntimeError('转发操作失败')
     scp.set_network_status(6)
     time.sleep(2)
コード例 #3
0
 def test_msg_hanjiabin_0227(self):
     """网页消息——打开链接后的通用浏览器——右上角更多——复制链接"""
     msg = 'http://www.baidu.com'
     cwp = self.send_one_web_msg_rcwp(msg)
     # 点击网页消息,打开网页
     cwp.click_text(msg)
     from pages.otherpages.WebMsgLoad import WebMsgLoad
     wml = WebMsgLoad()
     # 等待网页加载完毕
     wml.wait_for_loading_animation_end()
     # 点击右上角更多
     wml.click_more()
     from pages.otherpages.WebMore import WebMore
     wm = WebMore()
     # 点击复制链接按钮
     wm.click_copy()
     # 1 验证是否复制成功
     exist = wm.is_toast_exist('内容已经复制到剪贴板')
     if not exist:
         raise RuntimeError('复制链接失败')
     time.sleep(3)