module Selenium::WebDriver::DriverExtensions::HasNetworkConnection
def network_connection_type
def network_connection_type connection_value = @bridge.network_connection connection_type = values_to_type[connection_value] # In case the connection type is not recognized return the # connection value. connection_type || connection_value end
def network_connection_type=(connection_type)
def network_connection_type=(connection_type) raise ArgumentError, 'Invalid connection type' unless valid_type? connection_type connection_value = type_to_values[connection_type] @bridge.network_connection = connection_value end
def type_to_values
def type_to_values {airplane_mode: 1, wifi: 2, data: 4, all: 6, none: 0} end
def valid_type?(type)
def valid_type?(type) type_to_values.keys.include? type end
def values_to_type
def values_to_type type_to_values.invert end