当前位置: 首页>>代码示例>>Python>>正文


Python Browser.wait_for_page_to_load方法代码示例

本文整理汇总了Python中OWDTestToolkit.apps.browser.Browser.wait_for_page_to_load方法的典型用法代码示例。如果您正苦于以下问题:Python Browser.wait_for_page_to_load方法的具体用法?Python Browser.wait_for_page_to_load怎么用?Python Browser.wait_for_page_to_load使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在OWDTestToolkit.apps.browser.Browser的用法示例。


在下文中一共展示了Browser.wait_for_page_to_load方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_main

# 需要导入模块: from OWDTestToolkit.apps.browser import Browser [as 别名]
# 或者: from OWDTestToolkit.apps.browser.Browser import wait_for_page_to_load [as 别名]
class test_main(GaiaTestCase):

    def setUp(self):
        # Set up child objects...
        GaiaTestCase.setUp(self)
        self.UTILS = UTILS(self)
        self.settings = Settings(self)
        self.browser = Browser(self)
        self.url1 = "www.google.com"
        self.url2 = "www.wikipedia.org"

    def tearDown(self):
        self.UTILS.reporting.reportResults()
        GaiaTestCase.tearDown(self)

    def test_run(self):

        # Open the Settings application.
        self.connect_to_network()

        # Open the browser app.
        self.browser.launch()

        # Open our URL.
        self.browser.open_url(self.url1)
        self.marionette.switch_to_frame()
        self.browser.wait_for_page_to_load()
        self.UTILS.test.test(self.url1 in self.browser.loaded_url(), "Web page loaded correctly.")

        self.browser.open_url(self.url2)
        self.marionette.switch_to_frame()
        self.browser.wait_for_page_to_load()
        self.UTILS.test.test(self.url2 in self.browser.loaded_url(), "Web page loaded correctly.")
开发者ID:owdqa,项目名称:owd_test_cases,代码行数:35,代码来源:test_26551.py

示例2: test_main

# 需要导入模块: from OWDTestToolkit.apps.browser import Browser [as 别名]
# 或者: from OWDTestToolkit.apps.browser.Browser import wait_for_page_to_load [as 别名]
class test_main(GaiaTestCase):

    links = ["www.google.com", "www.hotmail.com", "www.wikipedia.org"]
    test_msg = "Test " + " ".join(links) + " this."

    def setUp(self):

        # Set up child objects...
        GaiaTestCase.setUp(self)
        self.UTILS = UTILS(self)
        self.messages = Messages(self)
        self.browser = Browser(self)

        # Establish which phone number to use.
        self.phone_number = self.UTILS.general.get_config_variable("phone_number", "custom")
        self.UTILS.reporting.logComment("Sending sms to telephone number " + self.phone_number)

    def tearDown(self):
        self.UTILS.reporting.reportResults()
        GaiaTestCase.tearDown(self)

    def test_run(self):

        self.connect_to_network()

        # Create and send a new test message.
        self.data_layer.send_sms(self.phone_number, self.test_msg)
        self.UTILS.statusbar.wait_for_notification_toaster_detail(self.test_msg, timeout=120)

        map(self.try_link, range(len(self.links)), self.links)

    def try_link(self, link_number, link):
        self.UTILS.reporting.logResult("info", "Tapping <b>{}</b> ...".format(link))

        # Switch to messaging app.
        self.messages.launch()
        self.messages.openThread(self.phone_number)
        time.sleep(1)

        # Get last message.
        msg = self.messages.last_message_in_this_thread()

        # Find all URLs
        l = msg.find_element("xpath", "//a[text()='{}']".format(link))

        # Tap on required link.
        self.UTILS.element.simulateClick(l)

        self.marionette.switch_to_frame()
        self.browser.wait_for_page_to_load()
        self.UTILS.test.test(
            link in self.browser.loaded_url(), "Web page loaded #{} correctly.".format(link_number + 1))
开发者ID:owdqa,项目名称:owd_test_cases,代码行数:54,代码来源:test_26969.py

示例3: test_main

# 需要导入模块: from OWDTestToolkit.apps.browser import Browser [as 别名]
# 或者: from OWDTestToolkit.apps.browser.Browser import wait_for_page_to_load [as 别名]
class test_main(GaiaTestCase):

    link = "www.google.com"
    test_msg = "Test " + link + " this."

    def setUp(self):

        # Set up child objects...
        GaiaTestCase.setUp(self)
        self.UTILS = UTILS(self)
        self.messages = Messages(self)
        self.browser = Browser(self)

        # Establish which phone number to use.
        self.phone_number = self.UTILS.general.get_config_variable("phone_number", "custom")
        self.UTILS.reporting.logComment("Sending sms to telephone number " + self.phone_number)

    def tearDown(self):
        self.UTILS.reporting.reportResults()
        GaiaTestCase.tearDown(self)

    def test_run(self):
        self.connect_to_network()

        # Launch messages app.
        self.messages.launch()

        # Create and send a new test message.
        self.messages.create_and_send_sms([self.phone_number], self.test_msg)
        """
        Wait for the last message in this thread to be a 'received' one
        and click the link.
        """

        x = self.messages.wait_for_message()
        self.UTILS.test.test(x, "Received a message.", True)

        x.find_element("tag name", "a").tap()
        """
        Give the browser time to start up, then
        switch to the browser frame and check the page loaded.
        """
        self.marionette.switch_to_frame()
        self.browser.wait_for_page_to_load()
        self.UTILS.test.test(
            self.link in self.browser.loaded_url(), "Web page loaded ({}) correctly.".format(self.link))
开发者ID:owdqa,项目名称:owd_test_cases,代码行数:48,代码来源:test_26967.py

示例4: test_main

# 需要导入模块: from OWDTestToolkit.apps.browser import Browser [as 别名]
# 或者: from OWDTestToolkit.apps.browser.Browser import wait_for_page_to_load [as 别名]
class test_main(GaiaTestCase):

    def setUp(self):
        # Set up child objects...
        GaiaTestCase.setUp(self)
        self.UTILS = UTILS(self)
        self.settings = Settings(self)
        self.browser = Browser(self)
        self.messages = Messages(self)

        self.num = self.UTILS.general.get_config_variable("phone_number", "custom")
        self.url1 = "www.google.com"
        self.url2 = "www.wikipedia.org"
        self.test_msg = "Test message"

    def tearDown(self):
        self.UTILS.reporting.reportResults()
        GaiaTestCase.tearDown(self)

    def test_run(self):
        self.data_layer.connect_to_wifi()

        # Open the first url
        self.browser.launch()
        self.browser.open_url(self.url1)
        self.marionette.switch_to_frame()
        self.browser.wait_for_page_to_load()
        self.UTILS.test.test(self.url1 in self.browser.loaded_url(), "Web page loaded correctly.")

        # Open the SMS app, send a message then jump back to the browser.
        self.messages.launch()
        self.messages.create_and_send_sms([self.num], self.test_msg)
        send_time = self.messages.last_sent_message_timestamp()
        self.messages.wait_for_message(send_time)

        self.apps.kill_all()
        time.sleep(2)

        self.browser.launch()
        self.browser.open_url(self.url2)
        self.marionette.switch_to_frame()
        self.browser.wait_for_page_to_load()
        self.UTILS.test.test(self.url2 in self.browser.loaded_url(), "Web page loaded correctly.")
开发者ID:owdqa,项目名称:owd_test_cases,代码行数:45,代码来源:test_26552.py

示例5: test_main

# 需要导入模块: from OWDTestToolkit.apps.browser import Browser [as 别名]
# 或者: from OWDTestToolkit.apps.browser.Browser import wait_for_page_to_load [as 别名]
class test_main(GaiaTestCase):

    def setUp(self):
        # Set up child objects...
        GaiaTestCase.setUp(self)
        self.UTILS = UTILS(self)
        self.settings = Settings(self)
        self.browser = Browser(self)
        self.url1 = "www.google.com"
        self.url2 = "www.wikipedia.org"

    def tearDown(self):
        self.UTILS.reporting.reportResults()
        GaiaTestCase.tearDown(self)

    def test_run(self):
        self.data_layer.connect_to_wifi()

        # Open the browser app.
        self.browser.launch()
        self.browser.open_url(self.url1)
        self.marionette.switch_to_frame()
        self.browser.wait_for_page_to_load()
        self.UTILS.test.test(self.url1 in self.browser.loaded_url(), "{} successfully loaded".format(self.url1))

        self.device.turn_screen_off()

        screenshot = self.UTILS.debug.screenShotOnErr()
        self.UTILS.reporting.logResult("info", "Srceenshot of locked screen:", screenshot)

        time.sleep(3)
        self.device.unlock()

        self.browser.open_url(self.url2)
        self.marionette.switch_to_frame()
        self.browser.wait_for_page_to_load()
        self.UTILS.test.test(self.url2 in self.browser.loaded_url(), "{} successfully loaded".format(self.url2))
开发者ID:owdqa,项目名称:owd_test_cases,代码行数:39,代码来源:test_26556.py


注:本文中的OWDTestToolkit.apps.browser.Browser.wait_for_page_to_load方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。