appium_lib 10.2.0 → 10.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (67) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +1 -14
  3. data/.travis.yml +0 -2
  4. data/CHANGELOG.md +9 -0
  5. data/Gemfile +14 -0
  6. data/Rakefile +14 -0
  7. data/appium_lib.gemspec +2 -2
  8. data/docs/android_docs.md +261 -229
  9. data/docs/ios_docs.md +346 -282
  10. data/lib/appium_lib.rb +14 -0
  11. data/lib/appium_lib/android/android.rb +14 -0
  12. data/lib/appium_lib/android/common/command/command.rb +14 -0
  13. data/lib/appium_lib/android/common/helper.rb +14 -0
  14. data/lib/appium_lib/android/element/alert.rb +14 -0
  15. data/lib/appium_lib/android/element/button.rb +35 -18
  16. data/lib/appium_lib/android/element/generic.rb +14 -0
  17. data/lib/appium_lib/android/element/text.rb +29 -14
  18. data/lib/appium_lib/android/element/textfield.rb +30 -15
  19. data/lib/appium_lib/android/espresso.rb +14 -0
  20. data/lib/appium_lib/android/espresso/bridge.rb +14 -0
  21. data/lib/appium_lib/android/espresso/element.rb +14 -0
  22. data/lib/appium_lib/android/espresso/element/button.rb +26 -12
  23. data/lib/appium_lib/android/espresso/element/generic.rb +14 -0
  24. data/lib/appium_lib/android/espresso/helper.rb +14 -0
  25. data/lib/appium_lib/android/uiautomator2.rb +14 -0
  26. data/lib/appium_lib/android/uiautomator2/bridge.rb +14 -0
  27. data/lib/appium_lib/android/uiautomator2/element.rb +14 -0
  28. data/lib/appium_lib/android/uiautomator2/element/button.rb +14 -0
  29. data/lib/appium_lib/android/uiautomator2/helper.rb +14 -0
  30. data/lib/appium_lib/appium.rb +14 -0
  31. data/lib/appium_lib/common/command.rb +14 -0
  32. data/lib/appium_lib/common/command/ws_logcat.rb +14 -0
  33. data/lib/appium_lib/common/device.rb +14 -0
  34. data/lib/appium_lib/common/helper.rb +19 -5
  35. data/lib/appium_lib/common/http_client.rb +14 -0
  36. data/lib/appium_lib/common/log.rb +14 -0
  37. data/lib/appium_lib/common/multi_touch.rb +14 -0
  38. data/lib/appium_lib/common/touch_actions.rb +14 -0
  39. data/lib/appium_lib/common/wait.rb +14 -0
  40. data/lib/appium_lib/driver.rb +16 -2
  41. data/lib/appium_lib/ios/common/errors.rb +14 -0
  42. data/lib/appium_lib/ios/common/helper.rb +15 -1
  43. data/lib/appium_lib/ios/element/alert.rb +14 -0
  44. data/lib/appium_lib/ios/element/button.rb +26 -9
  45. data/lib/appium_lib/ios/element/generic.rb +14 -0
  46. data/lib/appium_lib/ios/element/text.rb +26 -9
  47. data/lib/appium_lib/ios/element/textfield.rb +25 -7
  48. data/lib/appium_lib/ios/ios.rb +14 -0
  49. data/lib/appium_lib/ios/xcuitest.rb +14 -0
  50. data/lib/appium_lib/ios/xcuitest/bridge.rb +14 -0
  51. data/lib/appium_lib/ios/xcuitest/command.rb +14 -0
  52. data/lib/appium_lib/ios/xcuitest/command/certificate.rb +14 -0
  53. data/lib/appium_lib/ios/xcuitest/command/gestures.rb +14 -0
  54. data/lib/appium_lib/ios/xcuitest/command/get_context.rb +14 -0
  55. data/lib/appium_lib/ios/xcuitest/command/multi_app_handler.rb +14 -0
  56. data/lib/appium_lib/ios/xcuitest/command/pasteboard.rb +14 -0
  57. data/lib/appium_lib/ios/xcuitest/command/source.rb +14 -0
  58. data/lib/appium_lib/ios/xcuitest/element.rb +14 -0
  59. data/lib/appium_lib/ios/xcuitest/element/button.rb +22 -8
  60. data/lib/appium_lib/ios/xcuitest/element/generic.rb +14 -0
  61. data/lib/appium_lib/ios/xcuitest/element/text.rb +22 -8
  62. data/lib/appium_lib/ios/xcuitest/element/textfield.rb +18 -4
  63. data/lib/appium_lib/ios/xcuitest/helper.rb +14 -0
  64. data/lib/appium_lib/sauce_labs.rb +14 -0
  65. data/lib/appium_lib/version.rb +16 -2
  66. data/release_notes.md +7 -0
  67. metadata +4 -4
@@ -1,18 +1,35 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
1
15
  # XCUIElementTypeButton methods
2
16
  module Appium
3
17
  module Ios
4
- UIAButton = 'UIAButton'.freeze
5
- XCUIElementTypeButton = 'XCUIElementTypeButton'.freeze
18
+ UIA_BUTTON = 'UIAButton'
19
+ UIAButton = UIA_BUTTON
20
+
21
+ XCUIELEMENT_TYPE_BUTTON = 'XCUIElementTypeButton'
22
+ XCUIElementTypeButton = XCUIELEMENT_TYPE_BUTTON
6
23
 
7
24
  # @return [String] Class name for button
8
25
  def button_class
9
- UIAButton
26
+ UIA_BUTTON
10
27
  end
11
28
 
12
29
  # Find the first UIAButton|XCUIElementTypeButton that contains value or by index.
13
30
  # @param value [String, Integer] the value to exactly match.
14
31
  # If int then the UIAButton|XCUIElementTypeButton at that index is returned.
15
- # @return [UIAButton|XCUIElementTypeButton]
32
+ # @return [UIA_BUTTON|XCUIELEMENT_TYPE_BUTTON]
16
33
  def button(value)
17
34
  # return button at index.
18
35
  return ele_index button_class, value if value.is_a? Numeric
@@ -23,7 +40,7 @@ module Appium
23
40
  # Find all UIAButtons|XCUIElementTypeButtons containing value.
24
41
  # If value is omitted, all UIAButtons|XCUIElementTypeButtons are returned.
25
42
  # @param value [String] the value to search for
26
- # @return [Array<UIAButton|XCUIElementTypeButton>]
43
+ # @return [Array<UIA_BUTTON|XCUIELEMENT_TYPE_BUTTON>]
27
44
  def buttons(value = false)
28
45
  return tags button_class unless value
29
46
 
@@ -31,7 +48,7 @@ module Appium
31
48
  end
32
49
 
33
50
  # Find the first UIAButton|XCUIElementTypeButton.
34
- # @return [UIAButton|XCUIElementTypeButton]
51
+ # @return [UIA_BUTTON|XCUIELEMENT_TYPE_BUTTON]
35
52
  def first_button
36
53
  first_ele button_class
37
54
  end
@@ -39,21 +56,21 @@ module Appium
39
56
  # TODO: add documentation regarding previous element.
40
57
  # Previous UIAElement is differ from UIAButton|XCUIElementTypeButton. So, the results are different.
41
58
  # Find the last UIAButton|XCUIElementTypeButton.
42
- # @return [UIAButton|XCUIElementTypeButton]
59
+ # @return [UIA_BUTTON|XCUIELEMENT_TYPE_BUTTON]
43
60
  def last_button
44
61
  last_ele button_class
45
62
  end
46
63
 
47
64
  # Find the first UIAButton|XCUIElementTypeButton that exactly matches value.
48
65
  # @param value [String] the value to match exactly
49
- # @return [UIAButton|XCUIElementTypeButton]
66
+ # @return [UIA_BUTTON|XCUIELEMENT_TYPE_BUTTON]
50
67
  def button_exact(value)
51
68
  ele_by_json_visible_exact button_class, value
52
69
  end
53
70
 
54
71
  # Find all UIAButtons|XCUIElementTypeButtons that exactly match value.
55
72
  # @param value [String] the value to match exactly
56
- # @return [Array<UIAButton|XCUIElementTypeButton>]
73
+ # @return [Array<UIA_BUTTON|XCUIELEMENT_TYPE_BUTTON>]
57
74
  def buttons_exact(value)
58
75
  eles_by_json_visible_exact button_class, value
59
76
  end
@@ -1,3 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
1
15
  module Appium
2
16
  module Ios
3
17
  # Find the first element containing value
@@ -1,18 +1,35 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
1
15
  # UIAStaticText|XCUIElementTypeStaticText methods
2
16
  module Appium
3
17
  module Ios
4
- UIAStaticText = 'UIAStaticText'.freeze
5
- XCUIElementTypeStaticText = 'XCUIElementTypeStaticText'.freeze
18
+ UIA_STATIC_TEXT = 'UIAStaticText'
19
+ UIAStaticText = UIA_STATIC_TEXT
20
+
21
+ XCUIELEMENT_TYPE_STATIC_TEXT = 'XCUIElementTypeStaticText'
22
+ XCUIElementTypeStaticText = XCUIELEMENT_TYPE_STATIC_TEXT
6
23
 
7
24
  # @return [String] Class name for text
8
25
  def static_text_class
9
- UIAStaticText
26
+ UIA_STATIC_TEXT
10
27
  end
11
28
 
12
29
  # Find the first UIAStaticText|XCUIElementTypeStaticText that contains value or by index.
13
30
  # @param value [String, Integer] the value to find.
14
31
  # If int then the UIAStaticText|XCUIElementTypeStaticText at that index is returned.
15
- # @return [UIAStaticText|XCUIElementTypeStaticText]
32
+ # @return [UIA_STATIC_TEXT|XCUIELEMENT_TYPE_STATIC_TEXT]
16
33
  def text(value)
17
34
  return ele_index static_text_class, value if value.is_a? Numeric
18
35
 
@@ -22,7 +39,7 @@ module Appium
22
39
  # Find all UIAStaticTexts|XCUIElementTypeStaticTexts containing value.
23
40
  # If value is omitted, all UIAStaticTexts|XCUIElementTypeStaticTexts are returned
24
41
  # @param value [String] the value to search for
25
- # @return [Array<UIAStaticText|XCUIElementTypeStaticText>]
42
+ # @return [Array<UIA_STATIC_TEXT|XCUIELEMENT_TYPE_STATIC_TEXT>]
26
43
  def texts(value = false)
27
44
  return tags static_text_class unless value
28
45
 
@@ -30,27 +47,27 @@ module Appium
30
47
  end
31
48
 
32
49
  # Find the first UIAStaticText|XCUIElementTypeStaticText.
33
- # @return [UIAStaticText|XCUIElementTypeStaticText]
50
+ # @return [UIA_STATIC_TEXT|XCUIELEMENT_TYPE_STATIC_TEXT]
34
51
  def first_text
35
52
  first_ele static_text_class
36
53
  end
37
54
 
38
55
  # Find the last UIAStaticText|XCUIElementTypeStaticText.
39
- # @return [UIAStaticText|XCUIElementTypeStaticText]
56
+ # @return [UIA_STATIC_TEXT|XCUIELEMENT_TYPE_STATIC_TEXT]
40
57
  def last_text
41
58
  last_ele static_text_class
42
59
  end
43
60
 
44
61
  # Find the first UIAStaticText|XCUIElementTypeStaticText that exactly matches value.
45
62
  # @param value [String] the value to match exactly
46
- # @return [UIAStaticText|XCUIElementTypeStaticText]
63
+ # @return [UIA_STATIC_TEXT|XCUIElementTypeStaticText]
47
64
  def text_exact(value)
48
65
  ele_by_json_visible_exact static_text_class, value
49
66
  end
50
67
 
51
68
  # Find all UIAStaticTexts|XCUIElementTypeStaticTexts that exactly match value.
52
69
  # @param value [String] the value to match exactly
53
- # @return [Array<UIAStaticText|XCUIElementTypeStaticText>]
70
+ # @return [Array<UIA_STATIC_TEXT|XCUIElementTypeStaticText>]
54
71
  def texts_exact(value)
55
72
  eles_by_json_visible_exact static_text_class, value
56
73
  end
@@ -1,19 +1,37 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
1
15
  module Appium
2
16
  module Ios
3
- UIATextField = 'UIATextField'.freeze
4
- UIASecureTextField = 'UIASecureTextField'.freeze
17
+ UIA_TEXT_FIELD = 'UIATextField'
18
+ UIATextField = UIA_TEXT_FIELD
19
+ UIA_SECURE_TEXT_FIELD = 'UIASecureTextField'
20
+ UIASecureTextField = UIA_SECURE_TEXT_FIELD
5
21
 
6
- XCUIElementTypeTextField = 'XCUIElementTypeTextField'.freeze
7
- XCUIElementTypeSecureTextField = 'XCUIElementTypeSecureTextField'.freeze
22
+ XCUIELEMENT_TYPE_TEXT_FIELD = 'XCUIElementTypeTextField'
23
+ XCUIElementTypeTextField = XCUIELEMENT_TYPE_TEXT_FIELD
24
+ XCUIELEMENT_TYPE_SECURE_TEXT_FIELD = 'XCUIElementTypeSecureTextField'
25
+ XCUIElementTypeSecureTextField = XCUIELEMENT_TYPE_SECURE_TEXT_FIELD
8
26
 
9
27
  # @return [String] Class name for text field
10
28
  def text_field_class
11
- UIATextField
29
+ UIA_TEXT_FIELD
12
30
  end
13
31
 
14
32
  # @return [String] Class name for secure text field
15
33
  def secure_text_field_class
16
- UIASecureTextField
34
+ UIA_SECURE_TEXT_FIELD
17
35
  end
18
36
 
19
37
  # Find the first TextField that contains value or by index.
@@ -79,7 +97,7 @@ module Appium
79
97
 
80
98
  # Appium
81
99
  def _textfield_visible
82
- { typeArray: [UIATextField, UIASecureTextField], onlyVisible: true }
100
+ { typeArray: [UIA_TEXT_FIELD, UIA_SECURE_TEXT_FIELD], onlyVisible: true }
83
101
  end
84
102
 
85
103
  # Appium
@@ -1,3 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
1
15
  require_relative 'common/helper'
2
16
  require_relative 'common/errors'
3
17
 
@@ -1,3 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
1
15
  require_relative 'xcuitest/element'
2
16
  require_relative 'xcuitest/command'
3
17
  require_relative 'xcuitest/helper'
@@ -1,3 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
1
15
  require_relative '../ios'
2
16
 
3
17
  module Appium
@@ -1,3 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
1
15
  require_relative 'command/pasteboard'
2
16
  require_relative 'command/gestures'
3
17
  require_relative 'command/source'
@@ -1,3 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
1
15
  require 'base64'
2
16
 
3
17
  module Appium
@@ -1,3 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
1
15
  module Appium
2
16
  module Ios
3
17
  module Xcuitest
@@ -1,3 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
1
15
  module Appium
2
16
  module Ios
3
17
  module Xcuitest
@@ -1,3 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
1
15
  module Appium
2
16
  module Ios
3
17
  module Xcuitest
@@ -1,3 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
1
15
  module Appium
2
16
  module Ios
3
17
  module Xcuitest
@@ -1,3 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
1
15
  module Appium
2
16
  module Ios
3
17
  module Xcuitest
@@ -1,3 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
1
15
  require_relative 'element/text'
2
16
  require_relative 'element/textfield'
3
17
  require_relative 'element/generic'
@@ -1,19 +1,33 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
1
15
  # XCUIElementTypeButton methods
2
16
  module Appium
3
17
  module Ios
4
18
  module Xcuitest
5
19
  module Element
6
- # XCUIElementTypeButton = 'XCUIElementTypeButton'.freeze
20
+ # XCUIElementTypeButton = 'XCUIElementTypeButton'
7
21
 
8
22
  # @return [String] Class name for button
9
23
  def button_class
10
- ::Appium::Ios::XCUIElementTypeButton
24
+ ::Appium::Ios::XCUIELEMENT_TYPE_BUTTON
11
25
  end
12
26
 
13
27
  # Find the first UIAButton|XCUIElementTypeButton that contains value or by index.
14
28
  # @param value [String, Integer] the value to exactly match.
15
29
  # If int then the UIAButton|XCUIElementTypeButton at that index is returned.
16
- # @return [UIAButton|XCUIElementTypeButton]
30
+ # @return [UIA_BUTTON|XCUIELEMENT_TYPE_BUTTON]
17
31
  def button(value)
18
32
  # return button at index.
19
33
  return ele_index button_class, value if value.is_a? Numeric
@@ -24,7 +38,7 @@ module Appium
24
38
  # Find all UIAButtons|XCUIElementTypeButtons containing value.
25
39
  # If value is omitted, all UIAButtons|XCUIElementTypeButtons are returned.
26
40
  # @param value [String] the value to search for
27
- # @return [Array<UIAButton|XCUIElementTypeButton>]
41
+ # @return [Array<UIA_BUTTON|XCUIELEMENT_TYPE_BUTTON>]
28
42
  def buttons(value = false)
29
43
  return tags button_class unless value
30
44
 
@@ -33,7 +47,7 @@ module Appium
33
47
  end
34
48
 
35
49
  # Find the first UIAButton|XCUIElementTypeButton.
36
- # @return [UIAButton|XCUIElementTypeButton]
50
+ # @return [UIA_BUTTON|XCUIELEMENT_TYPE_BUTTON]
37
51
  def first_button
38
52
  first_ele button_class
39
53
  end
@@ -41,21 +55,21 @@ module Appium
41
55
  # TODO: add documentation regarding previous element.
42
56
  # Previous UIAElement is differ from UIAButton|XCUIElementTypeButton. So, the results are different.
43
57
  # Find the last UIAButton|XCUIElementTypeButton.
44
- # @return [UIAButton|XCUIElementTypeButton]
58
+ # @return [UIA_BUTTON|XCUIELEMENT_TYPE_BUTTON]
45
59
  def last_button
46
60
  last_ele button_class
47
61
  end
48
62
 
49
63
  # Find the first UIAButton|XCUIElementTypeButton that exactly matches value.
50
64
  # @param value [String] the value to match exactly
51
- # @return [UIAButton|XCUIElementTypeButton]
65
+ # @return [UIA_BUTTON|XCUIELEMENT_TYPE_BUTTON]
52
66
  def button_exact(value)
53
67
  raise_error_if_no_element buttons_exact(value).first
54
68
  end
55
69
 
56
70
  # Find all UIAButtons|XCUIElementTypeButtons that exactly match value.
57
71
  # @param value [String] the value to match exactly
58
- # @return [Array<UIAButton|XCUIElementTypeButton>]
72
+ # @return [Array<UIA_BUTTON|XCUIELEMENT_TYPE_BUTTON>]
59
73
  def buttons_exact(value)
60
74
  elements = find_eles_by_predicate(class_name: button_class, value: value)
61
75
  select_visible_elements elements