Sha256: 93e70f54e274c4fabea547679eb46395d6a032a73c30d4bd6d43e8f0c115321f

Contents?: true

Size: 1.5 KB

Versions: 39

Compression:

Stored size: 1.5 KB

Contents

module Webrat
  module Methods #:nodoc:

    def self.delegate_to_session(*meths)
      meths.each do |meth|
        self.class_eval <<-RUBY
          def #{meth}(*args, &blk)
            webrat_session.#{meth}(*args, &blk)
          end
        RUBY
      end
    end
    
    def webrat
      webrat_session
    end
    
    def webrat_session
      @_webrat_session ||= ::Webrat.session_class.new(self)
    end
    
    # all of these methods delegate to the @session, which should
    # be created transparently.
    #
    # Note that when using Webrat, #request also uses @session, so
    # that #request and webrat native functions behave interchangably

    delegate_to_session \
      :visits, :visit,
      :within,
      :header, :http_accept, :basic_auth,
      :save_and_open_page,
      :fills_in, :fill_in,
      :checks, :check, 
      :unchecks, :uncheck,
      :chooses, :choose,
      :selects, :select,
      :attaches_file, :attach_file,
      :current_page,
      :current_url,
      :clicks_link, :click_link,
      :clicks_area, :click_area,
      :clicks_button, :click_button,
      :reload, :reloads,
      :clicks_link_within, :click_link_within,
      :field_labeled,
      :select_option,
      :set_hidden_field, :submit_form,
      :request_page, :current_dom,
      :response_body, 
      :selects_date, :selects_time, :selects_datetime,
      :select_date, :select_time, :select_datetime,
      :field_by_xpath,
      :field_with_id,
      :selenium,
      :simulate, :automate
      
      
    
  end
end

Version data entries

39 entries across 39 versions & 12 rubygems

Version Path
adva-0.3.2 test/webrat/lib/webrat/core/methods.rb
adva-0.3.1 test/webrat/lib/webrat/core/methods.rb
adva-0.3.0 test/webrat/lib/webrat/core/methods.rb
adva-0.2.4 test/webrat/lib/webrat/core/methods.rb
adva-0.2.3 test/webrat/lib/webrat/core/methods.rb
adva-0.2.2 test/webrat/lib/webrat/core/methods.rb
adva-0.2.1 test/webrat/lib/webrat/core/methods.rb
adva-0.2.0 test/webrat/lib/webrat/core/methods.rb
adva-0.1.4 test/webrat/lib/webrat/core/methods.rb
adva-0.1.3 test/webrat/lib/webrat/core/methods.rb
adva-0.1.2 test/webrat/lib/webrat/core/methods.rb
adva-0.1.1 test/webrat/lib/webrat/core/methods.rb
adva-0.1.0 test/webrat/lib/webrat/core/methods.rb
adva-0.0.1 test/webrat/lib/webrat/core/methods.rb
aslakhellesoy-webrat-0.3.2.2 lib/webrat/core/methods.rb
auxesis-webrat-0.4.1 lib/webrat/core/methods.rb
brynary-webrat-0.4.0 lib/webrat/core/methods.rb
diabolo-webrat-0.4.2 lib/webrat/core/methods.rb
hectoregm-webrat-0.4.2 lib/webrat/core/methods.rb
jferris-webrat-0.4.3.0.1238640835 lib/webrat/core/methods.rb