lib/appium_lib/android/element/button.rb in appium_lib-9.17.0 vs lib/appium_lib/android/element/button.rb in appium_lib-9.18.0
- old
+ new
@@ -12,10 +12,11 @@
# Android needs to combine button and image button to match iOS.
if value.is_a? Numeric
index = value
raise "#{index} is not a valid index. Must be >= 1" if index <= 0
+ # 1 indexed
return find_element :uiautomator, _button_visible_selectors(index: index)
end
find_element :uiautomator, _button_contains_string(value)
end
@@ -72,11 +73,10 @@
raise _no_such_element if elements.empty?
elements.first
end
- # @private
def _button_visible_selectors(opts = {})
button_index = opts.fetch :button_index, false
image_button_index = opts.fetch :image_button_index, false
if button_index && image_button_index
@@ -86,17 +86,15 @@
"new UiSelector().className(#{Button});" \
"new UiSelector().className(#{ImageButton});"
end
end
- # @private
def _button_exact_string(value)
button = string_visible_exact Button, value
image_button = string_visible_exact ImageButton, value
button + image_button
end
- # @private
def _button_contains_string(value)
button = string_visible_contains Button, value
image_button = string_visible_contains ImageButton, value
button + image_button
end