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


Python Settings.connect_to_wifi方法代码示例

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


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

示例1: test_main

# 需要导入模块: from OWDTestToolkit.apps.settings import Settings [as 别名]
# 或者: from OWDTestToolkit.apps.settings.Settings import connect_to_wifi [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")

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

    def test_run(self):
        self.settings.launch()
        self.settings.wifi()
        self.settings.connect_to_wifi(self.wifi_name, self.wifi_pass)
        network = {'ssid': self.wifi_name}
        self.wait_for_condition(lambda m: self.data_layer.is_wifi_connected(network), timeout=30)

        self.UTILS.iframe.switchToFrame(*DOM.Settings.frame_locator)
        self.settings.wifi_list_tap_name(self.wifi_name)
        self.settings.wifi_forget()

        self.wait_for_condition(lambda m: not self.data_layer.is_wifi_connected(network), timeout=30)

        # make sure we need to add the details again.
        self.UTILS.iframe.switchToFrame(*DOM.Settings.frame_locator)
        self.settings.wifi_list_tap_name(self.wifi_name)
        time.sleep(1)
        self.UTILS.element.waitForElements(DOM.Settings.wifi_login_pass, "Password field")
开发者ID:owdqa,项目名称:owd_test_cases,代码行数:36,代码来源:test_26561.py

示例2: test_main

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

示例3: test_main

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

    def __init__(self, *args, **kwargs):
        kwargs['restart'] = True
        super(test_main, self).__init__(*args, **kwargs)

    def setUp(self):

        # Set up child objects...
        GaiaTestCase.setUp(self)
        self.UTILS = UTILS(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")

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

    def test_run(self):
        self.settings.launch()
        time.sleep(1)
        self.settings.wifi()
        self.settings.connect_to_wifi(self.wifi_name, self.wifi_pass)

        self.UTILS.test.test(self.UTILS.network.is_network_type_enabled("wifi") == True, "Wifi mode is now enabled.")
开发者ID:owdqa,项目名称:owd_test_cases,代码行数:29,代码来源:test_26512.py

示例4: test_main

# 需要导入模块: from OWDTestToolkit.apps.settings import Settings [as 别名]
# 或者: from OWDTestToolkit.apps.settings.Settings import connect_to_wifi [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")

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

    def test_run(self):

        # Open the Settings application.
        self.settings.launch()
        time.sleep(2)
        self.settings.wifi()
        self.settings.connect_to_wifi(self.wifi_name, self.wifi_pass)
        network = {'ssid': self.wifi_name}
        self.wait_for_condition(lambda m: self.data_layer.is_wifi_connected(network), timeout=30)
        """
        Return to this wifi and check the details, giving some seconds for the
        device to get an IP address
        """

        time.sleep(10)
        self.UTILS.iframe.switchToFrame(*DOM.Settings.frame_locator)
        self.settings.wifi_list_tap_name(self.wifi_name)

        self.UTILS.element.waitForElements(DOM.Settings.wifi_details_header, "Wifi Details header")
        _forget = self.UTILS.element.getElement(DOM.Settings.wifi_details_forget_btn,
                                                "Details for connected wifi - forget button")
        _ip = self.UTILS.element.getElement(DOM.Settings.wifi_details_ipaddress,
                                            "Details for connected wifi - ip address")
        _link = self.UTILS.element.getElement(DOM.Settings.wifi_details_linkspeed,
                                              "Details for connected wifi - link speed")
        _sec = self.UTILS.element.getElement(DOM.Settings.wifi_details_security,
                                             "Details for connected wifi - security")
        _signal = self.UTILS.element.getElement(DOM.Settings.wifi_details_signal,
                                                "Details for connected wifi - signal")

        screenshot = self.UTILS.debug.screenShotOnErr()
        self.UTILS.reporting.logResult("info", "Screenshot: ", screenshot)
开发者ID:owdqa,项目名称:owd_test_cases,代码行数:50,代码来源:test_26560.py

示例5: test_main

# 需要导入模块: from OWDTestToolkit.apps.settings import Settings [as 别名]
# 或者: from OWDTestToolkit.apps.settings.Settings import connect_to_wifi [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")

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

    def test_run(self):
        self.settings.launch()
        time.sleep(2)
        self.settings.wifi()
        self.settings.connect_to_wifi(self.wifi_name, self.wifi_pass)
        network = {'ssid': self.wifi_name}
        self.wait_for_condition(lambda m: self.data_layer.is_wifi_connected(network), timeout=30)

        self.UTILS.iframe.switchToFrame(*DOM.Settings.frame_locator)
        self.UTILS.element.getElement(DOM.Settings.wifi_advanced_manage, "Manage networks button").tap()

        self.UTILS.element.waitForElements(DOM.Settings.wifi_advanced_mac, "Mac address")
        self.UTILS.element.waitForElements(DOM.Settings.wifi_advanced_knownNets, "Known networks")
        self.UTILS.element.waitForElements(DOM.Settings.wifi_advanced_joinHidden, "Join hidden network button")

        screenshot = self.UTILS.debug.screenShotOnErr()
        self.UTILS.reporting.logResult("info", "Screenshot at this point:", screenshot)

        x = self.UTILS.element.getElements(DOM.Settings.wifi_advanced_knownNets,
                                           "Known networks (should only be 1).")[0]
        x.tap()

        x = self.UTILS.debug.screenShotOnErr()
        self.UTILS.reporting.logResult("info", "Screenshot at this point:", x)

        self.UTILS.element.waitForElements(DOM.Settings.wifi_advanced_forgetBtn, "'Forget network' button")
        self.UTILS.element.waitForElements(DOM.Settings.wifi_advanced_cancelBtn, "'Cancel' button")
        forget_btn = self.marionette.find_element(*DOM.Settings.wifi_advanced_forgetBtn)
        forget_btn.tap()
开发者ID:owdqa,项目名称:owd_test_cases,代码行数:47,代码来源:test_26562.py

示例6: test_main

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

    def __init__(self, *args, **kwargs):
        kwargs['restart'] = True
        super(test_main, self).__init__(*args, **kwargs)

    def setUp(self):
        GaiaTestCase.setUp(self)
        self.UTILS = UTILS(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")

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

    def test_run(self):
        self.data_layer.disable_wifi()
        self.UTILS.element.waitForNotElements(DOM.Statusbar.wifi, "Wifi icon in statusbar")
        self.UTILS.test.test(not self.UTILS.network.is_network_type_enabled("wifi"),
                         "Wifi is disabled before we start this test.")

        self.UTILS.statusbar.toggleViaStatusBar("wifi")
        # If required, connect to the wifi.
        self.marionette.switch_to_frame()
        try:
            self.wait_for_element_present("xpath", "//iframe[contains(@{},'{}')]".\
                                        format(DOM.Settings.frame_locator[0], DOM.Settings.frame_locator[1]),
                                        timeout=10)

            # We need to supply the login details for the network.
            self.UTILS.iframe.switchToFrame(*DOM.Settings.frame_locator)
            self.settings.connect_to_wifi(self.wifi_name, self.wifi_pass)
            self.marionette.switch_to_frame()
        except:
            pass

        self.UTILS.element.waitForElements(DOM.Statusbar.wifi, "Wifi icon in statusbar", timeout=20)
        self.UTILS.statusbar.toggleViaStatusBar("wifi")
        self.UTILS.element.waitForNotElements(DOM.Statusbar.wifi, "Wifi icon in statusbar", timeout=20)
开发者ID:owdqa,项目名称:owd_test_cases,代码行数:44,代码来源:test_26412.py


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