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('在浏览器中打失败!')
示例#2
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('在浏览器中打失败!')