lib/appium_lib/ios/xcuitest/element/textfield.rb in appium_lib-9.15.1 vs lib/appium_lib/ios/xcuitest/element/textfield.rb in appium_lib-9.15.2
- old
+ new
@@ -22,13 +22,15 @@
# @return [TextField]
def textfield(value)
if value.is_a? Numeric
index = value
raise "#{index} is not a valid index. Must be >= 1" if index <= 0
+
index -= 1 # eles_by_json and _textfields_with_predicate is 0 indexed.
result = _textfields_with_predicate[index]
raise _no_such_element if result.nil?
+
return result
end
raise_error_if_no_element textfields(value).first
@@ -54,9 +56,10 @@
# Find the last TextField.
# @return [TextField]
def last_textfield
result = _textfields_with_predicate.last
raise _no_such_element if result.nil?
+
result
end
# Find the first TextField that exactly matches value.
# @param value [String] the value to match exactly