Class: Selenium::WebDriver::Remote::Capabilities

Inherits:
Object
  • Object
show all
Defined in:
lib/monkey-patches/webdriver-patches.rb

Instance Method Summary collapse

Instance Method Details

#as_json(opts = nil) ⇒ Object



16
17
18
19
20
21
22
23
24
25
# File 'lib/monkey-patches/webdriver-patches.rb', line 16

def as_json(opts = nil)

  hash = old_as_json
  if @custom_capabilities 
    @custom_capabilities.each do |key, value|
      hash[key] = value
    end
  end
  hash
end

#custom_capabilities(opts) ⇒ Object



10
11
12
# File 'lib/monkey-patches/webdriver-patches.rb', line 10

def custom_capabilities(opts)
  @custom_capabilities = opts
end

#old_as_jsonObject

hopefuly this alias approach will mean we capture changes in the webdriver method



15
# File 'lib/monkey-patches/webdriver-patches.rb', line 15

alias_method :old_as_json, :as_json