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


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

alias :existing_json_create :json_create

.json_create(data) ⇒ Object


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

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