Sha256: 95dfd1dbc5b9a31a26bffb9eea94c4c854b027832695939995509d859650e125

Contents?: true

Size: 706 Bytes

Versions: 6

Compression:

Stored size: 706 Bytes

Contents

require 'selenium-webdriver'

#Monkey Patch's - Use with care!
#Path to allow true custom capabilities
#e.g. job name for sauce labs
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

6 entries across 6 versions & 1 rubygems

Version Path
frameworks-capybara-0.3.0.rc1 lib/monkey-patches/webdriver-patches.rb
frameworks-capybara-0.2.0 lib/monkey-patches/webdriver-patches.rb
frameworks-capybara-0.2.0.rc7 lib/monkey-patches/webdriver-patches.rb
frameworks-capybara-0.2.0.rc6 lib/monkey-patches/webdriver-patches.rb
frameworks-capybara-0.2.0.rc5 lib/monkey-patches/webdriver-patches.rb
frameworks-capybara-0.2.0.rc4 lib/monkey-patches/webdriver-patches.rb