Skip to content

Commit 6e215ff

Browse files
Reorder iOS text methods
1 parent ead35f9 commit 6e215ff

File tree

2 files changed

+21
-16
lines changed

2 files changed

+21
-16
lines changed

lib/appium_lib/ios/element/text.rb

+17-16
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,17 @@
22
module Appium
33
module Ios
44
UIAStaticText = 'UIAStaticText'
5-
# Get an array of text elements.
6-
# @return [Array<Text>]
7-
def e_s_texts
8-
tags UIAStaticText
5+
6+
# Get the first element that includes text.
7+
# @param value [String, Integer] the value to find. If int then the text at that index is returned.
8+
# @return [Text]
9+
def s_text value
10+
return ele_index :text, value if value.is_a? Numeric
11+
xpath_visible_contains UIAStaticText, value
12+
end
13+
14+
def s_texts value
15+
xpaths_visible_contains UIAStaticText, value
916
end
1017

1118
# Get the first text element.
@@ -20,18 +27,6 @@ def last_s_text
2027
last_ele UIAStaticText
2128
end
2229

23-
# Get the first element that includes text.
24-
# @param value [String, Integer] the value to find. If int then the text at that index is returned.
25-
# @return [Text]
26-
def s_text value
27-
return ele_index :text, value if value.is_a? Numeric
28-
xpath_visible_contains UIAStaticText, value
29-
end
30-
31-
def s_texts value
32-
xpaths_visible_contains UIAStaticText, value
33-
end
34-
3530
# Get the first textfield that matches text.
3631
# @param value [String] the value that the tag must match
3732
# @return [Text]
@@ -45,5 +40,11 @@ def s_text_exact value
4540
def s_texts_exact value
4641
xpaths_visible_exact UIAStaticText, value
4742
end
43+
44+
# Get an array of text elements.
45+
# @return [Array<Text>]
46+
def e_s_texts
47+
tags UIAStaticText
48+
end
4849
end # module Common
4950
end # module Appium

lib/appium_lib/ios/element/textfield.rb

+4
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ module Ios
33
UIATextField = 'UIATextField'
44
UIASecureTextField = 'UIASecureTextField'
55

6+
private
7+
68
# @private
79
def _textfield_visible_string opts={}
810
index = opts.fetch :index, false
@@ -27,6 +29,8 @@ def _textfield_contains_string value
2729
"#{textfield} | #{secure}"
2830
end
2931

32+
public
33+
3034
# Get the first textfield that matches text.
3135
# @param value [String, Integer] the text to match exactly. If int then the textfield at that index is returned.
3236
# @return [Textfield]

0 commit comments

Comments
 (0)