Class: Webrat::Form

Inherits:
Element show all
Defined in:
lib/webrat/core/elements/form.rb

Overview

:nodoc:

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Element

#initialize, #inspect, load, load_all, #path

Constructor Details

This class inherits a constructor from Webrat::Element

Instance Attribute Details

#elementObject (readonly)

Returns the value of attribute element.



9
10
11
# File 'lib/webrat/core/elements/form.rb', line 9

def element
  @element
end

Class Method Details

.xpath_searchObject



11
12
13
# File 'lib/webrat/core/elements/form.rb', line 11

def self.xpath_search
  [".//form"]
end

Instance Method Details

#field_named(name, *field_types) ⇒ Object



23
24
25
# File 'lib/webrat/core/elements/form.rb', line 23

def field_named(name, *field_types)
  Webrat::Locators::FieldNamedLocator.new(@session, dom, name, *field_types).locate
end

#fieldsObject



15
16
17
# File 'lib/webrat/core/elements/form.rb', line 15

def fields
  @fields ||= Field.load_all(@session, @element)
end

#submitObject



19
20
21
# File 'lib/webrat/core/elements/form.rb', line 19

def submit
  @session.request_page(form_action, form_method, params)
end