Sha256: deffa0bcbc34c03c05dea0ff55b8e2e930eae0d8fa72586a7ffddc19e75b685a

Contents?: true

Size: 1.46 KB

Versions: 19

Compression:

Stored size: 1.46 KB

Contents

# encoding: utf-8
# UIAStaticText methods
module Appium::Common
  # s_ prefix for static_text to avoid conflict with generic text methods.

  # Get an array of text texts if text is nil else
  # Get all static textfields that include text.
  # @param text [String] the text to find.
  # @return [Array]
  def s_texts text=nil
    if text
      find_eles_by_text_include :text, text
    else
      find_eles_attr :text, :text
    end
  end

  def s_texts_names
    find_eles_attr :text, :name
  end

  # Get an array of text elements.
  # @return [Array<Text>]
  def e_s_texts
    find_eles :text
  end

  # Get the first text element.
  # @return [Text]
  def first_s_text
    first_ele :text
  end

  # Get the last text element
  # @return [Text]
  def last_s_text
    last_ele :text
  end

  # Get the first element that includes text.
  # @param text [String, Integer] the text to find. If int then the text at that index is returned.
  # @return [Text]
  def s_text text
    return ele_index :text, text if text.is_a? Numeric
    find_ele_by_text_include :text, text
  end

  # Get the first textfield that matches text.
  # @param text [String] the text that the tag must match
  # @return [Text]
  def s_text_exact text
    find_ele_by_text :text, text
  end

  # Get all static textfields that matches text.
  # @param text [String] the text that the tag must match
  # @return [Array<Text>]
  def s_texts_exact text
    find_eles_by_text :text, text
  end
end # module Appium::Common

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
appium_lib-0.24.1 lib/appium_lib/common/element/text.rb
appium_lib-0.24.0 lib/appium_lib/common/element/text.rb
appium_lib-0.23.0 lib/appium_lib/common/element/text.rb
appium_lib-0.22.1 lib/appium_lib/common/element/text.rb
appium_lib-0.22.0 lib/appium_lib/common/element/text.rb
appium_lib-0.21.0 lib/appium_lib/common/element/text.rb
appium_lib-0.19.1 lib/appium_lib/common/element/text.rb
appium_lib-0.19.0 lib/appium_lib/common/element/text.rb
appium_lib-0.18.2 lib/appium_lib/common/element/text.rb
appium_lib-0.18.1 lib/appium_lib/common/element/text.rb
appium_lib-0.18.0 lib/appium_lib/common/element/text.rb
appium_lib-0.17.0 lib/appium_lib/common/element/text.rb
appium_lib-0.16.0 lib/appium_lib/common/element/text.rb
appium_lib-0.15.2 lib/appium_lib/common/element/text.rb
appium_lib-0.15.1 lib/appium_lib/common/element/text.rb
appium_lib-0.15.0 lib/appium_lib/common/element/text.rb
appium_lib-0.14.0 lib/appium_lib/common/element/text.rb
appium_lib-0.13.0 lib/appium_lib/common/element/text.rb
appium_lib-0.12.0 lib/appium_lib/common/element/text.rb