Skip to content

Commit b818def

Browse files
committed
Rubocop - Style/MethodDefParentheses
1 parent f2ed949 commit b818def

18 files changed

+129
-129
lines changed

lib/appium_lib/android/client_xpath.rb

+4-4
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
module Appium
44
module Android
5-
def _nodeset_to_uiselector opts = {}
5+
def _nodeset_to_uiselector(opts = {})
66
results = ''
77

88
nodes = opts[:nodes]
@@ -17,7 +17,7 @@ def _nodeset_to_uiselector opts = {}
1717
results.strip
1818
end
1919

20-
def _client_xpath opts = {}
20+
def _client_xpath(opts = {})
2121
root_node = Nokogiri::XML(get_source).children.first
2222

2323
instance = Hash.new -1
@@ -33,11 +33,11 @@ def _client_xpath opts = {}
3333
_nodeset_to_uiselector nodes: nodes, first: first
3434
end
3535

36-
def client_xpath xpath
36+
def client_xpath(xpath)
3737
find_element :uiautomator, _client_xpath(xpath: xpath, first: true)
3838
end
3939

40-
def client_xpaths xpath
40+
def client_xpaths(xpath)
4141
find_elements :uiautomator, _client_xpath(xpath: xpath, first: false)
4242
end
4343
end

lib/appium_lib/android/element/alert.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ module Android
33
# Click the first alert button that contains value or by index.
44
# @param value [Integer, String] either an integer index of the button or the button's name
55
# @return [void]
6-
def alert_click value
6+
def alert_click(value)
77
button(value).click
88
end
99

lib/appium_lib/android/element/button.rb

+7-7
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ module Android
77
private
88

99
# @private
10-
def _button_visible_selectors opts = {}
10+
def _button_visible_selectors(opts = {})
1111
button_index = opts.fetch :button_index, false
1212
image_button_index = opts.fetch :image_button_index, false
1313

@@ -21,14 +21,14 @@ def _button_visible_selectors opts = {}
2121
end
2222

2323
# @private
24-
def _button_exact_string value
24+
def _button_exact_string(value)
2525
button = string_visible_exact Button, value
2626
image_button = string_visible_exact ImageButton, value
2727
button + image_button
2828
end
2929

3030
# @private
31-
def _button_contains_string value
31+
def _button_contains_string(value)
3232
button = string_visible_contains Button, value
3333
image_button = string_visible_contains ImageButton, value
3434
button + image_button
@@ -40,7 +40,7 @@ def _button_contains_string value
4040
# @param value [String, Integer] the value to exactly match.
4141
# If int then the button at that index is returned.
4242
# @return [Button]
43-
def button value
43+
def button(value)
4444
# Don't use ele_index because that only works on one element type.
4545
# Android needs to combine button and image button to match iOS.
4646
if value.is_a? Numeric
@@ -57,7 +57,7 @@ def button value
5757
# If value is omitted, all buttons are returned.
5858
# @param value [String] the value to search for
5959
# @return [Array<Button>]
60-
def buttons value = false
60+
def buttons(value = false)
6161
return find_elements :uiautomator, _button_visible_selectors unless value
6262
find_elements :uiautomator, _button_contains_string(value)
6363
end
@@ -86,14 +86,14 @@ def last_button
8686
# Find the first button that exactly matches value.
8787
# @param value [String] the value to match exactly
8888
# @return [Button]
89-
def button_exact value
89+
def button_exact(value)
9090
find_element :uiautomator, _button_exact_string(value)
9191
end
9292

9393
# Find all buttons that exactly match value.
9494
# @param value [String] the value to match exactly
9595
# @return [Array<Button>]
96-
def buttons_exact value
96+
def buttons_exact(value)
9797
find_elements :uiautomator, _button_exact_string(value)
9898
end
9999
end # module Android

lib/appium_lib/android/element/generic.rb

+7-7
Original file line numberDiff line numberDiff line change
@@ -4,40 +4,40 @@ module Android
44
# Find the first element containing value
55
# @param value [String] the value to search for
66
# @return [Element]
7-
def find value
7+
def find(value)
88
complex_find_contains '*', value
99
end
1010

1111
# Find all elements containing value
1212
# @param value [String] the value to search for
1313
# @return [Array<Element>]
14-
def finds value
14+
def finds(value)
1515
complex_finds_contains '*', value
1616
end
1717

1818
# Find the first element exactly matching value
1919
# @param value [String] the value to search for
2020
# @return [Element]
21-
def find_exact value
21+
def find_exact(value)
2222
complex_find_exact '*', value
2323
end
2424

2525
# Find all elements exactly matching value
2626
# @param value [String] the value to search for
2727
# @return [Array<Element>]
28-
def finds_exact value
28+
def finds_exact(value)
2929
complex_finds_exact '*', value
3030
end
3131

3232
# @private
33-
def scroll_uiselector content
33+
def scroll_uiselector(content)
3434
"new UiScrollable(new UiSelector().scrollable(true).instance(0)).scrollIntoView(#{content}.instance(0));"
3535
end
3636

3737
# Scroll to the first element containing target text or description.
3838
# @param text [String] the text to search for in the text value and content description
3939
# @return [Element] the element scrolled to
40-
def scroll_to text
40+
def scroll_to(text)
4141
text = %Q("#{text}")
4242

4343
args = scroll_uiselector("new UiSelector().textContains(#{text})") +
@@ -49,7 +49,7 @@ def scroll_to text
4949
# Scroll to the first element with the exact target text or description.
5050
# @param text [String] the text to search for in the text value and content description
5151
# @return [Element] the element scrolled to
52-
def scroll_to_exact text
52+
def scroll_to_exact(text)
5353
text = %Q("#{text}")
5454

5555
args = scroll_uiselector("new UiSelector().text(#{text})") +

lib/appium_lib/android/element/text.rb

+4-4
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ module Android
77
# @param value [String, Integer] the value to find.
88
# If int then the TextView at that index is returned.
99
# @return [TextView]
10-
def text value
10+
def text(value)
1111
return ele_index TextView, value if value.is_a? Numeric
1212
complex_find_contains TextView, value
1313
end
@@ -16,7 +16,7 @@ def text value
1616
# If value is omitted, all texts are returned.
1717
# @param value [String] the value to search for
1818
# @return [Array<TextView>]
19-
def texts value = false
19+
def texts(value = false)
2020
return tags TextView unless value
2121
complex_finds_contains TextView, value
2222
end
@@ -36,14 +36,14 @@ def last_text
3636
# Find the first TextView that exactly matches value.
3737
# @param value [String] the value to match exactly
3838
# @return [TextView]
39-
def text_exact value
39+
def text_exact(value)
4040
complex_find_exact TextView, value
4141
end
4242

4343
# Find all TextViews that exactly match value.
4444
# @param value [String] the value to match exactly
4545
# @return [Array<TextView>]
46-
def texts_exact value
46+
def texts_exact(value)
4747
complex_finds_exact TextView, value
4848
end
4949
end # module Android

lib/appium_lib/android/element/textfield.rb

+4-4
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ module Android
66
# @param value [String, Integer] the text to match exactly.
77
# If int then the EditText at that index is returned.
88
# @return [EditText]
9-
def textfield value
9+
def textfield(value)
1010
return ele_index EditText, value if value.is_a? Numeric
1111
complex_find_contains EditText, value
1212
end
@@ -15,7 +15,7 @@ def textfield value
1515
# If value is omitted, all EditTexts are returned.
1616
# @param value [String] the value to search for
1717
# @return [Array<EditText>]
18-
def textfields value = false
18+
def textfields(value = false)
1919
return tags EditText unless value
2020
complex_finds_contains EditText, value
2121
end
@@ -35,14 +35,14 @@ def last_textfield
3535
# Find the first EditText that exactly matches value.
3636
# @param value [String] the value to match exactly
3737
# @return [EditText]
38-
def textfield_exact value
38+
def textfield_exact(value)
3939
complex_find_exact EditText, value
4040
end
4141

4242
# Find all EditTexts that exactly match value.
4343
# @param value [String] the value to match exactly
4444
# @return [Array<EditText>]
45-
def textfields_exact value
45+
def textfields_exact(value)
4646
complex_finds_exact EditText, value
4747
end
4848
end # module Android

0 commit comments

Comments
 (0)