Class: Cucumber::Salad::Widgets::FieldGroup::CheckBox

Inherits:
Field
  • Object
show all
Defined in:
lib/cucumber/salad/widgets/field_group.rb

Overview

A check box.

Instance Attribute Summary

Attributes inherited from Widget

#root

Instance Method Summary collapse

Methods inherited from Field

find_in, present_in?

Methods inherited from Widget

find_in, #has_action?, #initialize, #inspect, present_in?, #reload, root, selector

Methods included from Cucumber::Salad::WidgetMacros

#action, #widget, #widget_delegator

Methods included from Cucumber::Salad::WidgetContainer

#has_widget?, #widget

Constructor Details

This class inherits a constructor from Cucumber::Salad::Widgets::Widget

Instance Method Details

#getBoolean

Returns true if the checkbox is checked, false otherwise.

Returns:

  • (Boolean)

    true if the checkbox is checked, false otherwise.



280
281
282
# File 'lib/cucumber/salad/widgets/field_group.rb', line 280

def get
  !! root.checked?
end

#set(value) ⇒ Object

Checks or unchecks the current checkbox.

Parameters:

  • value (Boolean)

    true to check the checkbox, false otherwise.



276
# File 'lib/cucumber/salad/widgets/field_group.rb', line 276

def_delegator :root, :set

#to_sObject



285
286
287
# File 'lib/cucumber/salad/widgets/field_group.rb', line 285

def to_s
  get ? 'yes' : 'no'
end