Sha256: 26ddbc7ca14dea6024dd31fdd23ec2605db1b9a3b9f7c5ebb6af79159dc8e2de

Contents?: true

Size: 1.3 KB

Versions: 61

Compression:

Stored size: 1.3 KB

Contents

# encoding: utf-8
module Appium::Android
  # UIATextField methods

  # Get an array of textfield texts.
  # @return [Array<String>]
  def textfields
    find_eles_attr :textfield, :text
  end

  # Get an array of textfield elements.
  # @return [Array<Textfield>]
  def e_textfields
    find_eles :textfield
  end

  # Get the first textfield element.
  # @return [Textfield]
  def first_textfield
    first_ele :textfield
  end

  # Get the last textfield element.
  # @return [Textfield]
  def last_textfield
    last_ele :textfield
  end

  # Get the first textfield that includes text or name (content description).
  # @param text [String, Integer] the text to search for. If int then the textfield at that index is returned.
  # @return [Textfield]
  def textfield text
    return ele_index :textfield, text if text.is_a? Numeric

    # s.className('android.widget.EditText').descriptionContains(value);
    args = [ [4, 'android.widget.EditText'], [7, text] ],
    # s.className('android.widget.EditText').textContains(value);
           [ [4, 'android.widget.EditText'], [3, text] ]
    mobile :find, args
  end

  # Get the first textfield that matches text.
  # @param text [String] the text to match
  # @return [Textfield]
  def textfield_exact text
    find_ele_by_text :textfield, text
  end
end # module Appium::Android

Version data entries

61 entries across 61 versions & 1 rubygems

Version Path
appium_lib-0.11.0 lib/appium_lib/android/element/textfield.rb
appium_lib-0.10.0 lib/appium_lib/android/element/textfield.rb
appium_lib-0.9.1 lib/appium_lib/android/element/textfield.rb
appium_lib-0.9.0 lib/appium_lib/android/element/textfield.rb
appium_lib-0.8.0 lib/appium_lib/android/element/textfield.rb
appium_lib-0.7.1 lib/appium_lib/android/element/textfield.rb
appium_lib-0.7.0 lib/appium_lib/android/element/textfield.rb
appium_lib-0.6.7 lib/appium_lib/android/element/textfield.rb
appium_lib-0.6.6 lib/appium_lib/android/element/textfield.rb
appium_lib-0.6.5 lib/appium_lib/android/element/textfield.rb
appium_lib-0.6.4 lib/appium_lib/android/element/textfield.rb
appium_lib-0.6.3 lib/appium_lib/android/element/textfield.rb
appium_lib-0.6.2 lib/appium_lib/android/element/textfield.rb
appium_lib-0.6.1 lib/appium_lib/android/element/textfield.rb
appium_lib-0.6.0 lib/appium_lib/android/element/textfield.rb
appium_lib-0.5.16 lib/appium_lib/android/element/textfield.rb
appium_lib-0.5.15 lib/appium_lib/android/element/textfield.rb
appium_lib-0.5.14 lib/appium_lib/android/element/textfield.rb
appium_lib-0.5.13 lib/appium_lib/android/element/textfield.rb
appium_lib-0.5.12 lib/appium_lib/android/element/textfield.rb