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


Python Browser.open_url方法代码示例

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


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

示例1: test_main

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

    def setUp(self):

        GaiaTestCase.setUp(self)
        self.UTILS = UTILS(self)

        self.browser = Browser(self)
        self.settings = Settings(self)
        self.download_manager = DownloadManager(self)
        self.video = Video(self)
        self.test_url = self.UTILS.general.get_config_variable("download_url", "common")
        self.file_name = "clipcanvas_14348_H264_320x180.mp4"
        self.data_url = "{}/{}".format(self.test_url, self.file_name)

        self.connect_to_network()
        self.settings.launch()
        self.settings.downloads()
        self.download_manager.clean_downloads_list()

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

    def test_run(self):
        self.UTILS.statusbar.clearAllStatusBarNotifs()
    
        self.browser.launch()
        self.browser.open_url(self.test_url)
        self.download_manager.download_file(self.file_name)
        self.UTILS.statusbar.wait_for_notification_toaster_title("Download complete", timeout=120)
开发者ID:owdqa,项目名称:owd_test_cases,代码行数:33,代码来源:test_33941.py

示例2: test_main

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

    def setUp(self):

        # Set up child objects...
        GaiaTestCase.setUp(self)
        self.UTILS = UTILS(self)
        self.browser = Browser(self)
        self.testURL = self.UTILS.general.get_config_variable("test_url", "common")

        self.UTILS.reporting.logComment("Using " + self.testURL)

        # switch off keyboard FTU screen
        self.data_layer.set_setting("keyboard.ftu.enabled", False)

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

    def test_run(self):

        # Wifi needs to be off for this test to work.
        self.data_layer.connect_to_cell_data()

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

        # Open our URL.
        self.browser.open_url(self.testURL)
开发者ID:owdqa,项目名称:owd_test_cases,代码行数:31,代码来源:test_26333.py

示例3: test_main

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

    def setUp(self):
        GaiaTestCase.setUp(self)
        self.UTILS     = UTILS(self)
        self.browser   = Browser(self)

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

    def test_run(self):
        self.UTILS.test.test(not self.UTILS.network.is_network_type_enabled("data"),
                         "Data mode is disabled before we start this test.")

        self.UTILS.statusbar.toggleViaStatusBar("data")
        self.wait_for_condition(lambda m: self.data_layer.is_cell_data_connected,
                                timeout=20, message="Device attached to data connection")

        self.browser.launch()
        self.browser.open_url("http://www.google.com")

        self.UTILS.statusbar.toggleViaStatusBar("data")
        self.wait_for_condition(lambda m: not self.data_layer.is_cell_data_connected,
                                timeout=20, message="Device attached to data connection")
        self.UTILS.element.waitForNotElements(DOM.Statusbar.dataConn, "Data icon in statusbar")
开发者ID:owdqa,项目名称:owd_test_cases,代码行数:28,代码来源:test_26411.py

示例4: test_main

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

    def setUp(self):

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

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

    def test_run(self):

        url1 = "www.google.com"
        url2 = "www.bbc.co.uk"

        # Wifi needs to be off for this test to work.
        self.data_layer.connect_to_cell_data()

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

        # Open our URL.
        self.browser.open_url(url1)
        self.browser.open_url(url2, timeout=60)  # bbc is heavier
开发者ID:owdqa,项目名称:owd_test_cases,代码行数:29,代码来源:test_26568.py

示例5: test_main

# 需要导入模块: from OWDTestToolkit.apps.browser import Browser [as 别名]
# 或者: from OWDTestToolkit.apps.browser.Browser import open_url [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.wifi_name = self.UTILS.general.get_config_variable("ssid", "wifi")
        self.wifi_pass = self.UTILS.general.get_config_variable("password", "wifi")

        self.testURL = self.UTILS.general.get_config_variable("test_url", "common")
        self.apps.set_permission_by_url(Browser.search_manifest_url, 'geolocation', 'deny')

        # switch off keyboard FTU screen
        self.data_layer.set_setting("keyboard.ftu.enabled", False)

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

    def test_run(self):

        # Open the settings application.
        self.settings.launch()

        # Connect to the wifi.
        self.settings.wifi()
        self.settings.connect_to_wifi(self.wifi_name, self.wifi_pass)

        # Open the browser app.
        self.browser.launch()
        # Open our URL.
        self.browser.open_url(self.testURL)
开发者ID:owdqa,项目名称:owd_test_cases,代码行数:37,代码来源:test_26332.py

示例6: test_main

# 需要导入模块: from OWDTestToolkit.apps.browser import Browser [as 别名]
# 或者: from OWDTestToolkit.apps.browser.Browser import open_url [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

示例7: test_main

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

    def setUp(self):
        GaiaTestCase.setUp(self)
        self.UTILS = UTILS(self)
        self.browser = Browser(self)
        self.settings = Settings(self)

        self.wifi_name = self.UTILS.general.get_config_variable("ssid", "wifi")
        self.wifi_pass = self.UTILS.general.get_config_variable("password", "wifi")
        self.data_layer.connect_to_wifi()
        self.data_layer.is_wifi_connected()

        self.apps.kill_all()
        self.url = "https://acperez.github.io/gecko-sw-test/"
        self.sw_scope = "https://acperez.github.io/gecko-sw-test/"
        self.sw_header = "https://acperez.github.io!appId=22&inBrowser=1"
        self.script_spec = "https://acperez.github.io/gecko-sw-test/service-worker.js"

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

    def test_run(self):
        self.browser.launch()
        self.browser.open_url(self.url)

        register_btn = self.UTILS.element.getElement(dom.acperez_register_btn_dom, "Register Worker button")
        register_btn.tap()

        self.settings.launch()
        time.sleep(2)
        self.settings.developer_settings()
        time.sleep(2)
        self.settings.service_workers_menu()

        div_dom = (DOM.Settings.service_worker_div[0], DOM.Settings.service_worker_div[1].format(self.sw_scope))
        div_elem = self.UTILS.element.getElement(div_dom, "Service worker div")
        self.UTILS.element.scroll_into_view(div_elem)

        header = div_elem.find_element(*DOM.Settings.service_worker_header)
        self.UTILS.test.test(header.text == self.sw_header, "Header found [{}] Expected [{}]".
                             format(header.text, self.sw_header))

        scope = div_elem.find_element(*DOM.Settings.service_worker_scope)
        self.UTILS.test.test(self.sw_scope == scope.text, "Scope found [{}] Expected [{}]".
                             format(scope.text, self.sw_scope))

        script_spec = div_elem.find_element(*DOM.Settings.service_worker_script_spec)
        self.UTILS.test.test(self.script_spec == script_spec.text, "Script spec found [{}] Expected [{}]".
                             format(script_spec.text, self.script_spec))

        worker_url = div_elem.find_element(*DOM.Settings.service_worker_current_url)
        self.UTILS.test.test(self.script_spec == worker_url.text, "URL found [{}] Expected [{}]".
                             format(worker_url.text, self.script_spec))

        unregister_btn = div_elem.find_element(*DOM.Settings.service_worker_unregister_btn)
        unregister_btn.tap()
开发者ID:owdqa,项目名称:owd_test_cases,代码行数:61,代码来源:test_basic_acperez.py

示例8: test_main

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

    button_locator = ('css selector', "button.icon")

    def setUp(self):

        GaiaTestCase.setUp(self)
        self.UTILS = UTILS(self)

        self.browser = Browser(self)
        self.settings = Settings(self)
        self.download_manager = DownloadManager(self)

        self.test_url = self.UTILS.general.get_config_variable("download_url", "common")
        self.file_name = "clipcanvas_14348_H264_320x180.mp4"
        self.data_url = "{}/{}".format(self.test_url, self.file_name)

        self.connect_to_network()
        self.settings.launch()
        self.settings.downloads()
        self.download_manager.clean_downloads_list()

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

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

    def test_run(self):
        self.UTILS.statusbar.clearAllStatusBarNotifs()
    
        self.browser.launch()
        self.browser.open_url(self.test_url)

        self.download_manager.download_file(self.file_name)
        self.UTILS.statusbar.wait_for_notification_toaster_title("Download complete", timeout=60)
        time.sleep(3)

        self.settings.launch()
        self.settings.downloads()
        self.download_manager.open_download(self.data_url)

        share_option = self.UTILS.element.getElement(DOM.DownloadManager.download_file_option_share,
                                                     "Getting Share option button")
        share_option.tap()

        self.marionette.switch_to_frame()
        share_menu = self.UTILS.element.getElement(DOM.GLOBAL.action_menu, "Share menu")
        options = share_menu.find_elements(*self.button_locator)
        self.UTILS.test.test(len(options) > 0, "A list with several options to share is shown")

        self._show_option(options)

    def _show_option(self, options):
        for option in options:
            self.UTILS.reporting.logResult('info', "Share option: {}".format(option.text))
开发者ID:owdqa,项目名称:owd_test_cases,代码行数:59,代码来源:test_32238.py

示例9: test_main

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

    test_url = "http://everlong.org/mozilla/packaged/"
    _appName = "cool packaged app"
    _appOK = True
    install_button_locator = ('id', 'install-app')
    confirm_install_locator = ('id', 'app-install-install-button')

    def setUp(self):

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

        self.connect_to_network()
        # Uninstall the app (if need be).
        self.UTILS.app.uninstallApp(self._appName)

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

    def test_run(self):
        self.browser.launch()
        self.browser.open_url(self.test_url)
        """
        Install the app (these DOM items are peculiar to this little dev app,
        so dont bother putting them in the main DOM.py file).
        """
        install_btn = self.UTILS.element.getElement(self.install_button_locator, "Install an app button")
        install_btn.tap()

        # Install button on the splash screen (switch to main frame to 'see' this).
        self.marionette.switch_to_frame()
        install_btn = self.UTILS.element.getElement(self.confirm_install_locator, "Install button", True, 30)
        install_btn.tap()

        ok_btn = self.UTILS.element.getElement(DOM.GLOBAL.modal_dialog_alert_ok, "Ok button")
        ok_btn.tap()

        expected_msg = "{} installed".format(self._appName)
        system_banner = self.UTILS.element.getElement(DOM.GLOBAL.system_banner, "System notification banner")
        self.UTILS.test.test(system_banner.text == expected_msg, "Banner matches expected message")
        self.apps.kill_all()
        time.sleep(2)

        # Go back to the home page and check the app is installed.
        self.UTILS.test.test(self.UTILS.app.launchAppViaHomescreen(self._appName),
                             "Application '" + self._appName + "' can be launched from the homescreen.", True)
开发者ID:owdqa,项目名称:owd_test_cases,代码行数:53,代码来源:test_26345.py

示例10: test_main

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

    def setUp(self):

        GaiaTestCase.setUp(self)
        self.UTILS = UTILS(self)

        self.browser = Browser(self)
        self.settings = Settings(self)
        self.download_manager = DownloadManager(self)
        self.test_url = self.UTILS.general.get_config_variable("download_url", "common")
        self.file_name = "41MB.rar"
        self.data_url = "{}/{}".format(self.test_url, self.file_name)

        self.data_layer.connect_to_cell_data()
        self.settings.launch()
        self.settings.downloads()
        self.download_manager.clean_downloads_list()

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

    def test_run(self):
        self.UTILS.statusbar.clearAllStatusBarNotifs()

        self.browser.launch()
        self.browser.open_url(self.test_url)

        self.download_manager.download_file(self.file_name)
        self.UTILS.statusbar.wait_for_notification_toaster_title(text="Download started", notif_text="Downloading", timeout=15)

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

        self.settings.launch()
        self.settings.downloads()

        # Verify status downloading using data-state="downloading".
        self.download_manager.verify_download_status(self.data_url, "downloading")
        self.download_manager.verify_download_graphical_status(self.data_url, "downloading")

        self.UTILS.home.touchHomeButton()

        self.UTILS.statusbar.displayStatusBar()
        self.UTILS.statusbar.wait_for_notification_statusbar_title("Downloading")
        self.UTILS.statusbar.hideStatusBar()

        self.UTILS.statusbar.wait_for_notification_toaster_title("Download complete", timeout=240)
开发者ID:owdqa,项目名称:owd_test_cases,代码行数:51,代码来源:test_33947.py

示例11: test_main

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

    def setUp(self):

        GaiaTestCase.setUp(self)
        self.UTILS = UTILS(self)

        self.browser = Browser(self)
        self.settings = Settings(self)
        self.download_manager = DownloadManager(self)
        self.test_url = self.UTILS.general.get_config_variable("download_url", "common")
        self.file_name = "1GB.rar"
        self.data_url = "{}/{}".format(self.test_url, self.file_name)

        # make the download process slower
        self.data_layer.connect_to_cell_data()
        self.settings.launch()
        self.settings.downloads()
        self.download_manager.clean_downloads_list()

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

    def test_run(self):
        self.UTILS.statusbar.clearAllStatusBarNotifs()

        self.browser.launch()
        self.browser.open_url(self.test_url)
        self.download_manager.download_file(self.file_name)
        self.UTILS.statusbar.wait_for_notification_toaster_title(text="Download started", notif_text="Downloading",
                                                                 timeout=15)
        time.sleep(5)

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

        self.settings.launch()
        self.settings.downloads()

        # Verify status downloading using data-state="downloading".
        self.download_manager.verify_download_status(self.data_url, "downloading")
        download_info = self.download_manager.get_download_info(self.data_url)

        match = re.search(r"(\d)+(.(\d)+)*\s(GB|MB|KB)\sof\s(\d)+(.(\d)+)*\sGB$", download_info.text)
        self.UTILS.test.test(match is not None, "Verify the the text is: 'X' GB of 'Y' GB")

        time.sleep(3)
        self.download_manager.stop_download(self.data_url, True)
开发者ID:owdqa,项目名称:owd_test_cases,代码行数:51,代码来源:test_33949.py

示例12: test_main

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

    def setUp(self):

        GaiaTestCase.setUp(self)
        self.UTILS = UTILS(self)

        self.browser = Browser(self)
        self.settings = Settings(self)
        self.download_manager = DownloadManager(self)
        self.test_url = self.UTILS.general.get_config_variable("download_url", "common")
        self.file_name = "11MB.rar"
        self.data_url = "{}/{}".format(self.test_url, self.file_name)

        self.connect_to_network()
        self.settings.launch()
        self.settings.downloads()
        self.download_manager.clean_downloads_list()

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

    def test_run(self):

        self.browser.launch()
        self.browser.open_url(self.test_url)

        self.download_manager.download_file(self.file_name)
        self.UTILS.statusbar.wait_for_notification_toaster_title("Download complete", timeout=60)
        time.sleep(5)

        self.apps.kill_all()
        time.sleep(2)
        previous_number_of_pictures = len(self.data_layer.sdcard_files())

        self.settings.launch()
        self.settings.downloads()
        self.download_manager.open_download(self.data_url)
        self.download_manager.open_download_delete_file()

        elem = (DOM.DownloadManager.download_element[0],
                DOM.DownloadManager.download_element[1].format(self.data_url))
        self.UTILS.element.waitForNotElements(elem, "Download is not there")

        # Check that picture saved to SD card
        self.wait_for_condition(
            lambda m: len(self.data_layer.sdcard_files()) == previous_number_of_pictures - 1, 20)
        self.assertEqual(len(self.data_layer.sdcard_files()), previous_number_of_pictures - 1)
开发者ID:owdqa,项目名称:owd_test_cases,代码行数:51,代码来源:test_33916.py

示例13: test_main

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

    def setUp(self):

        GaiaTestCase.setUp(self)
        self.UTILS = UTILS(self)

        self.browser = Browser(self)
        self.settings = Settings(self)
        self.download_manager = DownloadManager(self)
        self.test_url = self.UTILS.general.get_config_variable("download_url", "common")
        self.file_name = "105MB.rar"
        self.data_url = "{}/{}".format(self.test_url, self.file_name)

        # make the download process slower
        self.data_layer.connect_to_cell_data()
        self.settings.launch()
        self.settings.downloads()
        self.download_manager.clean_downloads_list()

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

    def test_run(self):
        self.UTILS.statusbar.clearAllStatusBarNotifs()

        self.browser.launch()
        self.browser.open_url(self.test_url)
        self.download_manager.download_file(self.file_name)
        self.UTILS.statusbar.wait_for_notification_toaster_title(text="Download started", notif_text="Downloading", timeout=15)
        time.sleep(5)

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

        self.settings.launch()
        self.settings.downloads()

        # Verify status downloading using data-state="downloading".
        self.download_manager.verify_download_status(self.data_url, "downloading")
        self.download_manager.verify_download_graphical_status(self.data_url, "downloading")

        self.download_manager.stop_download(self.data_url, True)

        is_there = self.UTILS.statusbar.isIconInStatusBar(DOM.Statusbar.downloads)

        self.UTILS.test.test(not is_there, "Verify that the download icon in status bar is dismissed")
开发者ID:owdqa,项目名称:owd_test_cases,代码行数:50,代码来源:test_33937.py

示例14: test_main

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

    def setUp(self):

        GaiaTestCase.setUp(self)
        self.UTILS = UTILS(self)

        self.browser = Browser(self)
        self.settings = Settings(self)
        self.download_manager = DownloadManager(self)
        self.test_url = self.UTILS.general.get_config_variable("download_url", "common")
        self.file_name = "Crazy_Horse.jpg"
        self.data_url = "{}/{}".format(self.test_url, self.file_name)

        self.connect_to_network()
        self.settings.launch()
        self.settings.downloads()
        self.download_manager.clean_downloads_list()

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

    def test_run(self):
        self.UTILS.statusbar.clearAllStatusBarNotifs()

        self.browser.launch()
        self.browser.open_url(self.test_url)
        self.download_manager.download_file(self.file_name)
        self.UTILS.statusbar.wait_for_notification_toaster_title("Download complete", timeout=60)
        time.sleep(5)

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

        self.settings.launch()
        self.settings.downloads()
        self.download_manager.open_download(self.data_url)
        self.download_manager.tap_on_open_option()

        # Verify that the image is opened.
        self.UTILS.iframe.switchToFrame(*DOM.Gallery.frame_locator)
        title = self.UTILS.element.getElement(DOM.Gallery.file_name_header, "File name header")
        self.UTILS.test.test(title.text == self.file_name, "File name matches in Gallery")

        is_loaded = self.UTILS.element.waitForElements(DOM.Gallery.current_image_pic,
                                                       "Waiting for image to be loaded")
        self.UTILS.test.test(is_loaded, "Image has been loaded")
开发者ID:owdqa,项目名称:owd_test_cases,代码行数:50,代码来源:test_33915.py

示例15: test_main

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

    def setUp(self):

        GaiaTestCase.setUp(self)
        self.UTILS = UTILS(self)

        # Specific for this test.
        self.browser = Browser(self)
        self.settings = Settings(self)
        self.download_manager = DownloadManager(self)
        self.testURL = self.UTILS.general.get_config_variable("download_url", "common")
        self.file_names = ["Toast.doc", "Porridge.doc"]

        self.connect_to_network()
        self.settings.launch()
        self.settings.downloads()
        self.download_manager.clean_downloads_list()

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

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

    def test_run(self):
        self.UTILS.statusbar.clearAllStatusBarNotifs()

        self.browser.launch()
        self.browser.open_url(self.testURL)

        map(self.download_manager.download_file, self.file_names)
        self.UTILS.statusbar.wait_for_notification_toaster_title("Download complete", timeout=60)
        time.sleep(5)

        previous_number_of_pictures = len(self.data_layer.sdcard_files())
        self.settings.launch()
        self.settings.downloads()

        # Delete All downloads
        self.download_manager.delete_all_downloads()

        # Check that picture saved to SD card
        self.wait_for_condition(
            lambda m: len(self.data_layer.sdcard_files()) == previous_number_of_pictures - len(self.file_names), 20)
        self.assertEqual(len(self.data_layer.sdcard_files()), previous_number_of_pictures - len(self.file_names))
开发者ID:owdqa,项目名称:owd_test_cases,代码行数:49,代码来源:test_33908.py


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