Sha256: e52eb715022d95ce67675f6db6fbf6ca2c79b252bc65cdbc697103c112f7061a

Contents?: true

Size: 1.38 KB

Versions: 2

Compression:

Stored size: 1.38 KB

Contents

# TextView methods
module Appium
  module Android
    TextView = 'android.widget.TextView'

    # Find the first TextView that contains value or by index.
    # @param value [String, Integer] the value to find.
    # If int then the TextView at that index is returned.
    # @return [TextView]
    def text value
      return ele_index TextView, value if value.is_a? Numeric
      xpath_visible_contains TextView, value
    end

    # Find all TextViews containing value.
    # If value is omitted, all texts are returned.
    # @param value [String] the value to search for
    # @return [Array<TextView>]
    def texts value=false
      return tags TextView unless value
      xpaths_visible_contains TextView, value
    end

    # Find the first TextView.
    # @return [TextView]
    def first_text
      first_ele TextView
    end

    # Find the last TextView.
    # @return [TextView]
    def last_text
      last_ele TextView
    end

    # Find the first TextView that exactly matches value.
    # @param value [String] the value to match exactly
    # @return [TextView]
    def text_exact value
      xpath_visible_exact TextView, value
    end

    # Find all TextViews that exactly match value.
    # @param value [String] the value to match exactly
    # @return [Array<TextView>]
    def texts_exact value
      xpaths_visible_exact TextView, value
    end
  end # module Android
end # module Appium

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
appium_lib-2.1.0 lib/appium_lib/android/element/text.rb
appium_lib-2.0.0 lib/appium_lib/android/element/text.rb