Sha256: 81f83551e3f951721c827338def5b8cf54dae59125ada12d16a14daf489e9d42

Contents?: true

Size: 1010 Bytes

Versions: 15

Compression:

Stored size: 1010 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 standard "open" method with @selenium.open
      def open(addr)
        @selenium.open(addr)
      end
    
      # Overrides standard "type" method with @selenium.type
      def type(inputLocator, value)
        @selenium.type(inputLocator, value)
      end
    
      # Overrides standard "select" method with @selenium.select
      def select(inputLocator, optionLocator)
        @selenium.select(inputLocator, optionLocator)
      end

      # Passes all calls to missing methods to @selenium
      def method_missing(method_name, *args)
        if args.empty?
            @selenium.send(method_name)
        else
            @selenium.send(method_name, *args)
        end
      end      
    end
    
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
selenium-client-1.2.3 lib/selenium/client/selenium_helper.rb
selenium-client-1.2.9 lib/selenium/client/selenium_helper.rb
selenium-client-1.2.10 lib/selenium/client/selenium_helper.rb
selenium-client-1.2.8 lib/selenium/client/selenium_helper.rb
selenium-client-1.2 lib/selenium/client/selenium_helper.rb
selenium-client-1.2.1 lib/selenium/client/selenium_helper.rb
selenium-client-1.2.12 lib/selenium/client/selenium_helper.rb
selenium-client-1.2.4 lib/selenium/client/selenium_helper.rb
selenium-client-1.2.11 lib/selenium/client/selenium_helper.rb
selenium-client-1.2.6 lib/selenium/client/selenium_helper.rb
selenium-client-1.2.13 lib/selenium/client/selenium_helper.rb
selenium-client-1.2.2 lib/selenium/client/selenium_helper.rb
selenium-client-1.2.7 lib/selenium/client/selenium_helper.rb
selenium-client-1.2.5 lib/selenium/client/selenium_helper.rb
selenium-client-1.2.14 lib/selenium/client/selenium_helper.rb