@@ -32,9 +32,10 @@ def _button_contains_string value
32
32
33
33
public
34
34
35
- # Find a button by text and optionally number.
36
- # @param value [String, Integer] the value to exactly match. If int then the button at that index is returned.
37
- # @return [Button] the button found with text and matching number
35
+ # Find the first button that contains value or by index.
36
+ # @param value [String, Integer] the value to exactly match.
37
+ # If int then the button at that index is returned.
38
+ # @return [Button]
38
39
def button value
39
40
# Don't use ele_index because that only works on one element type.
40
41
# Android needs to combine button and image button to match iOS.
@@ -48,37 +49,40 @@ def button value
48
49
xpath _button_contains_string value
49
50
end
50
51
52
+ # Find all buttons containing value
53
+ # @param value [String] the value to search for
54
+ # @return [Array<Button>]
51
55
def buttons value
52
56
xpaths _button_contains_string value
53
57
end
54
58
55
- # Get the first button element .
59
+ # Find the first button.
56
60
# @return [Button]
57
61
def first_button
58
62
xpath _button_visible_string
59
63
end
60
64
61
- # Get the last button element .
65
+ # Find the last button.
62
66
# @return [Button]
63
67
def last_button
64
68
xpath _button_visible_string index : 'last()'
65
69
end
66
70
67
- # Get the first button element that exactly matches text .
71
+ # Find the first button that exactly matches value .
68
72
# @param value [String] the value to match exactly
69
73
# @return [Button]
70
74
def button_exact value
71
75
xpath _button_exact_string value
72
76
end
73
77
74
- # Get all button elements that exactly match text .
78
+ # Find all buttons that exactly match value .
75
79
# @param value [String] the value to match exactly
76
80
# @return [Array<Button>]
77
81
def buttons_exact value
78
82
xpaths _button_exact_string value
79
83
end
80
84
81
- # Get an array of button elements .
85
+ # Find all buttons .
82
86
# @return [Array<Button>]
83
87
def e_buttons
84
88
xpaths _button_visible_string
0 commit comments