Sha256: 7b2b34fbc1f72d664f4acf21fe33744908b4f008c663007702f10f6402674224

Contents?: true

Size: 638 Bytes

Versions: 21

Compression:

Stored size: 638 Bytes

Contents

require 'selenium-webdriver'

#Monkey Patch's - Use with care!
#
module Selenium
  module WebDriver
    module Remote
      class Capabilities

        def custom_capabilities(opts)
          @custom_capabilities = opts
        end

        #hopefuly this alias approach will mean we capture changes in the webdriver method
        alias_method :old_as_json, :as_json
        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

      end
    end
  end
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
frameworks-capybara-0.0.39 lib/monkey-patches/webdriver-patches.rb
frameworks-capybara-0.0.38 lib/monkey-patches/webdriver-patches.rb
frameworks-capybara-0.0.37 lib/monkey-patches/webdriver-patches.rb
frameworks-capybara-0.0.36 lib/monkey-patches/webdriver-patches.rb
frameworks-capybara-0.0.35 lib/monkey-patches/webdriver-patches.rb
frameworks-capybara-0.0.34 lib/monkey-patches/webdriver-patches.rb
frameworks-capybara-0.0.33 lib/monkey-patches/webdriver-patches.rb
frameworks-capybara-0.0.32 lib/monkey-patches/webdriver-patches.rb
frameworks-capybara-0.0.31 lib/monkey-patches/webdriver-patches.rb
frameworks-capybara-0.0.30 lib/monkey-patches/webdriver-patches.rb
frameworks-capybara-0.0.29 lib/monkey-patches/webdriver-patches.rb
frameworks-capybara-0.0.28 lib/monkey-patches/webdriver-patches.rb
frameworks-capybara-0.0.27 lib/monkey-patches/webdriver-patches.rb
frameworks-capybara-0.0.25 lib/monkey-patches/webdriver-patches.rb
frameworks-capybara-0.0.24 lib/monkey-patches/webdriver-patches.rb
frameworks-capybara-0.0.23 lib/monkey-patches/webdriver-patches.rb
frameworks-capybara-0.0.22 lib/monkey-patches/webdriver-patches.rb
frameworks-capybara-0.0.20 lib/monkey-patches/webdriver-patches.rb
frameworks-capybara-0.0.19 lib/monkey-patches/webdriver-patches.rb
frameworks-capybara-0.0.18 lib/monkey-patches/webdriver-patches.rb