lib/kelp/field.rb
def field_value(field)
      element = find_field(field)
      value = (element.tag_name == 'textarea') ? element.text : element.value
      # If field value is an Array, take the first item
      if value.class == Array
        value = value.first
      end
      return value.to_s
    end
# Return the string value found in the given field.
# If the field is `nil`, return the empty string.
#
# @param [String] field
#   Capybara locator for the field (name, id, or label text)
#
# @return [String]
#   The value found in the given field
#
# @since 0.2.1
#
Return the string value found in the given field.
If the field is `nil`, return the empty string.
Return the string value found in the given field . If the field is ` nil ` return the empty string .
def field_value(field)
      element = find_field(field)
      value = (element.tag_name == 'textarea') ? element.text : element.value
      if value.class == Array
        value = value.first
      end
      return value.to_s
    end
def field_value ( field ) element = find_field ( field ) value = ( element . tag_name == 'textarea' ) ? element . text : element . value if value . class == Array value = value . first end return value . to_s end
Return the string value found in the given field.
Return the string value found in the given field .
# If field value is an Array, take the first item
The value found in the given field
The value found in the given field
String
field
field Capybara locator for the field (name, id, or label text)
field Capybara locator for the field ( name id or label text )
since
None