Example #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)
    def test_msg_hanjiabin_0226(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_open_in_browser()
        # import os
        time.sleep(5)
        # 获取当前界面的activity
        # cmd = 'adb shell dumpsys window | ' + findExec + ' mCurrentFocus'
        # res = os.popen(cmd)
        # 截取出activity名称 == 'com.android.browser'为系统浏览器
        # current_activity = res.read().split('u0 ')[-1].split('/')[1]
        # res.close()
        # time.sleep(3)
        if wm.is_text_present("地理位置授权"):
            wm.click_text("允许")
        else:
            raise RuntimeError('在浏览器中打失败!')
 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)
Example #4
0
 def test_msg_hanjiabin_0226(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_open_in_browser()
     time.sleep(5)
     if wm.is_text_present("地理位置授权"):
         wm.click_text("允许")
     if not wm.is_text_present("百度一下"):
         raise RuntimeError('在浏览器中打失败!')
Example #5
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)
Example #6
0
    def test_msg_hanjiabin_0228(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_refresh()
        wml.wait_for_loading_animation_end()
        exist = wml.is_element_exist('com.chinasofti.rcs:id/btn_more')
        time.sleep(3)
        if not exist:
            raise RuntimeError('刷新失败')
        time.sleep(3)