Class: Capybara::UI::CheckBox
- Defined in:
- lib/capybara/ui/widgets/check_box.rb
Overview
A check box.
Constant Summary
Constants included from Capybara::UI
Instance Attribute Summary
Attributes inherited from Widget
Instance Method Summary collapse
-
#get ⇒ Boolean
true
if the checkbox is checked,false
otherwise. -
#set(value) ⇒ Object
Checks or unchecks the current checkbox.
- #to_cell ⇒ Object
- #to_s ⇒ Object
Methods inherited from 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, #value, widget_delegator
Methods included from Widgets::DSL
Methods included from WidgetParts::Container
#has_widget?, #not_visible?, #visible?, #widget, #widgets
Methods included from Capybara::UI
Methods included from Constructors
Methods included from WidgetParts::Struct
Constructor Details
This class inherits a constructor from Capybara::UI::Widget
Instance Method Details
#get ⇒ Boolean
Returns true
if the checkbox is checked, false
otherwise.
14 15 16 |
# File 'lib/capybara/ui/widgets/check_box.rb', line 14 def get !! root.checked? end |
#set(value) ⇒ Object
Checks or unchecks the current checkbox.
10 |
# File 'lib/capybara/ui/widgets/check_box.rb', line 10 def_delegator :root, :set |
#to_cell ⇒ Object
18 19 20 |
# File 'lib/capybara/ui/widgets/check_box.rb', line 18 def to_cell to_s end |
#to_s ⇒ Object
23 24 25 |
# File 'lib/capybara/ui/widgets/check_box.rb', line 23 def to_s get ? 'yes' : 'no' end |