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")
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)
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.")
class test_main(GaiaTestCase): def setUp(self): GaiaTestCase.setUp(self) self.UTILS = UTILS(self) self.settings = Settings(self) def tearDown(self): self.UTILS.reporting.reportResults() GaiaTestCase.tearDown(self) def test_run(self): self.settings.launch() self.settings.wifi() self.settings.wifi_switch_on() available_networks = self.UTILS.element.getElements( DOM.Settings.wifi_available_networks, "Available networks", False) self.UTILS.reporting.logResult("info", "Found {} networks".format(len(available_networks))) for network in available_networks: network_name = network.find_element(*("css selector", "span")).text try: network.find_element(*("css selector", "aside.secured")) network.find_element(*("css selector", "small[data-l10n-id='securedBy']")) self.UTILS.reporting.logResult('info', "Network [{}] is secured".format(network_name)) except: self.UTILS.reporting.logResult('info', "Network [{}] is NOT secured".format(network_name))
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)
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)
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.data_layer.disable_wifi() self.UTILS.element.waitForNotElements(DOM.Statusbar.wifi, "Wifi icon in statusbar") self.UTILS.test.test( self.UTILS.network.is_network_type_enabled("wifi") == False, "Wifi is disabled before we start this test.") self.settings.launch() self.settings.wifi() self.settings.connect_to_wifi(self.wifi_name, self.wifi_pass) self.marionette.switch_to_frame() time.sleep(5) self.UTILS.element.waitForElements(DOM.Statusbar.wifi, "Wifi icon in statusbar", True, 20, False) # Disable wifi mode. self.UTILS.home.goHome() self.settings.launch() self.settings.wifi() self.settings.wifi_switch_off() # Data icon is no longer visible in status bar. self.UTILS.element.waitForNotElements(DOM.Statusbar.wifi, "Wifi icon not in statusbar")
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()
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")
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)