Class: Capybara::UI::Form

Inherits:
FieldGroup show all
Defined in:
lib/capybara/ui/widgets/form.rb

Constant Summary

Constants included from Capybara::UI

VERSION

Instance Attribute Summary

Attributes inherited from Widget

#root

Instance Method Summary collapse

Methods inherited from FieldGroup

check_box, default_locator, field, field_names, #fields, radio_button, select, #set, text_field

Methods inherited from Widget

action, #class?, #classes, #click, #double_click, filter, filter?, find_all_in, find_in, #has_action?, #hover, #html, #id, #initialize, not_present_in?, present_in?, #right_click, root, selector, #text, #to_cell, #to_s, #value, widget_delegator

Methods included from Widgets::DSL

#form, #list, #widget

Methods included from WidgetParts::Container

#has_widget?, #not_visible?, #visible?, #widget, #widgets

Methods included from Capybara::UI

#deprecate

Methods included from Constructors

#Decimal, #Integer, #Widget

Methods included from WidgetParts::Struct

included

Constructor Details

This class inherits a constructor from Capybara::UI::Widget

Instance Method Details

#submit_with(attributes) ⇒ Object

Submit form with attributes.

Parameters:

  • attributes (Hash)

    the form fields and their values

Returns:

  • the current widget


13
14
15
16
# File 'lib/capybara/ui/widgets/form.rb', line 13

def submit_with(attributes)
  set attributes
  submit
end

#to_tableObject


18
19
20
21
22
23
24
25
# File 'lib/capybara/ui/widgets/form.rb', line 18

def to_table
  info = self.
    class.
    field_names.
    each_with_object({}) { |e, a| a[e.to_s] = widget(e).to_cell }

  [info]
end