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



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

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



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

def custom_capabilities(opts)
  @custom_capabilities = opts
end

#old_as_jsonObject

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



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

alias_method :old_as_json, :as_json