Sha256: 167dcc2a26ccd24abb5425f1e62077cd90c734aae8092226c17db836f7147371

Contents?: true

Size: 707 Bytes

Versions: 6

Compression:

Stored size: 707 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.2.6 lib/monkey-patches/webdriver-patches.rb
frameworks-capybara-0.2.5 lib/monkey-patches/webdriver-patches.rb
frameworks-capybara-0.2.4 lib/monkey-patches/webdriver-patches.rb
frameworks-capybara-0.2.3 lib/monkey-patches/webdriver-patches.rb
frameworks-capybara-0.2.2 lib/monkey-patches/webdriver-patches.rb
frameworks-capybara-0.2.1 lib/monkey-patches/webdriver-patches.rb