def connect_to_wifi(self, network_ssid, password, key_management=None):
    wifi_network = self.find_wifi_network(network_ssid)
    wifi_network.tap()
    if key_management:
        self.wait_for_element_displayed(*self._password_input_locator)
        self.marionette.find_element(*self._password_input_locator).send_keys(password)
        self.marionette.find_element(*self._join_network_locator).tap()
def connect_to_wifi(self, network_ssid, password, key_management=None):
    wifi_network = self.find_wifi_network(network_ssid)
    wifi_network.tap()
    if key_management:
        self.wait_for_element_displayed(*self._password_input_locator)
        self.marionette.find_element(*self._password_input_locator).send_keys(password)
        self.marionette.find_element(*self._join_network_locator).tap()