Class: Selenium::WebDriver::Proxy

Inherits:
Object
  • Object
show all
Defined in:
lib/sauce/selenium.rb

Class Method Summary collapse

Class Method Details

.existing_json_createObject



13
# File 'lib/sauce/selenium.rb', line 13

alias :existing_json_create :json_create

.json_create(data) ⇒ Object



15
16
17
18
19
20
21
22
23
24
25
# File 'lib/sauce/selenium.rb', line 15

def json_create(data)
  # Some platforms derp up JSON encoding proxy details,
  # notably Appium.
  if (data.class == String)
    data = JSON.parse data if data.start_with? "{\"proxy"
  end

  dup = data.dup.delete_if {|k,v| v.nil?}
  dup.delete_if {|k,v| k == "autodetect" && v == false}
  existing_json_create(dup)
end