Sha256: 8011c1d6202371c6e761aca05b1cd99f2f92cc672641993cb84e93858d968a52

Contents?: true

Size: 1018 Bytes

Versions: 1

Compression:

Stored size: 1018 Bytes

Contents

# Defines a mixin module that you can use to write Selenium tests
# without typing "@selenium." in front of every command.  Every
# call to a missing method will be automatically sent to the @selenium
# object.
module Selenium
  module Client
    
  module SeleniumHelper
    
      # Overrides default open method to actually delegates to @selenium
      def open(url)
        @selenium.open url
      end
    
      # Overrides default type method to actually delegates to @selenium
      def type(locator, value)
        @selenium.type locator, value
      end
    
      # Overrides default select method to actually delegates to @selenium
      def select(input_locator, option_locator)
        @selenium.select input_locator, option_locator
      end

      # Delegates to @selenium on method missing 
      def method_missing(method_name, *args)
        return super unless @selenium.respond_to?(method_name)
        
        @selenium.send(method_name, *args)
      end                  
    end
    
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
selenium-client-1.2.15 lib/selenium/client/selenium_helper.rb