Sha256: 1aa9b14d16e7db30b1ee01c122ae49062a5b3baa93fb9233d44425f926e6f2a6

Contents?: true

Size: 1.65 KB

Versions: 4

Compression:

Stored size: 1.65 KB

Contents

module Appium
  module Android

    # Find the first element containing value
    # @param value [String] the value to search for
    # @return [Element]
    def find value
      complex_find_contains '*', value
    end

    # Find all elements containing value
    # @param value [String] the value to search for
    # @return [Array<Element>]
    def finds value
      complex_finds_contains '*', value
    end

    # Find the first element exactly matching value
    # @param value [String] the value to search for
    # @return [Element]
    def find_exact value
      complex_find_exact '*', value
    end

    # Find all elements exactly matching value
    # @param value [String] the value to search for
    # @return [Array<Element>]
    def finds_exact value
      complex_finds_exact '*', value
    end

    # Scroll to the first element containing target text or description.
    # @param text [String] the text to search for in the text value and content description
    # @return [Element] the element scrolled to
    def scroll_to text
      args =
        # textContains(text)
        [[3, text]],
          # descriptionContains(text)
          [[7, text]]

      complex_find mode: 'scroll', selectors: args
    end

    # Scroll to the first element with the exact target text or description.
    # @param text [String] the text to search for in the text value and content description
    # @return [Element] the element scrolled to
    def scroll_to_exact text
      args =
        # text(text)
        [[1, text]],
          # description(text)
          [[5, text]]

      complex_find mode: 'scroll', selectors: args
    end
  end # module Android
end # module Appium

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
appium_lib-3.0.3 lib/appium_lib/android/element/generic.rb
appium_lib-3.0.2 lib/appium_lib/android/element/generic.rb
appium_lib-3.0.1 lib/appium_lib/android/element/generic.rb
appium_lib-3.0.0 lib/appium_lib/android/element/generic.rb