Class: Capybara::UI::TextField

Inherits:
Field show all
Defined in:
lib/capybara/ui/widgets/text_field.rb

Overview

A text field.

Constant Summary

Constants included from Capybara::UI

VERSION

Instance Attribute Summary

Attributes inherited from Widget

#root

Instance Method Summary collapse

Methods inherited from Field

root

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

#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

#content?Boolean

Returns:

  • (Boolean)


24
25
26
# File 'lib/capybara/ui/widgets/text_field.rb', line 24

def content?
  get.respond_to?(:empty?) ? ! get.empty? : !! get
end

#getObject

Returns The text field value.

Returns:

  • The text field value.



7
# File 'lib/capybara/ui/widgets/text_field.rb', line 7

def_delegator :root, :value, :get

#set(value) ⇒ Object

Sets the text field value.

Parameters:

  • value (String)

    the value to set.



13
# File 'lib/capybara/ui/widgets/text_field.rb', line 13

def_delegator :root, :set

#to_cellObject



20
21
22
# File 'lib/capybara/ui/widgets/text_field.rb', line 20

def to_cell
  get
end

#to_sObject

Returns the text field value, or the empty string if the field is empty.

Returns:

  • the text field value, or the empty string if the field is empty.



18
# File 'lib/capybara/ui/widgets/text_field.rb', line 18

def_delegator :get, :to_s