Class: Capybara::UI::ListItem

Inherits:
Widget
  • Object
show all
Defined in:
lib/capybara/ui/widgets/list_item.rb

Constant Summary

Constants included from Capybara::UI

VERSION

Instance Attribute Summary

Attributes inherited from Widget

#root

Instance Method Summary collapse

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

#to_rowObject

Returns this ListItem's contents formatted as a row, for comparison with a Cucumber::Ast::Table. By default, it simply returns an array with a single element–the widget's text.

In general, this method will be called by List#to_table.

Overriding

Feel free to override this method to return whatever you need it to. Usually, if the default return value isn't what you want, you'll probably want to return a Hash where both keys and values are strings, so that you don't need to worry about column order when you pass the table to Cucumber::Ast::Table#diff!.

See List#to_table for more information.


19
20
21
# File 'lib/capybara/ui/widgets/list_item.rb', line 19

def to_row
  [to_cell]
end