appium_lib 9.6.1 → 9.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +2 -2
- data/CHANGELOG.md +43 -0
- data/Rakefile +1 -1
- data/appium_lib.gemspec +1 -1
- data/docs/android_docs.md +440 -1295
- data/docs/docs.md +10 -103
- data/docs/index_paths.md +2 -0
- data/docs/ios_docs.md +725 -1674
- data/docs/migration.md +17 -0
- data/lib/appium_lib.rb +1 -2
- data/lib/appium_lib/android/android.rb +20 -0
- data/lib/appium_lib/android/{helper.rb → common/helper.rb} +1 -1
- data/lib/appium_lib/android/uiautomator2.rb +5 -4
- data/lib/appium_lib/android/uiautomator2/bridge.rb +16 -0
- data/lib/appium_lib/appium.rb +201 -0
- data/lib/appium_lib/common/helper.rb +18 -20
- data/lib/appium_lib/common/log.rb +24 -0
- data/lib/appium_lib/common/multi_touch.rb +89 -0
- data/lib/appium_lib/common/touch_actions.rb +48 -0
- data/lib/appium_lib/common/wait.rb +10 -49
- data/lib/appium_lib/core/android.rb +4 -0
- data/lib/appium_lib/core/android/device.rb +142 -0
- data/lib/appium_lib/core/android/search_context.rb +17 -0
- data/lib/appium_lib/core/android/uiautomator1/bridge.rb +16 -0
- data/lib/appium_lib/core/android/uiautomator2/bridge.rb +16 -0
- data/lib/appium_lib/core/android_uiautomator2.rb +4 -0
- data/lib/appium_lib/core/common.rb +6 -0
- data/lib/appium_lib/core/common/base.rb +8 -0
- data/lib/appium_lib/core/common/base/bridge.rb +47 -0
- data/lib/appium_lib/core/common/base/capabilities.rb +16 -0
- data/lib/appium_lib/core/common/base/command.rb +10 -0
- data/lib/appium_lib/core/common/base/driver.rb +40 -0
- data/lib/appium_lib/core/common/base/http_default.rb +12 -0
- data/lib/appium_lib/core/common/base/search_context.rb +89 -0
- data/lib/appium_lib/core/common/base/wait.rb +56 -0
- data/lib/appium_lib/{common → core/common}/command.rb +20 -16
- data/lib/appium_lib/core/common/device.rb +470 -0
- data/lib/appium_lib/core/common/error.rb +13 -0
- data/lib/appium_lib/core/common/log.rb +30 -0
- data/lib/appium_lib/{logger.rb → core/common/logger.rb} +2 -0
- data/lib/appium_lib/core/core.rb +38 -0
- data/lib/appium_lib/core/device/multi_touch.rb +213 -0
- data/lib/appium_lib/core/device/touch_actions.rb +206 -0
- data/lib/appium_lib/core/driver.rb +274 -0
- data/lib/appium_lib/core/ios.rb +6 -0
- data/lib/appium_lib/core/ios/device.rb +44 -0
- data/lib/appium_lib/core/ios/search_context.rb +27 -0
- data/lib/appium_lib/core/ios/uiautomation/bridge.rb +17 -0
- data/lib/appium_lib/core/ios/uiautomation/patch.rb +20 -0
- data/lib/appium_lib/core/ios/xcuitest/bridge.rb +18 -0
- data/lib/appium_lib/{ios → core/ios}/xcuitest/device.rb +5 -5
- data/lib/appium_lib/{ios → core/ios}/xcuitest/search_context.rb +13 -9
- data/lib/appium_lib/core/ios_xcuitest.rb +7 -0
- data/lib/appium_lib/core/patch.rb +56 -0
- data/lib/appium_lib/driver.rb +174 -446
- data/lib/appium_lib/ios/{errors.rb → common/errors.rb} +0 -0
- data/lib/appium_lib/ios/{helper.rb → common/helper.rb} +9 -110
- data/lib/appium_lib/ios/ios.rb +20 -0
- data/lib/appium_lib/ios/xcuitest.rb +1 -3
- data/lib/appium_lib/ios/xcuitest/bridge.rb +19 -0
- data/lib/appium_lib/ios/xcuitest/command.rb +4 -1
- data/lib/appium_lib/ios/xcuitest/{gestures.rb → command/gestures.rb} +1 -1
- data/lib/appium_lib/ios/xcuitest/element.rb +1 -18
- data/lib/appium_lib/ios/xcuitest/helper.rb +0 -6
- data/lib/appium_lib/sauce_labs.rb +29 -0
- data/lib/appium_lib/version.rb +5 -0
- data/release_notes.md +8 -0
- metadata +50 -25
- data/lib/appium_lib/android/client_xpath.rb +0 -51
- data/lib/appium_lib/android/device.rb +0 -39
- data/lib/appium_lib/android/mobile_methods.rb +0 -15
- data/lib/appium_lib/android/patch.rb +0 -16
- data/lib/appium_lib/capabilities.rb +0 -13
- data/lib/appium_lib/common/element/window.rb +0 -10
- data/lib/appium_lib/common/error.rb +0 -8
- data/lib/appium_lib/common/patch.rb +0 -190
- data/lib/appium_lib/common/search_context.rb +0 -10
- data/lib/appium_lib/common/version.rb +0 -5
- data/lib/appium_lib/device/device.rb +0 -611
- data/lib/appium_lib/device/multi_touch.rb +0 -225
- data/lib/appium_lib/device/touch_actions.rb +0 -230
- data/lib/appium_lib/ios/mobile_methods.rb +0 -25
- data/lib/appium_lib/ios/patch.rb +0 -22
data/docs/docs.md
CHANGED
@@ -10,15 +10,8 @@
|
|
10
10
|
- [All methods supported by Appium](https://github.com/appium/appium-base-driver/blob/master/docs/mjsonwp/protocol-methods.md)
|
11
11
|
- [MiniTest Expectations](http://docs.seattlerb.org/minitest/Minitest/Expectations.html)
|
12
12
|
|
13
|
-
|
14
|
-
- [
|
15
|
-
`
|
16
|
-
- [mechanic names of elements](https://github.com/jaykz52/mechanic/blob/8c490e1d225f384847e47ffdafb47cc2248bb96c/src/mechanic-core.js#L28)
|
17
|
-
- [WebDriverAgent](https://github.com/facebook/WebDriverAgent)
|
18
|
-
|
19
|
-
##### Android
|
20
|
-
- [Android UIAutomator](http://developer.android.com/tools/help/uiautomator/index.html)
|
21
|
-
- [UiSelector.java](https://android.googlesource.com/platform/frameworks/testing/+/master/uiautomator/library/core-src/com/android/uiautomator/core/UiSelector.java)
|
13
|
+
#### Drivers
|
14
|
+
- [platform-support](https://github.com/appium/appium/blob/master/docs/en/about-appium/platform-support.md)
|
22
15
|
|
23
16
|
--
|
24
17
|
|
@@ -26,7 +19,7 @@ Driver types.
|
|
26
19
|
|
27
20
|
```ruby
|
28
21
|
# appium specific driver with helpers available
|
29
|
-
@appium_driver = Appium::Driver.new @options
|
22
|
+
@appium_driver = Appium::Driver.new @options, false
|
30
23
|
# standard selenium driver without any appium methods
|
31
24
|
@selenium_driver = @appium_driver.start_driver
|
32
25
|
```
|
@@ -44,36 +37,35 @@ apk = {
|
|
44
37
|
appActivity: '.Settings',
|
45
38
|
appWaitActivity: '.Settings'
|
46
39
|
}
|
47
|
-
Appium::Driver.new(caps: apk).start_driver
|
40
|
+
Appium::Driver.new({caps: apk}, false).start_driver
|
48
41
|
```
|
49
42
|
|
50
43
|
--
|
51
44
|
|
52
45
|
Example use of Appium's mobile gesture.
|
53
46
|
|
54
|
-
> @driver.
|
47
|
+
> @driver.find_element()
|
55
48
|
|
56
49
|
`console.rb` uses some code from [simple_test.rb](
|
57
|
-
https://github.com/appium/
|
58
|
-
|
50
|
+
https://github.com/appium/sample-code/blob/master/sample-code/examples/ruby/simple_test.rb) and is released under the [same license](https://github.com/appium/appium/blob/c58eeb66f2d6fa3b9a89d188a2e657cca7cb300f/LICENSE) as Appium.
|
51
|
+
The Accessibility Inspector is helpful for discovering button names and textfield values.
|
59
52
|
|
60
53
|
Long click on an ImageView in Android.
|
61
54
|
|
62
55
|
```
|
63
|
-
last_image = find_elements(:
|
56
|
+
last_image = find_elements(:class, 'ImageView').last
|
64
57
|
long_press(element: last_image)
|
65
58
|
```
|
66
59
|
|
67
|
-
Rotate examples.
|
60
|
+
Rotate examples. The behaviour is depends on devices.
|
68
61
|
|
69
62
|
```ruby
|
70
63
|
driver.rotate :landscape
|
71
64
|
driver.rotate :portrait
|
72
65
|
```
|
73
66
|
|
74
|
-
|
75
67
|
- `status["value"]["build"]["revision"]` Discover the Appium rev running on the server.
|
76
|
-
- `
|
68
|
+
- `element.send_keys "msg"` Sends keys to currently active element
|
77
69
|
|
78
70
|
#### generic
|
79
71
|
|
@@ -188,50 +180,6 @@ s.value == ios_password('hello'.length)
|
|
188
180
|
.click to tap an element.
|
189
181
|
.send_keys to type on an element.
|
190
182
|
|
191
|
-
#### Raw UIAutomation
|
192
|
-
|
193
|
-
`execute_script "au.lookup('button')[0].tap()"` is the same as
|
194
|
-
`execute_script 'UIATarget.localTarget().frontMostApp().buttons()[0].tap()'`
|
195
|
-
|
196
|
-
See [app.js](https://github.com/appium/appium/blob/master/app/uiauto/appium/app.js#L3) for more au methods.
|
197
|
-
Note that raw UIAutomation commands are not officially supported.
|
198
|
-
|
199
|
-
Advanced au.
|
200
|
-
|
201
|
-
In this example we lookup two tags, combine the results, wrap with $, and then return the elements.
|
202
|
-
|
203
|
-
```ruby
|
204
|
-
s = %(
|
205
|
-
var t = au.lookup('textfield');
|
206
|
-
var s = au.lookup('secure');
|
207
|
-
var r = $(t.concat(s));
|
208
|
-
au._returnElems(r);
|
209
|
-
)
|
210
|
-
|
211
|
-
execute_script s
|
212
|
-
```
|
213
|
-
|
214
|
-
#### XPath(UIAutomation)
|
215
|
-
|
216
|
-
See [#194](https://github.com/appium/appium/pull/194/files) for details.
|
217
|
-
|
218
|
-
```ruby
|
219
|
-
find_element :xpath, 'button'
|
220
|
-
find_elements :xpath, 'button'
|
221
|
-
|
222
|
-
find_element :xpath, 'button[@name="Sign In"]'
|
223
|
-
find_elements :xpath, 'button[@name="Sign In"]'
|
224
|
-
|
225
|
-
find_element :xpath, 'button[contains(@name, "Sign In")]'
|
226
|
-
find_elements :xpath, 'button[contains(@name, "Sign")]'
|
227
|
-
|
228
|
-
find_element :xpath, 'textfield[@value="Email"]'
|
229
|
-
find_element :xpath, 'textfield[contains(@value, "Email")]'
|
230
|
-
|
231
|
-
find_element :xpath, 'text[contains(@name, "Reset")]'
|
232
|
-
find_elements :xpath, 'text[contains(@name, "agree")]'
|
233
|
-
```
|
234
|
-
|
235
183
|
#### Cucumber Sauce Integration
|
236
184
|
|
237
185
|
Reset after each test and when done report the result to Sauce after quiting the driver.
|
@@ -254,39 +202,6 @@ After do |scenario|
|
|
254
202
|
end
|
255
203
|
```
|
256
204
|
|
257
|
-
#### Set iOS version
|
258
|
-
|
259
|
-
```bash
|
260
|
-
# git clone
|
261
|
-
export V=`git rev-parse --verify HEAD`
|
262
|
-
|
263
|
-
# Delete all old DerivedData
|
264
|
-
rm -rf "/Users/`whoami`/Library/Developer/Xcode/DerivedData/ProjectName*"
|
265
|
-
# xcode build
|
266
|
-
cd "/Users/`whoami`/Library/Developer/Xcode/DerivedData/ProjectName*/Build/Products/Debug-iphonesimulator/ProjectName.app"
|
267
|
-
|
268
|
-
# set version
|
269
|
-
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion $V" Info.plist
|
270
|
-
/usr/libexec/PlistBuddy -c "Set :CFBundleShortVersionString $V" Info.plist
|
271
|
-
/usr/bin/plutil -convert binary1 Info.plist
|
272
|
-
|
273
|
-
# zip app
|
274
|
-
cd ..
|
275
|
-
zip -r -X "$WORKSPACE/ProjectName.zip" ProjectName.app
|
276
|
-
```
|
277
|
-
|
278
|
-
#### Set Android version
|
279
|
-
|
280
|
-
```ruby
|
281
|
-
# Save as set_version.rb and pass version as first arg.
|
282
|
-
# android:versionCode must be an int
|
283
|
-
Dir.glob('./**/AndroidManifest.xml') do |xml|
|
284
|
-
data = File.read xml
|
285
|
-
data.scan(/android:versionName="[^"]*"/).each { |m| data.gsub!(m, m.sub(/"[^"]*"/, '"' + ARGV.first + '"')) }
|
286
|
-
File.open(xml, 'w') { |f| f.write data }
|
287
|
-
end
|
288
|
-
```
|
289
|
-
|
290
205
|
#### Android notes
|
291
206
|
|
292
207
|
list all ids on API 18
|
@@ -295,14 +210,6 @@ list all ids on API 18
|
|
295
210
|
|
296
211
|
#### iOS notes
|
297
212
|
|
298
|
-
mobile gestures on iOS are known to be crashy. Fix by adding pre/post event sleep.
|
299
|
-
|
300
|
-
```ruby
|
301
|
-
sleep 3
|
302
|
-
tap(x: 10, y: 100)
|
303
|
-
sleep 1
|
304
|
-
```
|
305
|
-
|
306
213
|
Accept an alert if it exists.
|
307
214
|
|
308
215
|
```ruby
|
data/docs/index_paths.md
CHANGED
data/docs/ios_docs.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
|
-
##### [load_settings](https://github.com/appium/ruby_lib/blob/
|
1
|
+
##### [load_settings](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/appium.rb#L44)
|
2
2
|
|
3
|
-
> def
|
3
|
+
> def load_settings(opts = {})
|
4
4
|
|
5
5
|
Load arbitrary text ([toml format](https://github.com/toml-lang/toml))
|
6
6
|
The toml is parsed by https://github.com/fbernier/tomlrb .
|
@@ -27,9 +27,9 @@ __Returns:__
|
|
27
27
|
|
28
28
|
--
|
29
29
|
|
30
|
-
##### [load_appium_txt](https://github.com/appium/ruby_lib/blob/
|
30
|
+
##### [load_appium_txt](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/appium.rb#L77)
|
31
31
|
|
32
|
-
> def
|
32
|
+
> def load_settings(opts = {})
|
33
33
|
|
34
34
|
Load arbitrary text ([toml format](https://github.com/toml-lang/toml))
|
35
35
|
The toml is parsed by https://github.com/fbernier/tomlrb .
|
@@ -45,7 +45,6 @@ port = 8080
|
|
45
45
|
:app is expanded
|
46
46
|
:require is expanded
|
47
47
|
all keys are converted to symbols
|
48
|
-
rubocop:disable Style/Alias
|
49
48
|
|
50
49
|
__Parameters:__
|
51
50
|
|
@@ -57,9 +56,9 @@ __Returns:__
|
|
57
56
|
|
58
57
|
--
|
59
58
|
|
60
|
-
##### [expand_required_files](https://github.com/appium/ruby_lib/blob/
|
59
|
+
##### [expand_required_files](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/appium.rb#L82)
|
61
60
|
|
62
|
-
> def
|
61
|
+
> def expand_required_files(base_dir, file_paths)
|
63
62
|
|
64
63
|
|
65
64
|
|
@@ -75,20 +74,9 @@ __Returns:__
|
|
75
74
|
|
76
75
|
--
|
77
76
|
|
78
|
-
##### [
|
77
|
+
##### [promote_singleton_appium_methods](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/appium.rb#L121)
|
79
78
|
|
80
|
-
> def
|
81
|
-
|
82
|
-
convert all keys (including nested) to symbols
|
83
|
-
|
84
|
-
based on deep_symbolize_keys & deep_transform_keys from rails
|
85
|
-
https://github.com/rails/docrails/blob/a3b1105ada3da64acfa3843b164b14b734456a50/activesupport/lib/active_support/core_ext/hash/keys.rb#L84
|
86
|
-
|
87
|
-
--
|
88
|
-
|
89
|
-
##### [promote_singleton_appium_methods](https://github.com/appium/ruby_lib/blob/95118d4e0a6ec285e55862ea6b6fed528711ad84/lib/appium_lib/driver.rb#L180)
|
90
|
-
|
91
|
-
> def self.promote_singleton_appium_methods(modules, driver = $driver)
|
79
|
+
> def promote_singleton_appium_methods(modules, driver = $driver)
|
92
80
|
|
93
81
|
This method is intended to work with page objects that share
|
94
82
|
a common module. For example, Page::HomePage, Page::SignIn
|
@@ -104,9 +92,9 @@ otherwise, the array of modules will be used as the promotion target.
|
|
104
92
|
|
105
93
|
--
|
106
94
|
|
107
|
-
##### [promote_appium_methods](https://github.com/appium/ruby_lib/blob/
|
95
|
+
##### [promote_appium_methods](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/appium.rb#L174)
|
108
96
|
|
109
|
-
> def
|
97
|
+
> def promote_appium_methods(class_array, driver = $driver)
|
110
98
|
|
111
99
|
Promote appium methods to class instance methods
|
112
100
|
|
@@ -134,19 +122,7 @@ __Parameters:__
|
|
134
122
|
|
135
123
|
--
|
136
124
|
|
137
|
-
##### [
|
138
|
-
|
139
|
-
> def self.selenium_webdriver_version_more?(version)
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
__Returns:__
|
144
|
-
|
145
|
-
[Boolean]
|
146
|
-
|
147
|
-
--
|
148
|
-
|
149
|
-
##### [global_webdriver_http_sleep](https://github.com/appium/ruby_lib/blob/95118d4e0a6ec285e55862ea6b6fed528711ad84/lib/appium_lib/driver.rb#L272)
|
125
|
+
##### [global_webdriver_http_sleep](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/driver.rb#L24)
|
150
126
|
|
151
127
|
> def global_webdriver_http_sleep
|
152
128
|
|
@@ -154,7 +130,7 @@ The amount to sleep in seconds before every webdriver http call.
|
|
154
130
|
|
155
131
|
--
|
156
132
|
|
157
|
-
##### [global_webdriver_http_sleep=](https://github.com/appium/ruby_lib/blob/
|
133
|
+
##### [global_webdriver_http_sleep=](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/driver.rb#L24)
|
158
134
|
|
159
135
|
> def global_webdriver_http_sleep=(value)
|
160
136
|
|
@@ -162,170 +138,166 @@ The amount to sleep in seconds before every webdriver http call.
|
|
162
138
|
|
163
139
|
--
|
164
140
|
|
165
|
-
##### [
|
141
|
+
##### [sauce](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/driver.rb#L27)
|
166
142
|
|
167
|
-
> def
|
143
|
+
> def sauce
|
168
144
|
|
169
|
-
|
145
|
+
SauceLab's settings
|
170
146
|
|
171
147
|
--
|
172
148
|
|
173
|
-
##### [
|
149
|
+
##### [sauce_username](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/driver.rb#L30)
|
174
150
|
|
175
|
-
> def
|
151
|
+
> def sauce_username
|
176
152
|
|
177
|
-
|
153
|
+
Username for use on Sauce Labs. Set `false` to disable Sauce, even when SAUCE_USERNAME is in ENV.
|
154
|
+
same as @sauce.username
|
178
155
|
|
179
156
|
--
|
180
157
|
|
181
|
-
##### [
|
158
|
+
##### [sauce_access_key](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/driver.rb#L33)
|
182
159
|
|
183
|
-
> def
|
160
|
+
> def sauce_access_key
|
184
161
|
|
185
|
-
|
162
|
+
Access Key for use on Sauce Labs. Set `false` to disable Sauce, even when SAUCE_ACCESS_KEY is in ENV.
|
163
|
+
same as @sauce.access_key
|
186
164
|
|
187
165
|
--
|
188
166
|
|
189
|
-
##### [
|
167
|
+
##### [sauce_endpoint](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/driver.rb#L36)
|
190
168
|
|
191
|
-
> def
|
169
|
+
> def sauce_endpoint
|
192
170
|
|
193
|
-
|
194
|
-
|
195
|
-
This value is independent of what the server is using
|
171
|
+
Override the Sauce Appium endpoint to allow e.g. TestObject tests
|
172
|
+
same as @sauce.endpoint
|
196
173
|
|
197
|
-
|
174
|
+
--
|
198
175
|
|
199
|
-
|
176
|
+
##### [caps](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/driver.rb#L39)
|
177
|
+
|
178
|
+
> def caps
|
179
|
+
|
180
|
+
from Core
|
200
181
|
|
201
182
|
--
|
202
183
|
|
203
|
-
##### [
|
184
|
+
##### [custom_url](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/driver.rb#L40)
|
204
185
|
|
205
|
-
> def
|
186
|
+
> def custom_url
|
206
187
|
|
207
|
-
|
188
|
+
Returns the value of attribute custom_url
|
208
189
|
|
209
190
|
--
|
210
191
|
|
211
|
-
##### [
|
192
|
+
##### [export_session](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/driver.rb#L41)
|
212
193
|
|
213
|
-
> def
|
194
|
+
> def export_session
|
214
195
|
|
215
|
-
|
196
|
+
Returns the value of attribute export_session
|
216
197
|
|
217
198
|
--
|
218
199
|
|
219
|
-
##### [
|
200
|
+
##### [default_wait](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/driver.rb#L42)
|
220
201
|
|
221
|
-
> def
|
202
|
+
> def default_wait
|
222
203
|
|
223
|
-
|
204
|
+
Returns the value of attribute default_wait
|
224
205
|
|
225
206
|
--
|
226
207
|
|
227
|
-
##### [appium_port](https://github.com/appium/ruby_lib/blob/
|
208
|
+
##### [appium_port](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/driver.rb#L43)
|
228
209
|
|
229
210
|
> def appium_port
|
230
211
|
|
231
|
-
|
212
|
+
Returns the value of attribute appium_port
|
232
213
|
|
233
214
|
--
|
234
215
|
|
235
|
-
##### [appium_device](https://github.com/appium/ruby_lib/blob/
|
216
|
+
##### [appium_device](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/driver.rb#L44)
|
236
217
|
|
237
218
|
> def appium_device
|
238
219
|
|
239
|
-
|
220
|
+
Returns the value of attribute appium_device
|
240
221
|
|
241
222
|
--
|
242
223
|
|
243
|
-
##### [automation_name](https://github.com/appium/ruby_lib/blob/
|
224
|
+
##### [automation_name](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/driver.rb#L45)
|
244
225
|
|
245
226
|
> def automation_name
|
246
227
|
|
247
|
-
|
248
|
-
If automation_name is nil, it is not set both client side and server side.
|
228
|
+
Returns the value of attribute automation_name
|
249
229
|
|
250
230
|
--
|
251
231
|
|
252
|
-
##### [
|
232
|
+
##### [listener](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/driver.rb#L46)
|
253
233
|
|
254
|
-
> def
|
234
|
+
> def listener
|
255
235
|
|
256
|
-
|
236
|
+
Returns the value of attribute listener
|
257
237
|
|
258
238
|
--
|
259
239
|
|
260
|
-
##### [
|
240
|
+
##### [http_client](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/driver.rb#L47)
|
261
241
|
|
262
|
-
> def
|
242
|
+
> def http_client
|
263
243
|
|
264
|
-
|
244
|
+
Returns the value of attribute http_client
|
265
245
|
|
266
246
|
--
|
267
247
|
|
268
|
-
##### [
|
248
|
+
##### [appium_wait_timeout](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/driver.rb#L48)
|
269
249
|
|
270
|
-
> def
|
250
|
+
> def appium_wait_timeout
|
271
251
|
|
272
|
-
|
252
|
+
Returns the value of attribute appium_wait_timeout
|
273
253
|
|
274
254
|
--
|
275
255
|
|
276
|
-
##### [
|
256
|
+
##### [appium_wait_interval](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/driver.rb#L49)
|
277
257
|
|
278
|
-
> def
|
258
|
+
> def appium_wait_interval
|
279
259
|
|
280
|
-
Returns the
|
260
|
+
Returns the value of attribute appium_wait_interval
|
281
261
|
|
282
|
-
|
262
|
+
--
|
283
263
|
|
284
|
-
|
264
|
+
##### [appium_server_status](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/driver.rb#L52)
|
285
265
|
|
286
|
-
|
266
|
+
> def appium_server_status
|
287
267
|
|
288
|
-
|
268
|
+
Appium's server version
|
289
269
|
|
290
|
-
|
270
|
+
--
|
291
271
|
|
292
|
-
|
272
|
+
##### [appium_debug](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/driver.rb#L54)
|
293
273
|
|
294
|
-
|
274
|
+
> def appium_debug
|
295
275
|
|
296
|
-
|
276
|
+
Boolean debug mode for the Appium Ruby bindings
|
297
277
|
|
298
278
|
--
|
299
279
|
|
300
|
-
##### [
|
280
|
+
##### [driver](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/driver.rb#L57)
|
301
281
|
|
302
|
-
> def
|
282
|
+
> def driver
|
303
283
|
|
304
|
-
|
305
|
-
Wait time for ::Appium::Common.wait or ::Appium::Common.wait_true.
|
306
|
-
Provide Appium::Drive like { appium_lib: { wait_timeout: 20 } }
|
284
|
+
Returns the driver
|
307
285
|
|
308
286
|
__Returns:__
|
309
287
|
|
310
|
-
[
|
288
|
+
[Driver] the driver
|
311
289
|
|
312
290
|
--
|
313
291
|
|
314
|
-
##### [
|
315
|
-
|
316
|
-
> def appium_wait_interval
|
317
|
-
|
318
|
-
Return a time wait timeout
|
319
|
-
Wait interval time for ::Appium::Common.wait or ::Appium::Common.wait_true.
|
320
|
-
Provide Appium::Drive like { appium_lib: { wait_interval: 20 } }
|
292
|
+
##### [core](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/driver.rb#L59)
|
321
293
|
|
322
|
-
|
294
|
+
> def core
|
323
295
|
|
324
|
-
|
296
|
+
Instance of Appium::Core::Driver
|
325
297
|
|
326
298
|
--
|
327
299
|
|
328
|
-
##### [initialize](https://github.com/appium/ruby_lib/blob/
|
300
|
+
##### [initialize](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/driver.rb#L113)
|
329
301
|
|
330
302
|
> def initialize(opts = {}, global_driver = nil)
|
331
303
|
|
@@ -344,25 +316,29 @@ __Returns:__
|
|
344
316
|
|
345
317
|
--
|
346
318
|
|
347
|
-
##### [
|
348
|
-
|
349
|
-
> def set_appium_lib_specific_values(appium_lib_opts)
|
319
|
+
##### [driver_attributes](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/driver.rb#L218)
|
350
320
|
|
321
|
+
> def driver_attributes
|
351
322
|
|
323
|
+
Returns a hash of the driver attributes
|
352
324
|
|
353
325
|
--
|
354
326
|
|
355
|
-
##### [
|
327
|
+
##### [device_is_android?](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/driver.rb#L237)
|
356
328
|
|
357
|
-
> def
|
329
|
+
> def device_is_android?
|
358
330
|
|
359
|
-
|
331
|
+
|
332
|
+
|
333
|
+
__Returns:__
|
334
|
+
|
335
|
+
[Boolean]
|
360
336
|
|
361
337
|
--
|
362
338
|
|
363
|
-
##### [
|
339
|
+
##### [device_is_ios?](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/driver.rb#L241)
|
364
340
|
|
365
|
-
> def
|
341
|
+
> def device_is_ios?
|
366
342
|
|
367
343
|
|
368
344
|
|
@@ -372,11 +348,11 @@ __Returns:__
|
|
372
348
|
|
373
349
|
--
|
374
350
|
|
375
|
-
##### [
|
351
|
+
##### [device_is_windows?](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/driver.rb#L245)
|
352
|
+
|
353
|
+
> def device_is_windows?
|
376
354
|
|
377
|
-
> def automation_name_is_xcuitest?
|
378
355
|
|
379
|
-
Return true if automationName is 'XCUITest'
|
380
356
|
|
381
357
|
__Returns:__
|
382
358
|
|
@@ -384,7 +360,7 @@ __Returns:__
|
|
384
360
|
|
385
361
|
--
|
386
362
|
|
387
|
-
##### [automation_name_is_uiautomator2?](https://github.com/appium/ruby_lib/blob/
|
363
|
+
##### [automation_name_is_uiautomator2?](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/driver.rb#L251)
|
388
364
|
|
389
365
|
> def automation_name_is_uiautomator2?
|
390
366
|
|
@@ -396,7 +372,7 @@ __Returns:__
|
|
396
372
|
|
397
373
|
--
|
398
374
|
|
399
|
-
##### [automation_name_is_espresso?](https://github.com/appium/ruby_lib/blob/
|
375
|
+
##### [automation_name_is_espresso?](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/driver.rb#L257)
|
400
376
|
|
401
377
|
> def automation_name_is_espresso?
|
402
378
|
|
@@ -408,7 +384,19 @@ __Returns:__
|
|
408
384
|
|
409
385
|
--
|
410
386
|
|
411
|
-
##### [
|
387
|
+
##### [automation_name_is_xcuitest?](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/driver.rb#L263)
|
388
|
+
|
389
|
+
> def automation_name_is_xcuitest?
|
390
|
+
|
391
|
+
Return true if automationName is 'XCUITest'
|
392
|
+
|
393
|
+
__Returns:__
|
394
|
+
|
395
|
+
[Boolean]
|
396
|
+
|
397
|
+
--
|
398
|
+
|
399
|
+
##### [check_server_version_xcuitest](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/driver.rb#L270)
|
412
400
|
|
413
401
|
> def check_server_version_xcuitest
|
414
402
|
|
@@ -421,7 +409,7 @@ __Returns:__
|
|
421
409
|
|
422
410
|
--
|
423
411
|
|
424
|
-
##### [appium_server_version](https://github.com/appium/ruby_lib/blob/
|
412
|
+
##### [appium_server_version](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/driver.rb#L292)
|
425
413
|
|
426
414
|
> def appium_server_version
|
427
415
|
|
@@ -436,19 +424,25 @@ Returns the server's version info
|
|
436
424
|
}
|
437
425
|
```
|
438
426
|
|
439
|
-
|
427
|
+
__Returns:__
|
440
428
|
|
441
|
-
|
442
|
-
|
443
|
-
|
429
|
+
[Hash]
|
430
|
+
|
431
|
+
--
|
432
|
+
|
433
|
+
##### [platform_version](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/driver.rb#L302)
|
434
|
+
|
435
|
+
> def platform_version
|
436
|
+
|
437
|
+
Return the platform version as an array of integers
|
444
438
|
|
445
439
|
__Returns:__
|
446
440
|
|
447
|
-
[
|
441
|
+
[Array<Integer>]
|
448
442
|
|
449
443
|
--
|
450
444
|
|
451
|
-
##### [appium_client_version](https://github.com/appium/ruby_lib/blob/
|
445
|
+
##### [appium_client_version](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/driver.rb#L321)
|
452
446
|
|
453
447
|
> def appium_client_version
|
454
448
|
|
@@ -466,7 +460,7 @@ __Returns:__
|
|
466
460
|
|
467
461
|
--
|
468
462
|
|
469
|
-
##### [absolute_app_path](https://github.com/appium/ruby_lib/blob/
|
463
|
+
##### [absolute_app_path](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/driver.rb#L333)
|
470
464
|
|
471
465
|
> def self.absolute_app_path(opts)
|
472
466
|
|
@@ -483,7 +477,7 @@ __Returns:__
|
|
483
477
|
|
484
478
|
--
|
485
479
|
|
486
|
-
##### [server_url](https://github.com/appium/ruby_lib/blob/
|
480
|
+
##### [server_url](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/driver.rb#L366)
|
487
481
|
|
488
482
|
> def server_url
|
489
483
|
|
@@ -495,7 +489,7 @@ __Returns:__
|
|
495
489
|
|
496
490
|
--
|
497
491
|
|
498
|
-
##### [restart](https://github.com/appium/ruby_lib/blob/
|
492
|
+
##### [restart](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/driver.rb#L374)
|
499
493
|
|
500
494
|
> def restart
|
501
495
|
|
@@ -507,7 +501,7 @@ __Returns:__
|
|
507
501
|
|
508
502
|
--
|
509
503
|
|
510
|
-
##### [screenshot](https://github.com/appium/ruby_lib/blob/
|
504
|
+
##### [screenshot](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/driver.rb#L385)
|
511
505
|
|
512
506
|
> def screenshot(png_save_path)
|
513
507
|
|
@@ -525,7 +519,7 @@ __Returns:__
|
|
525
519
|
|
526
520
|
--
|
527
521
|
|
528
|
-
##### [driver_quit](https://github.com/appium/ruby_lib/blob/
|
522
|
+
##### [driver_quit](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/driver.rb#L391)
|
529
523
|
|
530
524
|
> def driver_quit
|
531
525
|
|
@@ -537,12 +531,11 @@ __Returns:__
|
|
537
531
|
|
538
532
|
--
|
539
533
|
|
540
|
-
##### [quit_driver](https://github.com/appium/ruby_lib/blob/
|
534
|
+
##### [quit_driver](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/driver.rb#L394)
|
541
535
|
|
542
536
|
> def driver_quit
|
543
537
|
|
544
538
|
Quits the driver
|
545
|
-
Alias for driver_quit
|
546
539
|
|
547
540
|
__Returns:__
|
548
541
|
|
@@ -550,7 +543,19 @@ __Returns:__
|
|
550
543
|
|
551
544
|
--
|
552
545
|
|
553
|
-
##### [
|
546
|
+
##### [window_size](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/driver.rb#L403)
|
547
|
+
|
548
|
+
> def window_size
|
549
|
+
|
550
|
+
Get the device window's size.
|
551
|
+
|
552
|
+
__Returns:__
|
553
|
+
|
554
|
+
[Selenium::WebDriver::Dimension]
|
555
|
+
|
556
|
+
--
|
557
|
+
|
558
|
+
##### [start_driver](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/driver.rb#L433)
|
554
559
|
|
555
560
|
> def start_driver(http_client_ops = { http_client: nil, open_timeout: 999_999, read_timeout: 999_999 })
|
556
561
|
|
@@ -567,7 +572,7 @@ __Returns:__
|
|
567
572
|
|
568
573
|
--
|
569
574
|
|
570
|
-
##### [set_implicit_wait](https://github.com/appium/ruby_lib/blob/
|
575
|
+
##### [set_implicit_wait](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/driver.rb#L456)
|
571
576
|
|
572
577
|
> def set_implicit_wait(wait)
|
573
578
|
|
@@ -575,7 +580,7 @@ To ignore error for Espresso Driver
|
|
575
580
|
|
576
581
|
--
|
577
582
|
|
578
|
-
##### [no_wait](https://github.com/appium/ruby_lib/blob/
|
583
|
+
##### [no_wait](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/driver.rb#L466)
|
579
584
|
|
580
585
|
> def no_wait
|
581
586
|
|
@@ -583,15 +588,15 @@ Set implicit wait to zero.
|
|
583
588
|
|
584
589
|
--
|
585
590
|
|
586
|
-
##### [set_wait](https://github.com/appium/ruby_lib/blob/
|
591
|
+
##### [set_wait](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/driver.rb#L480)
|
587
592
|
|
588
593
|
> def set_wait(timeout = nil)
|
589
594
|
|
590
|
-
Set implicit wait. Default to @default_wait.
|
595
|
+
Set implicit wait. Default to @core.default_wait.
|
591
596
|
|
592
597
|
```ruby
|
593
598
|
set_wait 2
|
594
|
-
set_wait # @default_wait
|
599
|
+
set_wait # @core.default_wait
|
595
600
|
|
596
601
|
```
|
597
602
|
|
@@ -605,9 +610,9 @@ __Returns:__
|
|
605
610
|
|
606
611
|
--
|
607
612
|
|
608
|
-
##### [exists](https://github.com/appium/ruby_lib/blob/
|
613
|
+
##### [exists](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/driver.rb#L497)
|
609
614
|
|
610
|
-
> def exists(pre_check = 0, post_check = @default_wait)
|
615
|
+
> def exists(pre_check = 0, post_check = @core.default_wait)
|
611
616
|
|
612
617
|
Returns existence of element.
|
613
618
|
|
@@ -629,7 +634,7 @@ __Returns:__
|
|
629
634
|
|
630
635
|
--
|
631
636
|
|
632
|
-
##### [execute_script](https://github.com/appium/ruby_lib/blob/
|
637
|
+
##### [execute_script](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/driver.rb#L521)
|
633
638
|
|
634
639
|
> def execute_script(script, *args)
|
635
640
|
|
@@ -647,20 +652,14 @@ __Returns:__
|
|
647
652
|
|
648
653
|
--
|
649
654
|
|
650
|
-
##### [find_elements](https://github.com/appium/ruby_lib/blob/
|
655
|
+
##### [find_elements](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/driver.rb#L545)
|
651
656
|
|
652
657
|
> def find_elements(*args)
|
653
658
|
|
654
659
|
Calls @driver.find_elements_with_appium
|
655
660
|
|
656
|
-
```
|
657
|
-
```
|
658
|
-
|
659
661
|
If you call `Appium.promote_appium_methods`, you can call `find_elements` directly.
|
660
662
|
|
661
|
-
```
|
662
|
-
```
|
663
|
-
|
664
663
|
If you call `Appium.promote_appium_methods`, you can call `find_elements` directly.
|
665
664
|
|
666
665
|
__Parameters:__
|
@@ -673,15 +672,12 @@ __Returns:__
|
|
673
672
|
|
674
673
|
--
|
675
674
|
|
676
|
-
##### [find_element](https://github.com/appium/ruby_lib/blob/
|
675
|
+
##### [find_element](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/driver.rb#L561)
|
677
676
|
|
678
677
|
> def find_element(*args)
|
679
678
|
|
680
679
|
Calls @driver.find_element
|
681
680
|
|
682
|
-
```
|
683
|
-
```
|
684
|
-
|
685
681
|
If you call `Appium.promote_appium_methods`, you can call `find_element` directly.
|
686
682
|
|
687
683
|
__Parameters:__
|
@@ -694,7 +690,7 @@ __Returns:__
|
|
694
690
|
|
695
691
|
--
|
696
692
|
|
697
|
-
##### [set_location](https://github.com/appium/ruby_lib/blob/
|
693
|
+
##### [set_location](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/driver.rb#L574)
|
698
694
|
|
699
695
|
> def set_location(opts = {})
|
700
696
|
|
@@ -710,7 +706,7 @@ __Returns:__
|
|
710
706
|
|
711
707
|
--
|
712
708
|
|
713
|
-
##### [x](https://github.com/appium/ruby_lib/blob/
|
709
|
+
##### [x](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/driver.rb#L584)
|
714
710
|
|
715
711
|
> def x
|
716
712
|
|
@@ -723,527 +719,390 @@ __Returns:__
|
|
723
719
|
|
724
720
|
--
|
725
721
|
|
726
|
-
##### [
|
727
|
-
|
728
|
-
> def write_session_id(session_id)
|
722
|
+
##### [username](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/sauce_labs.rb#L4)
|
729
723
|
|
724
|
+
> def username
|
730
725
|
|
726
|
+
Username for use on Sauce Labs. Set `false` to disable Sauce, even when SAUCE_USERNAME is in ENV.
|
731
727
|
|
732
728
|
--
|
733
729
|
|
734
|
-
##### [
|
730
|
+
##### [access_key](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/sauce_labs.rb#L6)
|
735
731
|
|
736
|
-
> def
|
732
|
+
> def access_key
|
737
733
|
|
738
|
-
|
739
|
-
Since @automation_name is set only client side before start_driver is called.
|
734
|
+
Access Key for use on Sauce Labs. Set `false` to disable Sauce, even when SAUCE_ACCESS_KEY is in ENV.
|
740
735
|
|
741
736
|
--
|
742
737
|
|
743
|
-
##### [
|
738
|
+
##### [endpoint](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/sauce_labs.rb#L8)
|
744
739
|
|
745
|
-
> def
|
740
|
+
> def endpoint
|
746
741
|
|
747
|
-
|
748
|
-
|
749
|
-
__Parameters:__
|
750
|
-
|
751
|
-
value - the value to set the attribute logger to.
|
742
|
+
Override the Sauce Appium endpoint to allow e.g. TestObject tests
|
752
743
|
|
753
744
|
--
|
754
745
|
|
755
|
-
##### [
|
746
|
+
##### [initialize](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/sauce_labs.rb#L10)
|
756
747
|
|
757
|
-
> def
|
748
|
+
> def initialize(appium_lib_opts)
|
758
749
|
|
759
750
|
|
760
751
|
|
761
|
-
|
752
|
+
__Returns:__
|
762
753
|
|
763
|
-
|
754
|
+
[SauceLabs] a new instance of SauceLabs
|
764
755
|
|
765
|
-
|
756
|
+
--
|
766
757
|
|
758
|
+
##### [sauce_server_url?](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/sauce_labs.rb#L21)
|
767
759
|
|
760
|
+
> def sauce_server_url?
|
768
761
|
|
769
|
-
__Parameters:__
|
770
762
|
|
771
|
-
[Hash] opts_caps - Capabilities for Appium server. All capability keys are converted to lowerCamelCase when
|
772
|
-
this client sends capabilities to Appium server as JSON format.
|
773
763
|
|
774
764
|
__Returns:__
|
775
765
|
|
776
|
-
[
|
777
|
-
inherited ::Selenium::WebDriver::Remote::W3C::Capabilities
|
766
|
+
[Boolean]
|
778
767
|
|
779
768
|
--
|
780
769
|
|
781
|
-
##### [
|
770
|
+
##### [server_url](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/sauce_labs.rb#L25)
|
782
771
|
|
783
|
-
> def
|
772
|
+
> def server_url
|
784
773
|
|
785
|
-
Return the hash of all localization strings.
|
786
|
-
```ruby
|
787
|
-
app_strings #=> "TransitionsTitle"=>"Transitions", "WebTitle"=>"Web"
|
788
|
-
```
|
789
774
|
|
790
|
-
--
|
791
775
|
|
792
|
-
|
776
|
+
--
|
793
777
|
|
794
|
-
|
778
|
+
##### [get_log](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/common/log.rb#L10)
|
795
779
|
|
796
|
-
|
797
|
-
This is a blocking application
|
780
|
+
> def get_log(type)
|
798
781
|
|
799
|
-
--
|
800
782
|
|
801
|
-
##### [current_activity](https://github.com/appium/ruby_lib/blob/95118d4e0a6ec285e55862ea6b6fed528711ad84/lib/appium_lib/device/device.rb#L24)
|
802
783
|
|
803
|
-
|
784
|
+
__Parameters:__
|
804
785
|
|
805
|
-
|
806
|
-
```ruby
|
807
|
-
current_activity # '.ApiDemos'
|
808
|
-
```
|
786
|
+
[String|Hash] type - You can get particular type's logs.
|
809
787
|
|
810
788
|
__Returns:__
|
811
789
|
|
812
|
-
[
|
790
|
+
[[Selenium::WebDriver::LogEntry]] A list of logs data.
|
813
791
|
|
814
792
|
--
|
815
793
|
|
816
|
-
##### [
|
794
|
+
##### [get_available_log_types](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/common/log.rb#L20)
|
817
795
|
|
818
|
-
> def
|
796
|
+
> def get_available_log_types
|
819
797
|
|
820
|
-
Get
|
821
|
-
```ruby
|
822
|
-
current_package # 'com.example.android.apis'
|
823
|
-
```
|
798
|
+
Get a list of available log types
|
824
799
|
|
825
800
|
__Returns:__
|
826
801
|
|
827
|
-
[String] A
|
802
|
+
[[String]] A list of available log types.
|
828
803
|
|
829
804
|
--
|
830
805
|
|
831
|
-
##### [
|
806
|
+
##### [initialize](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/common/wait.rb#L6)
|
807
|
+
|
808
|
+
> def initialize(opts = {})
|
832
809
|
|
833
|
-
> def get_system_bars
|
834
810
|
|
835
|
-
Get system bar's information
|
836
|
-
```ruby
|
837
|
-
get_system_bars
|
838
|
-
```
|
839
811
|
|
840
812
|
__Returns:__
|
841
813
|
|
842
|
-
[
|
814
|
+
[Wait] a new instance of Wait
|
843
815
|
|
844
816
|
--
|
845
817
|
|
846
|
-
##### [
|
818
|
+
##### [wait_true](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/common/wait.rb#L34)
|
847
819
|
|
848
|
-
> def
|
820
|
+
> def wait_true(opts = {})
|
849
821
|
|
850
|
-
|
851
|
-
|
852
|
-
|
853
|
-
|
822
|
+
Check every interval seconds to see if yield returns a truthy value.
|
823
|
+
Note this isn't a strict boolean true, any truthy value is accepted.
|
824
|
+
false and nil are considered failures.
|
825
|
+
Give up after timeout seconds.
|
854
826
|
|
855
|
-
|
827
|
+
Wait code from the selenium Ruby gem
|
828
|
+
https://github.com/SeleniumHQ/selenium/blob/cf501dda3f0ed12233de51ce8170c0e8090f0c20/rb/lib/selenium/webdriver/common/wait.rb
|
856
829
|
|
857
|
-
|
830
|
+
If only a number is provided then it's treated as the timeout value.
|
858
831
|
|
859
|
-
|
832
|
+
__Parameters:__
|
860
833
|
|
861
|
-
|
834
|
+
[Hash] opts - Options
|
862
835
|
|
863
|
-
|
836
|
+
--
|
864
837
|
|
865
|
-
|
866
|
-
```ruby
|
867
|
-
is_keyboard_shown # false
|
868
|
-
```
|
838
|
+
##### [wait](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/common/wait.rb#L57)
|
869
839
|
|
870
|
-
|
840
|
+
> def wait(opts = {})
|
871
841
|
|
872
|
-
|
842
|
+
Check every interval seconds to see if yield doesn't raise an exception.
|
843
|
+
Give up after timeout seconds.
|
873
844
|
|
874
|
-
|
845
|
+
Wait code from the selenium Ruby gem
|
846
|
+
https://github.com/SeleniumHQ/selenium/blob/cf501dda3f0ed12233de51ce8170c0e8090f0c20/rb/lib/selenium/webdriver/common/wait.rb
|
875
847
|
|
876
|
-
|
848
|
+
If only a number is provided then it's treated as the timeout value.
|
877
849
|
|
878
|
-
|
850
|
+
__Parameters:__
|
879
851
|
|
880
|
-
|
852
|
+
[Hash] opts - Options
|
881
853
|
|
882
854
|
--
|
883
855
|
|
884
|
-
##### [
|
856
|
+
##### [ignore](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/common/helper.rb#L17)
|
885
857
|
|
886
|
-
> def
|
858
|
+
> def ignore
|
887
859
|
|
888
|
-
|
860
|
+
Return yield and ignore any exceptions.
|
889
861
|
|
890
862
|
--
|
891
863
|
|
892
|
-
##### [
|
893
|
-
|
894
|
-
> def shake
|
864
|
+
##### [back](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/common/helper.rb#L24)
|
895
865
|
|
896
|
-
|
897
|
-
|
898
|
-
--
|
866
|
+
> def back
|
899
867
|
|
900
|
-
|
868
|
+
Navigate back.
|
901
869
|
|
902
|
-
|
870
|
+
__Returns:__
|
903
871
|
|
904
|
-
|
872
|
+
[void]
|
905
873
|
|
906
874
|
--
|
907
875
|
|
908
|
-
##### [
|
909
|
-
|
910
|
-
> def device_locked?
|
876
|
+
##### [session_id](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/common/helper.rb#L29)
|
911
877
|
|
878
|
+
> def session_id
|
912
879
|
|
880
|
+
For Sauce Labs reporting. Returns the current session id.
|
913
881
|
|
914
882
|
--
|
915
883
|
|
916
|
-
##### [
|
884
|
+
##### [xpath](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/common/helper.rb#L37)
|
917
885
|
|
918
|
-
> def
|
886
|
+
> def xpath(xpath_str)
|
919
887
|
|
920
|
-
|
888
|
+
Returns the first element that matches the provided xpath.
|
921
889
|
|
922
890
|
__Parameters:__
|
923
891
|
|
924
|
-
[String]
|
925
|
-
|
892
|
+
[String] xpath_str - the XPath string
|
893
|
+
|
894
|
+
__Returns:__
|
926
895
|
|
927
|
-
[
|
928
|
-
XCUITest ignore this argument.
|
929
|
-
Default for iOS is `:pressKey`. Default for Android is `:tapOutside`.
|
896
|
+
[Element]
|
930
897
|
|
931
898
|
--
|
932
899
|
|
933
|
-
##### [
|
900
|
+
##### [xpaths](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/common/helper.rb#L45)
|
934
901
|
|
935
|
-
> def
|
902
|
+
> def xpaths(xpath_str)
|
936
903
|
|
937
|
-
|
938
|
-
http://developer.android.com/reference/android/view/KeyEvent.html
|
904
|
+
Returns all elements that match the provided xpath.
|
939
905
|
|
940
906
|
__Parameters:__
|
941
907
|
|
942
|
-
[
|
943
|
-
|
944
|
-
[String] metastate - The state the metakeys should be in when pressing the key.
|
945
|
-
|
946
|
-
--
|
908
|
+
[String] xpath_str - the XPath string
|
947
909
|
|
948
|
-
|
910
|
+
__Returns:__
|
949
911
|
|
950
|
-
>
|
912
|
+
[Array<Element>]
|
951
913
|
|
952
|
-
|
953
|
-
http://developer.android.com/reference/android/view/KeyEvent.html
|
914
|
+
--
|
954
915
|
|
955
|
-
|
916
|
+
##### [result](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/common/helper.rb#L56)
|
956
917
|
|
957
|
-
|
918
|
+
> def result
|
958
919
|
|
959
|
-
|
920
|
+
Returns the value of attribute result
|
960
921
|
|
961
922
|
--
|
962
923
|
|
963
|
-
##### [
|
924
|
+
##### [initialize](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/common/helper.rb#L58)
|
964
925
|
|
965
|
-
> def
|
926
|
+
> def initialize
|
966
927
|
|
967
|
-
Place a file in a specific location on the device.
|
968
928
|
|
969
|
-
__Parameters:__
|
970
929
|
|
971
|
-
|
930
|
+
__Returns:__
|
972
931
|
|
973
|
-
[
|
932
|
+
[CountElements] a new instance of CountElements
|
974
933
|
|
975
934
|
--
|
976
935
|
|
977
|
-
##### [
|
978
|
-
|
979
|
-
> def pull_file
|
936
|
+
##### [reset](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/common/helper.rb#L62)
|
980
937
|
|
981
|
-
|
982
|
-
a path relative to the installed app (iOS only).
|
983
|
-
```ruby
|
984
|
-
pull_file '/local/data/some/path' #=> Get the file at that path
|
985
|
-
pull_file 'Shenanigans.app/some/file' #=> Get 'some/file' from the install location of Shenanigans.app
|
986
|
-
```
|
938
|
+
> def reset
|
987
939
|
|
988
|
-
__Parameters:__
|
989
940
|
|
990
|
-
[String] path - Either an absolute path OR, for iOS devices, a path relative to the app, as described.
|
991
941
|
|
992
942
|
--
|
993
943
|
|
994
|
-
##### [
|
995
|
-
|
996
|
-
> def pull_folder
|
997
|
-
|
998
|
-
Retrieve a folder from the device.
|
999
|
-
```ruby
|
1000
|
-
pull_folder '/data/local/tmp' #=> Get the folder at that path
|
1001
|
-
```
|
944
|
+
##### [start_element](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/common/helper.rb#L67)
|
1002
945
|
|
1003
|
-
|
946
|
+
> def start_element(name, attrs = [], driver = $driver)
|
1004
947
|
|
1005
|
-
|
948
|
+
http://nokogiri.org/Nokogiri/XML/SAX/Document.html
|
1006
949
|
|
1007
950
|
--
|
1008
951
|
|
1009
|
-
##### [
|
1010
|
-
|
1011
|
-
> def touch_id
|
952
|
+
##### [formatted_result](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/common/helper.rb#L73)
|
1012
953
|
|
1013
|
-
|
1014
|
-
```ruby
|
1015
|
-
touch_id true #=> Simulate valid fingerprint
|
1016
|
-
touch_id false #=> Simulate invalid fingerprint
|
1017
|
-
```
|
954
|
+
> def formatted_result
|
1018
955
|
|
1019
|
-
__Parameters:__
|
1020
956
|
|
1021
|
-
[Boolean] match - fingerprint validity
|
1022
|
-
Defaults to true.
|
1023
957
|
|
1024
958
|
--
|
1025
959
|
|
1026
|
-
##### [
|
960
|
+
##### [get_page_class](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/common/helper.rb#L84)
|
1027
961
|
|
1028
|
-
> def
|
962
|
+
> def get_page_class
|
1029
963
|
|
1030
|
-
|
964
|
+
Returns a string of class counts of visible elements.
|
1031
965
|
|
1032
966
|
--
|
1033
967
|
|
1034
|
-
##### [
|
1035
|
-
|
1036
|
-
> def end_coverage
|
1037
|
-
|
1038
|
-
Android only; Ends the test coverage and writes the results to the given path on device.
|
968
|
+
##### [page_class](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/common/helper.rb#L95)
|
1039
969
|
|
1040
|
-
|
1041
|
-
|
1042
|
-
[String] path - Path on the device to write too.
|
970
|
+
> def page_class
|
1043
971
|
|
1044
|
-
|
972
|
+
Count all classes on screen and print to stdout.
|
973
|
+
Useful for appium_console.
|
1045
974
|
|
1046
975
|
--
|
1047
976
|
|
1048
|
-
##### [
|
977
|
+
##### [px_to_window_rel](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/common/helper.rb#L105)
|
978
|
+
|
979
|
+
> def px_to_window_rel(opts = {}, driver = $driver)
|
1049
980
|
|
1050
|
-
|
981
|
+
Converts pixel values to window relative values
|
1051
982
|
|
1052
|
-
|
983
|
+
```ruby
|
984
|
+
px_to_window_rel x: 50, y: 150
|
985
|
+
```
|
1053
986
|
|
1054
987
|
--
|
1055
988
|
|
1056
|
-
##### [
|
989
|
+
##### [xml_keys](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/common/helper.rb#L124)
|
1057
990
|
|
1058
|
-
> def
|
991
|
+
> def xml_keys(target)
|
1059
992
|
|
1060
|
-
|
993
|
+
Search strings.xml's values for target.
|
1061
994
|
|
1062
995
|
__Parameters:__
|
1063
996
|
|
1064
|
-
[
|
997
|
+
[String] target - the target to search for in strings.xml values
|
998
|
+
|
999
|
+
__Returns:__
|
1000
|
+
|
1001
|
+
[Array]
|
1065
1002
|
|
1066
1003
|
--
|
1067
1004
|
|
1068
|
-
##### [
|
1005
|
+
##### [xml_values](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/common/helper.rb#L132)
|
1069
1006
|
|
1070
|
-
> def
|
1007
|
+
> def xml_values(target)
|
1071
1008
|
|
1072
|
-
|
1009
|
+
Search strings.xml's keys for target.
|
1073
1010
|
|
1074
|
-
|
1075
|
-
```ruby
|
1076
|
-
start_activity app_package: 'io.appium.android.apis',
|
1077
|
-
app_activity: '.accessibility.AccessibilityNodeProviderActivity'
|
1078
|
-
```
|
1079
|
-
|
1080
|
-
--
|
1011
|
+
__Parameters:__
|
1081
1012
|
|
1082
|
-
|
1013
|
+
[String] target - the target to search for in strings.xml keys
|
1083
1014
|
|
1084
|
-
|
1015
|
+
__Returns:__
|
1085
1016
|
|
1086
|
-
|
1087
|
-
See set_network_connection method for return value
|
1017
|
+
[Array]
|
1088
1018
|
|
1089
1019
|
--
|
1090
1020
|
|
1091
|
-
##### [
|
1021
|
+
##### [resolve_id](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/common/helper.rb#L140)
|
1092
1022
|
|
1093
|
-
> def
|
1023
|
+
> def resolve_id(id)
|
1094
1024
|
|
1095
|
-
|
1096
|
-
Value (Alias) | Data | Wifi | Airplane Mode
|
1097
|
-
-------------------------------------------------
|
1098
|
-
1 (Airplane Mode) | 0 | 0 | 1
|
1099
|
-
6 (All network on) | 1 | 1 | 0
|
1100
|
-
4 (Data only) | 1 | 0 | 0
|
1101
|
-
2 (Wifi only) | 0 | 1 | 0
|
1102
|
-
0 (None) | 0 | 0 | 0
|
1025
|
+
Resolve id in strings.xml and return the value.
|
1103
1026
|
|
1104
1027
|
__Parameters:__
|
1105
1028
|
|
1106
|
-
[String]
|
1107
|
-
|
1108
|
-
--
|
1109
|
-
|
1110
|
-
##### [set_immediate_value](https://github.com/appium/ruby_lib/blob/95118d4e0a6ec285e55862ea6b6fed528711ad84/lib/appium_lib/device/device.rb#L181)
|
1111
|
-
|
1112
|
-
> def set_immediate_value
|
1113
|
-
|
1114
|
-
Set the value to element directly
|
1115
|
-
for iOS; setValue is called in XCUITest instead because XCUITest doesn't provide set value directly.
|
1116
|
-
https://github.com/appium/appium-xcuitest-driver/blob/793cdc7d5e84bd553e375076e1c6dc7e242c9cde/lib/commands/element.js#L123
|
1117
|
-
|
1118
|
-
```ruby
|
1119
|
-
set_immediate_value element, 'hello'
|
1120
|
-
```
|
1121
|
-
|
1122
|
-
--
|
1123
|
-
|
1124
|
-
##### [get_performance_data_types](https://github.com/appium/ruby_lib/blob/95118d4e0a6ec285e55862ea6b6fed528711ad84/lib/appium_lib/device/device.rb#L190)
|
1125
|
-
|
1126
|
-
> def get_performance_data_types
|
1029
|
+
[String] id - the id to resolve
|
1127
1030
|
|
1128
|
-
|
1129
|
-
cpu, memory, network, battery via adb commands.
|
1130
|
-
https://github.com/appium/appium-base-driver/blob/be29aec2318316d12b5c3295e924a5ba8f09b0fb/lib/mjsonwp/routes.js#L300
|
1031
|
+
__Returns:__
|
1131
1032
|
|
1132
|
-
|
1133
|
-
get_performance_data_types #=> ["cpuinfo", "batteryinfo", "networkinfo", "memoryinfo"]
|
1134
|
-
```
|
1033
|
+
[String]
|
1135
1034
|
|
1136
1035
|
--
|
1137
1036
|
|
1138
|
-
##### [
|
1139
|
-
|
1140
|
-
> def extend_search_contexts
|
1037
|
+
##### [filter](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/common/helper.rb#L146)
|
1141
1038
|
|
1039
|
+
> def filter
|
1142
1040
|
|
1041
|
+
Returns the value of attribute filter
|
1143
1042
|
|
1144
1043
|
--
|
1145
1044
|
|
1146
|
-
##### [
|
1147
|
-
|
1148
|
-
> def find_element_with_appium
|
1045
|
+
##### [filter=](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/common/helper.rb#L149)
|
1149
1046
|
|
1047
|
+
> def filter=(value)
|
1150
1048
|
|
1049
|
+
convert to string to support symbols
|
1151
1050
|
|
1152
1051
|
--
|
1153
1052
|
|
1154
|
-
##### [
|
1155
|
-
|
1156
|
-
> def find_elements_with_appium
|
1157
|
-
|
1158
|
-
find_element/s_with_appium with their accessibility_id
|
1159
|
-
|
1160
|
-
```ruby
|
1161
|
-
find_elements :accessibility_id, 'Animation'
|
1162
|
-
```
|
1053
|
+
##### [initialize](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/common/helper.rb#L155)
|
1163
1054
|
|
1164
|
-
|
1055
|
+
> def initialize
|
1165
1056
|
|
1166
|
-
##### [add_touch_actions](https://github.com/appium/ruby_lib/blob/95118d4e0a6ec285e55862ea6b6fed528711ad84/lib/appium_lib/device/device.rb#L474)
|
1167
1057
|
|
1168
|
-
> def add_touch_actions
|
1169
1058
|
|
1059
|
+
__Returns:__
|
1170
1060
|
|
1061
|
+
[HTMLElements] a new instance of HTMLElements
|
1171
1062
|
|
1172
1063
|
--
|
1173
1064
|
|
1174
|
-
##### [
|
1065
|
+
##### [reset](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/common/helper.rb#L160)
|
1175
1066
|
|
1176
|
-
> def
|
1067
|
+
> def reset
|
1177
1068
|
|
1178
1069
|
|
1179
1070
|
|
1180
1071
|
--
|
1181
1072
|
|
1182
|
-
##### [
|
1183
|
-
|
1184
|
-
> def set_context
|
1073
|
+
##### [result](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/common/helper.rb#L166)
|
1185
1074
|
|
1186
|
-
|
1187
|
-
```ruby
|
1188
|
-
set_context "NATIVE_APP"
|
1189
|
-
```
|
1075
|
+
> def result
|
1190
1076
|
|
1191
|
-
__Parameters:__
|
1192
1077
|
|
1193
|
-
[String] The - context to change to
|
1194
1078
|
|
1195
1079
|
--
|
1196
1080
|
|
1197
|
-
##### [
|
1198
|
-
|
1199
|
-
> def current_context
|
1200
|
-
|
1081
|
+
##### [start_element](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/common/helper.rb#L182)
|
1201
1082
|
|
1083
|
+
> def start_element(name, attrs = [])
|
1202
1084
|
|
1203
|
-
__Returns:__
|
1204
1085
|
|
1205
|
-
[String] The context currently being used.
|
1206
1086
|
|
1207
1087
|
--
|
1208
1088
|
|
1209
|
-
##### [
|
1210
|
-
|
1211
|
-
> def available_contexts
|
1212
|
-
|
1089
|
+
##### [end_element](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/common/helper.rb#L191)
|
1213
1090
|
|
1091
|
+
> def end_element(name)
|
1214
1092
|
|
1215
|
-
__Returns:__
|
1216
1093
|
|
1217
|
-
[Array<String>] All usable contexts, as an array of strings.
|
1218
1094
|
|
1219
1095
|
--
|
1220
1096
|
|
1221
|
-
##### [
|
1222
|
-
|
1223
|
-
> def within_context(context)
|
1224
|
-
|
1225
|
-
Perform a block within the given context, then switch back to the starting context.
|
1226
|
-
```ruby
|
1227
|
-
result = within_context('NATIVE_APP') do
|
1228
|
-
find_element :tag, "button"
|
1229
|
-
end # The result of `find_element :tag, "button"`
|
1230
|
-
```
|
1231
|
-
|
1232
|
-
__Parameters:__
|
1233
|
-
|
1234
|
-
[String] context - The context to switch to for the duration of the block.
|
1097
|
+
##### [characters](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/common/helper.rb#L197)
|
1235
1098
|
|
1236
|
-
|
1237
|
-
|
1238
|
-
##### [switch_to_default_context](https://github.com/appium/ruby_lib/blob/95118d4e0a6ec285e55862ea6b6fed528711ad84/lib/appium_lib/device/device.rb#L607)
|
1099
|
+
> def characters(chars)
|
1239
1100
|
|
1240
|
-
> def switch_to_default_context
|
1241
1101
|
|
1242
|
-
Change to the default context. This is equivalent to `set_context nil`.
|
1243
1102
|
|
1244
1103
|
--
|
1245
1104
|
|
1246
|
-
##### [pinch](https://github.com/appium/ruby_lib/blob/
|
1105
|
+
##### [pinch](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/common/multi_touch.rb#L53)
|
1247
1106
|
|
1248
1107
|
> def pinch(percentage = 25, auto_perform = true, driver = $driver)
|
1249
1108
|
|
@@ -1277,7 +1136,7 @@ __Parameters:__
|
|
1277
1136
|
|
1278
1137
|
--
|
1279
1138
|
|
1280
|
-
##### [zoom](https://github.com/appium/ruby_lib/blob/
|
1139
|
+
##### [zoom](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/common/multi_touch.rb#L80)
|
1281
1140
|
|
1282
1141
|
> def zoom(percentage = 200, auto_perform = true, driver = $driver)
|
1283
1142
|
|
@@ -1311,75 +1170,11 @@ __Parameters:__
|
|
1311
1170
|
|
1312
1171
|
--
|
1313
1172
|
|
1314
|
-
##### [
|
1315
|
-
|
1316
|
-
> def pinch_for_xcuitest(rate, driver)
|
1317
|
-
|
1318
|
-
|
1319
|
-
|
1320
|
-
--
|
1321
|
-
|
1322
|
-
##### [pinch_android](https://github.com/appium/ruby_lib/blob/95118d4e0a6ec285e55862ea6b6fed528711ad84/lib/appium_lib/device/multi_touch.rb#L133)
|
1323
|
-
|
1324
|
-
> def pinch_android(rate)
|
1325
|
-
|
1326
|
-
|
1327
|
-
|
1328
|
-
--
|
1329
|
-
|
1330
|
-
##### [pinch_ios](https://github.com/appium/ruby_lib/blob/95118d4e0a6ec285e55862ea6b6fed528711ad84/lib/appium_lib/device/multi_touch.rb#L147)
|
1331
|
-
|
1332
|
-
> def pinch_ios(rate)
|
1333
|
-
|
1334
|
-
|
1335
|
-
|
1336
|
-
--
|
1337
|
-
|
1338
|
-
##### [zoom_for_xcuitest](https://github.com/appium/ruby_lib/blob/95118d4e0a6ec285e55862ea6b6fed528711ad84/lib/appium_lib/device/multi_touch.rb#L161)
|
1339
|
-
|
1340
|
-
> def zoom_for_xcuitest(rate, driver)
|
1341
|
-
|
1342
|
-
|
1343
|
-
|
1344
|
-
--
|
1345
|
-
|
1346
|
-
##### [zoom_android](https://github.com/appium/ruby_lib/blob/95118d4e0a6ec285e55862ea6b6fed528711ad84/lib/appium_lib/device/multi_touch.rb#L176)
|
1347
|
-
|
1348
|
-
> def zoom_android(rate)
|
1349
|
-
|
1350
|
-
|
1351
|
-
|
1352
|
-
--
|
1353
|
-
|
1354
|
-
##### [zoom_ios](https://github.com/appium/ruby_lib/blob/95118d4e0a6ec285e55862ea6b6fed528711ad84/lib/appium_lib/device/multi_touch.rb#L190)
|
1355
|
-
|
1356
|
-
> def zoom_ios(rate)
|
1357
|
-
|
1358
|
-
|
1359
|
-
|
1360
|
-
--
|
1361
|
-
|
1362
|
-
##### [actions](https://github.com/appium/ruby_lib/blob/95118d4e0a6ec285e55862ea6b6fed528711ad84/lib/appium_lib/device/multi_touch.rb#L205)
|
1363
|
-
|
1364
|
-
> def actions
|
1365
|
-
|
1366
|
-
self
|
1367
|
-
|
1368
|
-
--
|
1369
|
-
|
1370
|
-
##### [driver](https://github.com/appium/ruby_lib/blob/95118d4e0a6ec285e55862ea6b6fed528711ad84/lib/appium_lib/device/multi_touch.rb#L205)
|
1371
|
-
|
1372
|
-
> def driver
|
1373
|
-
|
1374
|
-
self
|
1375
|
-
|
1376
|
-
--
|
1377
|
-
|
1378
|
-
##### [initialize](https://github.com/appium/ruby_lib/blob/95118d4e0a6ec285e55862ea6b6fed528711ad84/lib/appium_lib/device/multi_touch.rb#L208)
|
1173
|
+
##### [initialize](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/common/multi_touch.rb#L85)
|
1379
1174
|
|
1380
1175
|
> def initialize(driver = $driver)
|
1381
1176
|
|
1382
|
-
|
1177
|
+
self
|
1383
1178
|
|
1384
1179
|
__Returns:__
|
1385
1180
|
|
@@ -1387,597 +1182,153 @@ __Returns:__
|
|
1387
1182
|
|
1388
1183
|
--
|
1389
1184
|
|
1390
|
-
##### [
|
1391
|
-
|
1392
|
-
> def add(chain)
|
1393
|
-
|
1394
|
-
Add a touch_action to be performed
|
1395
|
-
|
1396
|
-
__Parameters:__
|
1397
|
-
|
1398
|
-
[TouchAction] chain - The action to add to the chain
|
1399
|
-
|
1400
|
-
--
|
1401
|
-
|
1402
|
-
##### [perform](https://github.com/appium/ruby_lib/blob/95118d4e0a6ec285e55862ea6b6fed528711ad84/lib/appium_lib/device/multi_touch.rb#L220)
|
1403
|
-
|
1404
|
-
> def perform
|
1405
|
-
|
1406
|
-
Ask Appium to perform the actions
|
1407
|
-
|
1408
|
-
--
|
1409
|
-
|
1410
|
-
##### [ACTIONS](https://github.com/appium/ruby_lib/blob/95118d4e0a6ec285e55862ea6b6fed528711ad84/lib/appium_lib/device/touch_actions.rb#L30)
|
1411
|
-
|
1412
|
-
> ACTIONS = [:move_to, :long_press, :double_tap, :two_finger_tap, :press, :release, :tap, :wait, :perform].freeze
|
1413
|
-
|
1414
|
-
|
1415
|
-
|
1416
|
-
--
|
1417
|
-
|
1418
|
-
##### [COMPLEX_ACTIONS](https://github.com/appium/ruby_lib/blob/95118d4e0a6ec285e55862ea6b6fed528711ad84/lib/appium_lib/device/touch_actions.rb#L31)
|
1419
|
-
|
1420
|
-
> COMPLEX_ACTIONS = [:swipe].freeze
|
1421
|
-
|
1422
|
-
|
1423
|
-
|
1424
|
-
--
|
1425
|
-
|
1426
|
-
##### [actions](https://github.com/appium/ruby_lib/blob/95118d4e0a6ec285e55862ea6b6fed528711ad84/lib/appium_lib/device/touch_actions.rb#L45)
|
1427
|
-
|
1428
|
-
> def actions
|
1429
|
-
|
1430
|
-
Returns the value of attribute actions
|
1431
|
-
|
1432
|
-
--
|
1433
|
-
|
1434
|
-
##### [initialize](https://github.com/appium/ruby_lib/blob/95118d4e0a6ec285e55862ea6b6fed528711ad84/lib/appium_lib/device/touch_actions.rb#L47)
|
1435
|
-
|
1436
|
-
> def initialize
|
1437
|
-
|
1438
|
-
|
1439
|
-
|
1440
|
-
__Returns:__
|
1441
|
-
|
1442
|
-
[TouchAction] a new instance of TouchAction
|
1443
|
-
|
1444
|
-
--
|
1445
|
-
|
1446
|
-
##### [move_to](https://github.com/appium/ruby_lib/blob/95118d4e0a6ec285e55862ea6b6fed528711ad84/lib/appium_lib/device/touch_actions.rb#L58)
|
1447
|
-
|
1448
|
-
> def move_to(opts)
|
1449
|
-
|
1450
|
-
Move to the given co-ordinates.
|
1451
|
-
|
1452
|
-
`move_to`'s `x` and `y` have two case. One is working as coordinate, the other is working as offset.
|
1453
|
-
|
1454
|
-
__Parameters:__
|
1455
|
-
|
1456
|
-
[Hash] opts - a customizable set of options
|
1457
|
-
|
1458
|
-
--
|
1459
|
-
|
1460
|
-
##### [long_press](https://github.com/appium/ruby_lib/blob/95118d4e0a6ec285e55862ea6b6fed528711ad84/lib/appium_lib/device/touch_actions.rb#L72)
|
1461
|
-
|
1462
|
-
> def long_press(opts)
|
1463
|
-
|
1464
|
-
Press down for a specific duration.
|
1465
|
-
Alternatively, you can use `press(...).wait(...).release()` instead of `long_press` if duration doesn't work well.
|
1466
|
-
https://github.com/appium/ruby_lib/issues/231#issuecomment-269895512
|
1467
|
-
e.g. Appium::TouchAction.new.press(x: 280, y: 530).wait(2000).release.perform
|
1468
|
-
|
1469
|
-
__Parameters:__
|
1470
|
-
|
1471
|
-
[Hash] element - a customizable set of options
|
1472
|
-
|
1473
|
-
[Hash] x - a customizable set of options
|
1474
|
-
|
1475
|
-
[Hash] y - a customizable set of options
|
1476
|
-
|
1477
|
-
[Hash] duration - a customizable set of options
|
1478
|
-
|
1479
|
-
--
|
1480
|
-
|
1481
|
-
##### [press](https://github.com/appium/ruby_lib/blob/95118d4e0a6ec285e55862ea6b6fed528711ad84/lib/appium_lib/device/touch_actions.rb#L84)
|
1482
|
-
|
1483
|
-
> def press(opts)
|
1484
|
-
|
1485
|
-
Press a finger onto the screen. Finger will stay down until you call
|
1486
|
-
`release`.
|
1487
|
-
|
1488
|
-
__Parameters:__
|
1489
|
-
|
1490
|
-
[Hash] opts - a customizable set of options
|
1491
|
-
|
1492
|
-
--
|
1493
|
-
|
1494
|
-
##### [release](https://github.com/appium/ruby_lib/blob/95118d4e0a6ec285e55862ea6b6fed528711ad84/lib/appium_lib/device/touch_actions.rb#L95)
|
1495
|
-
|
1496
|
-
> def release(opts = nil)
|
1497
|
-
|
1498
|
-
Remove a finger from the screen.
|
1499
|
-
|
1500
|
-
__Parameters:__
|
1501
|
-
|
1502
|
-
[Hash] opts - a customizable set of options
|
1503
|
-
|
1504
|
-
--
|
1505
|
-
|
1506
|
-
##### [tap](https://github.com/appium/ruby_lib/blob/95118d4e0a6ec285e55862ea6b6fed528711ad84/lib/appium_lib/device/touch_actions.rb#L107)
|
1507
|
-
|
1508
|
-
> def tap(opts)
|
1509
|
-
|
1510
|
-
Touch a point on the screen.
|
1511
|
-
Alternatively, you can use `press(...).release.perform` instead of `tap(...).perform`.
|
1512
|
-
|
1513
|
-
__Parameters:__
|
1514
|
-
|
1515
|
-
[Hash] opts - a customizable set of options
|
1516
|
-
|
1517
|
-
--
|
1518
|
-
|
1519
|
-
##### [double_tap](https://github.com/appium/ruby_lib/blob/95118d4e0a6ec285e55862ea6b6fed528711ad84/lib/appium_lib/device/touch_actions.rb#L120)
|
1185
|
+
##### [COMPLEX_ACTIONS](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/common/touch_actions.rb#L30)
|
1520
1186
|
|
1521
|
-
>
|
1522
|
-
|
1523
|
-
Double tap an element on the screen
|
1524
|
-
|
1525
|
-
__Parameters:__
|
1526
|
-
|
1527
|
-
[Hash] opts - a customizable set of options
|
1528
|
-
|
1529
|
-
--
|
1530
|
-
|
1531
|
-
##### [two_finger_tap](https://github.com/appium/ruby_lib/blob/95118d4e0a6ec285e55862ea6b6fed528711ad84/lib/appium_lib/device/touch_actions.rb#L131)
|
1532
|
-
|
1533
|
-
> def two_finger_tap(opts)
|
1534
|
-
|
1535
|
-
Two finger tap an element on the screen
|
1536
|
-
|
1537
|
-
__Parameters:__
|
1538
|
-
|
1539
|
-
[Hash] opts - a customizable set of options
|
1540
|
-
|
1541
|
-
--
|
1542
|
-
|
1543
|
-
##### [wait](https://github.com/appium/ruby_lib/blob/95118d4e0a6ec285e55862ea6b6fed528711ad84/lib/appium_lib/device/touch_actions.rb#L139)
|
1544
|
-
|
1545
|
-
> def wait(milliseconds)
|
1546
|
-
|
1547
|
-
Pause for a number of milliseconds before the next action
|
1548
|
-
|
1549
|
-
__Parameters:__
|
1550
|
-
|
1551
|
-
[integer] milliseconds - Number of milliseconds to pause for
|
1552
|
-
|
1553
|
-
--
|
1554
|
-
|
1555
|
-
##### [swipe](https://github.com/appium/ruby_lib/blob/95118d4e0a6ec285e55862ea6b6fed528711ad84/lib/appium_lib/device/touch_actions.rb#L162)
|
1556
|
-
|
1557
|
-
> def swipe(opts, ele = nil)
|
1558
|
-
|
1559
|
-
Convenience method to peform a swipe.
|
1560
|
-
|
1561
|
-
Note that iOS 7 simulators have broken swipe.
|
1562
|
-
|
1563
|
-
For iOS: Use `offset_x` and `offset_y` to define the end point.
|
1564
|
-
|
1565
|
-
For Android: Use `end_x` and `end_y` to define the end point.
|
1566
|
-
|
1567
|
-
If you'd like more details, please read tests and its log samples in
|
1568
|
-
`ios_tests/lib/ios/specs/device/touch_actions.rb` and `ios_tests/lib/ios/specs/device/touch_actions.rb`
|
1569
|
-
|
1570
|
-
__Parameters:__
|
1571
|
-
|
1572
|
-
[Hash] opts - a customizable set of options
|
1573
|
-
|
1574
|
-
--
|
1575
|
-
|
1576
|
-
##### [perform](https://github.com/appium/ruby_lib/blob/95118d4e0a6ec285e55862ea6b6fed528711ad84/lib/appium_lib/device/touch_actions.rb#L187)
|
1577
|
-
|
1578
|
-
> def perform(driver = $driver)
|
1579
|
-
|
1580
|
-
Ask the driver to perform all actions in this action chain.
|
1581
|
-
|
1582
|
-
--
|
1583
|
-
|
1584
|
-
##### [cancel](https://github.com/appium/ruby_lib/blob/95118d4e0a6ec285e55862ea6b6fed528711ad84/lib/appium_lib/device/touch_actions.rb#L194)
|
1585
|
-
|
1586
|
-
> def cancel(driver = $driver)
|
1587
|
-
|
1588
|
-
Does nothing, currently.
|
1589
|
-
|
1590
|
-
--
|
1187
|
+
> COMPLEX_ACTIONS = ::Appium::Core::TouchAction::COMPLEX_ACTIONS
|
1591
1188
|
|
1592
|
-
##### [swipe_coordinates](https://github.com/appium/ruby_lib/blob/95118d4e0a6ec285e55862ea6b6fed528711ad84/lib/appium_lib/device/touch_actions.rb#L201)
|
1593
|
-
|
1594
|
-
> def swipe_coordinates(end_x: nil, end_y: nil, offset_x: nil, offset_y: nil, driver: $driver)
|
1595
|
-
|
1596
|
-
Visible for testing
|
1597
|
-
|
1598
|
-
--
|
1599
|
-
|
1600
|
-
##### [chain_method](https://github.com/appium/ruby_lib/blob/95118d4e0a6ec285e55862ea6b6fed528711ad84/lib/appium_lib/device/touch_actions.rb#L219)
|
1601
|
-
|
1602
|
-
> def chain_method(method, args = nil)
|
1603
|
-
|
1604
|
-
|
1605
|
-
|
1606
|
-
--
|
1607
|
-
|
1608
|
-
##### [args_with_ele_ref](https://github.com/appium/ruby_lib/blob/95118d4e0a6ec285e55862ea6b6fed528711ad84/lib/appium_lib/device/touch_actions.rb#L225)
|
1609
|
-
|
1610
|
-
> def args_with_ele_ref(args)
|
1611
|
-
|
1612
|
-
|
1613
|
-
|
1614
|
-
--
|
1615
|
-
|
1616
|
-
##### [initialize](https://github.com/appium/ruby_lib/blob/95118d4e0a6ec285e55862ea6b6fed528711ad84/lib/appium_lib/common/wait.rb#L4)
|
1617
|
-
|
1618
|
-
> def initialize(opts = {})
|
1619
|
-
|
1620
|
-
|
1621
|
-
|
1622
|
-
__Returns:__
|
1623
|
-
|
1624
|
-
[Wait] a new instance of Wait
|
1625
|
-
|
1626
|
-
--
|
1627
|
-
|
1628
|
-
##### [until](https://github.com/appium/ruby_lib/blob/95118d4e0a6ec285e55862ea6b6fed528711ad84/lib/appium_lib/common/wait.rb#L23)
|
1629
|
-
|
1630
|
-
> def until
|
1631
|
-
|
1632
|
-
Wait code from the selenium Ruby gem
|
1633
|
-
https://github.com/SeleniumHQ/selenium/blob/cf501dda3f0ed12233de51ce8170c0e8090f0c20/rb/lib/selenium/webdriver/common/wait.rb
|
1634
|
-
|
1635
|
-
--
|
1636
|
-
|
1637
|
-
##### [wait_true](https://github.com/appium/ruby_lib/blob/95118d4e0a6ec285e55862ea6b6fed528711ad84/lib/appium_lib/common/wait.rb#L73)
|
1638
|
-
|
1639
|
-
> def wait_true(opts = {})
|
1640
|
-
|
1641
|
-
Check every interval seconds to see if yield returns a truthy value.
|
1642
|
-
Note this isn't a strict boolean true, any truthy value is accepted.
|
1643
|
-
false and nil are considered failures.
|
1644
|
-
Give up after timeout seconds.
|
1645
|
-
|
1646
|
-
Wait code from the selenium Ruby gem
|
1647
|
-
https://github.com/SeleniumHQ/selenium/blob/cf501dda3f0ed12233de51ce8170c0e8090f0c20/rb/lib/selenium/webdriver/common/wait.rb
|
1648
|
-
|
1649
|
-
If only a number is provided then it's treated as the timeout value.
|
1650
|
-
|
1651
|
-
__Parameters:__
|
1652
|
-
|
1653
|
-
[Hash] opts - Options
|
1654
|
-
|
1655
|
-
--
|
1656
|
-
|
1657
|
-
##### [wait](https://github.com/appium/ruby_lib/blob/95118d4e0a6ec285e55862ea6b6fed528711ad84/lib/appium_lib/common/wait.rb#L96)
|
1658
|
-
|
1659
|
-
> def wait(opts = {})
|
1660
|
-
|
1661
|
-
Check every interval seconds to see if yield doesn't raise an exception.
|
1662
|
-
Give up after timeout seconds.
|
1663
|
-
|
1664
|
-
Wait code from the selenium Ruby gem
|
1665
|
-
https://github.com/SeleniumHQ/selenium/blob/cf501dda3f0ed12233de51ce8170c0e8090f0c20/rb/lib/selenium/webdriver/common/wait.rb
|
1666
|
-
|
1667
|
-
If only a number is provided then it's treated as the timeout value.
|
1668
|
-
|
1669
|
-
__Parameters:__
|
1670
|
-
|
1671
|
-
[Hash] opts - Options
|
1672
|
-
|
1673
|
-
--
|
1674
|
-
|
1675
|
-
##### [ignore](https://github.com/appium/ruby_lib/blob/95118d4e0a6ec285e55862ea6b6fed528711ad84/lib/appium_lib/common/helper.rb#L24)
|
1676
|
-
|
1677
|
-
> def ignore
|
1678
|
-
|
1679
|
-
Return yield and ignore any exceptions.
|
1680
|
-
|
1681
|
-
--
|
1682
|
-
|
1683
|
-
##### [back](https://github.com/appium/ruby_lib/blob/95118d4e0a6ec285e55862ea6b6fed528711ad84/lib/appium_lib/common/helper.rb#L31)
|
1684
|
-
|
1685
|
-
> def back
|
1686
|
-
|
1687
|
-
Navigate back.
|
1688
|
-
|
1689
|
-
__Returns:__
|
1690
|
-
|
1691
|
-
[void]
|
1692
|
-
|
1693
|
-
--
|
1694
|
-
|
1695
|
-
##### [session_id](https://github.com/appium/ruby_lib/blob/95118d4e0a6ec285e55862ea6b6fed528711ad84/lib/appium_lib/common/helper.rb#L36)
|
1696
|
-
|
1697
|
-
> def session_id
|
1698
|
-
|
1699
|
-
For Sauce Labs reporting. Returns the current session id.
|
1700
|
-
|
1701
|
-
--
|
1702
|
-
|
1703
|
-
##### [xpath](https://github.com/appium/ruby_lib/blob/95118d4e0a6ec285e55862ea6b6fed528711ad84/lib/appium_lib/common/helper.rb#L44)
|
1704
|
-
|
1705
|
-
> def xpath(xpath_str)
|
1706
|
-
|
1707
|
-
Returns the first element that matches the provided xpath.
|
1708
|
-
|
1709
|
-
__Parameters:__
|
1710
|
-
|
1711
|
-
[String] xpath_str - the XPath string
|
1712
|
-
|
1713
|
-
__Returns:__
|
1714
|
-
|
1715
|
-
[Element]
|
1716
|
-
|
1717
|
-
--
|
1718
|
-
|
1719
|
-
##### [xpaths](https://github.com/appium/ruby_lib/blob/95118d4e0a6ec285e55862ea6b6fed528711ad84/lib/appium_lib/common/helper.rb#L52)
|
1720
|
-
|
1721
|
-
> def xpaths(xpath_str)
|
1722
|
-
|
1723
|
-
Returns all elements that match the provided xpath.
|
1724
|
-
|
1725
|
-
__Parameters:__
|
1726
|
-
|
1727
|
-
[String] xpath_str - the XPath string
|
1728
|
-
|
1729
|
-
__Returns:__
|
1730
|
-
|
1731
|
-
[Array<Element>]
|
1732
|
-
|
1733
|
-
--
|
1734
|
-
|
1735
|
-
##### [_print_source](https://github.com/appium/ruby_lib/blob/95118d4e0a6ec285e55862ea6b6fed528711ad84/lib/appium_lib/common/helper.rb#L56)
|
1736
|
-
|
1737
|
-
> def _print_source(source)
|
1738
|
-
|
1739
|
-
|
1740
|
-
|
1741
|
-
--
|
1742
|
-
|
1743
|
-
##### [result](https://github.com/appium/ruby_lib/blob/95118d4e0a6ec285e55862ea6b6fed528711ad84/lib/appium_lib/common/helper.rb#L69)
|
1744
|
-
|
1745
|
-
> def result
|
1746
|
-
|
1747
|
-
Returns the value of attribute result
|
1748
|
-
|
1749
|
-
--
|
1750
|
-
|
1751
|
-
##### [initialize](https://github.com/appium/ruby_lib/blob/95118d4e0a6ec285e55862ea6b6fed528711ad84/lib/appium_lib/common/helper.rb#L71)
|
1752
|
-
|
1753
|
-
> def initialize
|
1754
|
-
|
1755
|
-
|
1756
|
-
|
1757
|
-
__Returns:__
|
1758
|
-
|
1759
|
-
[CountElements] a new instance of CountElements
|
1760
|
-
|
1761
|
-
--
|
1762
|
-
|
1763
|
-
##### [reset](https://github.com/appium/ruby_lib/blob/95118d4e0a6ec285e55862ea6b6fed528711ad84/lib/appium_lib/common/helper.rb#L75)
|
1764
|
-
|
1765
|
-
> def reset
|
1766
|
-
|
1767
|
-
|
1768
|
-
|
1769
|
-
--
|
1770
|
-
|
1771
|
-
##### [start_element](https://github.com/appium/ruby_lib/blob/95118d4e0a6ec285e55862ea6b6fed528711ad84/lib/appium_lib/common/helper.rb#L80)
|
1772
|
-
|
1773
|
-
> def start_element(name, attrs = [], driver = $driver)
|
1774
|
-
|
1775
|
-
http://nokogiri.org/Nokogiri/XML/SAX/Document.html
|
1776
|
-
|
1777
|
-
--
|
1778
|
-
|
1779
|
-
##### [formatted_result](https://github.com/appium/ruby_lib/blob/95118d4e0a6ec285e55862ea6b6fed528711ad84/lib/appium_lib/common/helper.rb#L86)
|
1780
|
-
|
1781
|
-
> def formatted_result
|
1782
|
-
|
1783
|
-
|
1784
|
-
|
1785
|
-
--
|
1786
|
-
|
1787
|
-
##### [get_page_class](https://github.com/appium/ruby_lib/blob/95118d4e0a6ec285e55862ea6b6fed528711ad84/lib/appium_lib/common/helper.rb#L97)
|
1788
|
-
|
1789
|
-
> def get_page_class
|
1790
|
-
|
1791
|
-
Returns a string of class counts of visible elements.
|
1792
|
-
|
1793
|
-
--
|
1794
|
-
|
1795
|
-
##### [page_class](https://github.com/appium/ruby_lib/blob/95118d4e0a6ec285e55862ea6b6fed528711ad84/lib/appium_lib/common/helper.rb#L108)
|
1796
|
-
|
1797
|
-
> def page_class
|
1798
|
-
|
1799
|
-
Count all classes on screen and print to stdout.
|
1800
|
-
Useful for appium_console.
|
1801
|
-
|
1802
|
-
--
|
1803
|
-
|
1804
|
-
##### [px_to_window_rel](https://github.com/appium/ruby_lib/blob/95118d4e0a6ec285e55862ea6b6fed528711ad84/lib/appium_lib/common/helper.rb#L118)
|
1805
|
-
|
1806
|
-
> def px_to_window_rel(opts = {}, driver = $driver)
|
1807
|
-
|
1808
|
-
Converts pixel values to window relative values
|
1809
|
-
|
1810
|
-
```ruby
|
1811
|
-
px_to_window_rel x: 50, y: 150
|
1812
|
-
```
|
1813
|
-
|
1814
|
-
--
|
1815
|
-
|
1816
|
-
##### [xml_keys](https://github.com/appium/ruby_lib/blob/95118d4e0a6ec285e55862ea6b6fed528711ad84/lib/appium_lib/common/helper.rb#L137)
|
1817
|
-
|
1818
|
-
> def xml_keys(target)
|
1819
|
-
|
1820
|
-
Search strings.xml's values for target.
|
1821
|
-
|
1822
|
-
__Parameters:__
|
1823
|
-
|
1824
|
-
[String] target - the target to search for in strings.xml values
|
1825
|
-
|
1826
|
-
__Returns:__
|
1827
|
-
|
1828
|
-
[Array]
|
1829
|
-
|
1830
|
-
--
|
1831
|
-
|
1832
|
-
##### [xml_values](https://github.com/appium/ruby_lib/blob/95118d4e0a6ec285e55862ea6b6fed528711ad84/lib/appium_lib/common/helper.rb#L145)
|
1833
|
-
|
1834
|
-
> def xml_values(target)
|
1835
|
-
|
1836
|
-
Search strings.xml's keys for target.
|
1837
|
-
|
1838
|
-
__Parameters:__
|
1839
|
-
|
1840
|
-
[String] target - the target to search for in strings.xml keys
|
1841
|
-
|
1842
|
-
__Returns:__
|
1843
|
-
|
1844
|
-
[Array]
|
1845
|
-
|
1846
|
-
--
|
1847
|
-
|
1848
|
-
##### [resolve_id](https://github.com/appium/ruby_lib/blob/95118d4e0a6ec285e55862ea6b6fed528711ad84/lib/appium_lib/common/helper.rb#L153)
|
1849
|
-
|
1850
|
-
> def resolve_id(id)
|
1851
|
-
|
1852
|
-
Resolve id in strings.xml and return the value.
|
1853
|
-
|
1854
|
-
__Parameters:__
|
1855
|
-
|
1856
|
-
[String] id - the id to resolve
|
1857
|
-
|
1858
|
-
__Returns:__
|
1859
|
-
|
1860
|
-
[String]
|
1861
|
-
|
1862
|
-
--
|
1863
|
-
|
1864
|
-
##### [filter](https://github.com/appium/ruby_lib/blob/95118d4e0a6ec285e55862ea6b6fed528711ad84/lib/appium_lib/common/helper.rb#L159)
|
1865
|
-
|
1866
|
-
> def filter
|
1867
|
-
|
1868
|
-
Returns the value of attribute filter
|
1869
|
-
|
1870
|
-
--
|
1871
|
-
|
1872
|
-
##### [filter=](https://github.com/appium/ruby_lib/blob/95118d4e0a6ec285e55862ea6b6fed528711ad84/lib/appium_lib/common/helper.rb#L162)
|
1873
|
-
|
1874
|
-
> def filter=(value)
|
1875
1189
|
|
1876
|
-
convert to string to support symbols
|
1877
1190
|
|
1878
1191
|
--
|
1879
1192
|
|
1880
|
-
##### [initialize](https://github.com/appium/ruby_lib/blob/
|
1193
|
+
##### [initialize](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/common/touch_actions.rb#L44)
|
1881
1194
|
|
1882
|
-
> def initialize
|
1195
|
+
> def initialize(driver = $driver)
|
1883
1196
|
|
1884
1197
|
|
1885
1198
|
|
1886
1199
|
__Returns:__
|
1887
1200
|
|
1888
|
-
[
|
1201
|
+
[TouchAction] a new instance of TouchAction
|
1889
1202
|
|
1890
1203
|
--
|
1891
1204
|
|
1892
|
-
##### [
|
1205
|
+
##### [for](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/ios/ios.rb#L15) ios
|
1893
1206
|
|
1894
|
-
> def
|
1207
|
+
> def self.for(target)
|
1895
1208
|
|
1896
1209
|
|
1897
1210
|
|
1898
1211
|
--
|
1899
1212
|
|
1900
|
-
##### [
|
1213
|
+
##### [UIAStaticText](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/ios/element/text.rb#L4) ios
|
1901
1214
|
|
1902
|
-
>
|
1215
|
+
> UIAStaticText = 'UIAStaticText'.freeze
|
1903
1216
|
|
1904
1217
|
|
1905
1218
|
|
1906
1219
|
--
|
1907
1220
|
|
1908
|
-
##### [
|
1221
|
+
##### [XCUIElementTypeStaticText](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/ios/element/text.rb#L5) ios
|
1909
1222
|
|
1910
|
-
>
|
1223
|
+
> XCUIElementTypeStaticText = 'XCUIElementTypeStaticText'.freeze
|
1911
1224
|
|
1912
1225
|
|
1913
1226
|
|
1914
1227
|
--
|
1915
1228
|
|
1916
|
-
##### [
|
1229
|
+
##### [static_text_class](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/ios/element/text.rb#L8) ios
|
1917
1230
|
|
1918
|
-
> def
|
1231
|
+
> def static_text_class
|
1919
1232
|
|
1920
1233
|
|
1921
1234
|
|
1235
|
+
__Returns:__
|
1236
|
+
|
1237
|
+
[String] Class name for text
|
1238
|
+
|
1922
1239
|
--
|
1923
1240
|
|
1924
|
-
##### [
|
1241
|
+
##### [text](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/ios/element/text.rb#L16) ios
|
1925
1242
|
|
1926
|
-
> def
|
1243
|
+
> def text(value)
|
1244
|
+
|
1245
|
+
Find the first UIAStaticText|XCUIElementTypeStaticText that contains value or by index.
|
1246
|
+
If int then the UIAStaticText|XCUIElementTypeStaticText at that index is returned.
|
1247
|
+
|
1248
|
+
__Parameters:__
|
1249
|
+
|
1250
|
+
[String, Integer] value - the value to find.
|
1927
1251
|
|
1252
|
+
__Returns:__
|
1928
1253
|
|
1254
|
+
[UIAStaticText|XCUIElementTypeStaticText]
|
1929
1255
|
|
1930
1256
|
--
|
1931
1257
|
|
1932
|
-
##### [
|
1258
|
+
##### [texts](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/ios/element/text.rb#L25) ios
|
1259
|
+
|
1260
|
+
> def texts(value = false)
|
1261
|
+
|
1262
|
+
Find all UIAStaticTexts|XCUIElementTypeStaticTexts containing value.
|
1263
|
+
If value is omitted, all UIAStaticTexts|XCUIElementTypeStaticTexts are returned
|
1264
|
+
|
1265
|
+
__Parameters:__
|
1933
1266
|
|
1934
|
-
|
1267
|
+
[String] value - the value to search for
|
1935
1268
|
|
1269
|
+
__Returns:__
|
1936
1270
|
|
1271
|
+
[Array<UIAStaticText|XCUIElementTypeStaticText>]
|
1937
1272
|
|
1938
1273
|
--
|
1939
1274
|
|
1940
|
-
##### [
|
1275
|
+
##### [first_text](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/ios/element/text.rb#L32) ios
|
1276
|
+
|
1277
|
+
> def first_text
|
1941
1278
|
|
1942
|
-
|
1279
|
+
Find the first UIAStaticText|XCUIElementTypeStaticText.
|
1943
1280
|
|
1281
|
+
__Returns:__
|
1944
1282
|
|
1283
|
+
[UIAStaticText|XCUIElementTypeStaticText]
|
1945
1284
|
|
1946
1285
|
--
|
1947
1286
|
|
1948
|
-
##### [
|
1287
|
+
##### [last_text](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/ios/element/text.rb#L38) ios
|
1288
|
+
|
1289
|
+
> def last_text
|
1949
1290
|
|
1950
|
-
|
1291
|
+
Find the last UIAStaticText|XCUIElementTypeStaticText.
|
1951
1292
|
|
1293
|
+
__Returns:__
|
1952
1294
|
|
1295
|
+
[UIAStaticText|XCUIElementTypeStaticText]
|
1953
1296
|
|
1954
1297
|
--
|
1955
1298
|
|
1956
|
-
##### [
|
1299
|
+
##### [text_exact](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/ios/element/text.rb#L45) ios
|
1300
|
+
|
1301
|
+
> def text_exact(value)
|
1302
|
+
|
1303
|
+
Find the first UIAStaticText|XCUIElementTypeStaticText that exactly matches value.
|
1304
|
+
|
1305
|
+
__Parameters:__
|
1957
1306
|
|
1958
|
-
|
1307
|
+
[String] value - the value to match exactly
|
1959
1308
|
|
1309
|
+
__Returns:__
|
1960
1310
|
|
1311
|
+
[UIAStaticText|XCUIElementTypeStaticText]
|
1961
1312
|
|
1962
1313
|
--
|
1963
1314
|
|
1964
|
-
##### [
|
1315
|
+
##### [texts_exact](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/ios/element/text.rb#L52) ios
|
1965
1316
|
|
1966
|
-
> def
|
1317
|
+
> def texts_exact(value)
|
1967
1318
|
|
1968
|
-
|
1319
|
+
Find all UIAStaticTexts|XCUIElementTypeStaticTexts that exactly match value.
|
1969
1320
|
|
1970
|
-
|
1321
|
+
__Parameters:__
|
1971
1322
|
|
1972
|
-
|
1323
|
+
[String] value - the value to match exactly
|
1973
1324
|
|
1974
|
-
|
1325
|
+
__Returns:__
|
1975
1326
|
|
1976
|
-
|
1327
|
+
[Array<UIAStaticText|XCUIElementTypeStaticText>]
|
1977
1328
|
|
1978
1329
|
--
|
1979
1330
|
|
1980
|
-
##### [filter](https://github.com/appium/ruby_lib/blob/
|
1331
|
+
##### [filter](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/ios/common/helper.rb#L4) ios
|
1981
1332
|
|
1982
1333
|
> def filter
|
1983
1334
|
|
@@ -1985,7 +1336,7 @@ Returns the value of attribute filter
|
|
1985
1336
|
|
1986
1337
|
--
|
1987
1338
|
|
1988
|
-
##### [filter=](https://github.com/appium/ruby_lib/blob/
|
1339
|
+
##### [filter=](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/ios/common/helper.rb#L4) ios
|
1989
1340
|
|
1990
1341
|
> def filter=(value)
|
1991
1342
|
|
@@ -1997,7 +1348,7 @@ __Parameters:__
|
|
1997
1348
|
|
1998
1349
|
--
|
1999
1350
|
|
2000
|
-
##### [start_element](https://github.com/appium/ruby_lib/blob/
|
1351
|
+
##### [start_element](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/ios/common/helper.rb#L6) ios
|
2001
1352
|
|
2002
1353
|
> def start_element(type, attrs = [])
|
2003
1354
|
|
@@ -2005,15 +1356,7 @@ __Parameters:__
|
|
2005
1356
|
|
2006
1357
|
--
|
2007
1358
|
|
2008
|
-
##### [
|
2009
|
-
|
2010
|
-
> def _print_attr(type, name, label, value, hint, visible) # rubocop:disable Metrics/ParameterLists
|
2011
|
-
|
2012
|
-
rubocop:disable Metrics/ParameterLists
|
2013
|
-
|
2014
|
-
--
|
2015
|
-
|
2016
|
-
##### [ios_password](https://github.com/appium/ruby_lib/blob/95118d4e0a6ec285e55862ea6b6fed528711ad84/lib/appium_lib/ios/helper.rb#L42) ios
|
1359
|
+
##### [ios_password](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/ios/common/helper.rb#L43) ios
|
2017
1360
|
|
2018
1361
|
> def ios_password(length = 1)
|
2019
1362
|
|
@@ -2031,40 +1374,12 @@ __Returns:__
|
|
2031
1374
|
|
2032
1375
|
--
|
2033
1376
|
|
2034
|
-
##### [
|
2035
|
-
|
2036
|
-
> def get_page(element = source_window(0), class_name = nil)
|
2037
|
-
|
2038
|
-
Returns a string of interesting elements. iOS only.
|
2039
|
-
|
2040
|
-
Defaults to inspecting the 1st windows source only.
|
2041
|
-
use get_page(get_source) for all window sources
|
2042
|
-
|
2043
|
-
__Parameters:__
|
2044
|
-
|
2045
|
-
[Hash] element - a customizable set of options
|
2046
|
-
|
2047
|
-
[Hash] class_name - a customizable set of options
|
2048
|
-
|
2049
|
-
__Returns:__
|
2050
|
-
|
2051
|
-
[String]
|
2052
|
-
|
2053
|
-
--
|
2054
|
-
|
2055
|
-
##### [page](https://github.com/appium/ruby_lib/blob/95118d4e0a6ec285e55862ea6b6fed528711ad84/lib/appium_lib/ios/helper.rb#L142) ios
|
1377
|
+
##### [page](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/ios/common/helper.rb#L59) ios
|
2056
1378
|
|
2057
1379
|
> def page(opts = {})
|
2058
1380
|
|
2059
1381
|
Prints a string of interesting elements to the console.
|
2060
1382
|
|
2061
|
-
Example
|
2062
|
-
|
2063
|
-
```ruby
|
2064
|
-
page class: :UIAButton # filter on buttons
|
2065
|
-
page class: :UIAButton, window: 1
|
2066
|
-
```
|
2067
|
-
|
2068
1383
|
__Parameters:__
|
2069
1384
|
|
2070
1385
|
[Hash] visible - a customizable set of options
|
@@ -2077,9 +1392,9 @@ __Returns:__
|
|
2077
1392
|
|
2078
1393
|
--
|
2079
1394
|
|
2080
|
-
##### [source_window](https://github.com/appium/ruby_lib/blob/
|
1395
|
+
##### [source_window](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/ios/common/helper.rb#L83) ios
|
2081
1396
|
|
2082
|
-
> def source_window(
|
1397
|
+
> def source_window(_window_number = nil)
|
2083
1398
|
|
2084
1399
|
Gets the JSON source of window number
|
2085
1400
|
|
@@ -2089,25 +1404,7 @@ __Returns:__
|
|
2089
1404
|
|
2090
1405
|
--
|
2091
1406
|
|
2092
|
-
##### [
|
2093
|
-
|
2094
|
-
> def page_window(window_number = 0)
|
2095
|
-
|
2096
|
-
Prints parsed page source to console.
|
2097
|
-
|
2098
|
-
example: page_window 0
|
2099
|
-
|
2100
|
-
__Parameters:__
|
2101
|
-
|
2102
|
-
[Integer] window_number - the int index of the target window
|
2103
|
-
|
2104
|
-
__Returns:__
|
2105
|
-
|
2106
|
-
[void]
|
2107
|
-
|
2108
|
-
--
|
2109
|
-
|
2110
|
-
##### [id](https://github.com/appium/ruby_lib/blob/95118d4e0a6ec285e55862ea6b6fed528711ad84/lib/appium_lib/ios/helper.rb#L185) ios
|
1407
|
+
##### [id](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/ios/common/helper.rb#L91) ios
|
2111
1408
|
|
2112
1409
|
> def id(id)
|
2113
1410
|
|
@@ -2123,19 +1420,7 @@ __Returns:__
|
|
2123
1420
|
|
2124
1421
|
--
|
2125
1422
|
|
2126
|
-
##### [
|
2127
|
-
|
2128
|
-
> def ios_version
|
2129
|
-
|
2130
|
-
Return the iOS version as an array of integers
|
2131
|
-
|
2132
|
-
__Returns:__
|
2133
|
-
|
2134
|
-
[Array<Integer>]
|
2135
|
-
|
2136
|
-
--
|
2137
|
-
|
2138
|
-
##### [ele_index](https://github.com/appium/ruby_lib/blob/95118d4e0a6ec285e55862ea6b6fed528711ad84/lib/appium_lib/ios/helper.rb#L200) ios
|
1423
|
+
##### [ele_index](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/ios/common/helper.rb#L99) ios
|
2139
1424
|
|
2140
1425
|
> def ele_index(class_name, index)
|
2141
1426
|
|
@@ -2153,7 +1438,7 @@ __Returns:__
|
|
2153
1438
|
|
2154
1439
|
--
|
2155
1440
|
|
2156
|
-
##### [find_ele_by_attr](https://github.com/appium/ruby_lib/blob/
|
1441
|
+
##### [find_ele_by_attr](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/ios/common/helper.rb#L127) ios
|
2157
1442
|
|
2158
1443
|
> def find_ele_by_attr(class_name, attr, value)
|
2159
1444
|
|
@@ -2175,7 +1460,7 @@ __Returns:__
|
|
2175
1460
|
|
2176
1461
|
--
|
2177
1462
|
|
2178
|
-
##### [find_eles_by_attr](https://github.com/appium/ruby_lib/blob/
|
1463
|
+
##### [find_eles_by_attr](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/ios/common/helper.rb#L138) ios
|
2179
1464
|
|
2180
1465
|
> def find_eles_by_attr(class_name, attr, value)
|
2181
1466
|
|
@@ -2197,7 +1482,7 @@ __Returns:__
|
|
2197
1482
|
|
2198
1483
|
--
|
2199
1484
|
|
2200
|
-
##### [find_ele_by_predicate](https://github.com/appium/ruby_lib/blob/
|
1485
|
+
##### [find_ele_by_predicate](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/ios/common/helper.rb#L151) ios
|
2201
1486
|
|
2202
1487
|
> def find_ele_by_predicate(class_name: '*', value:)
|
2203
1488
|
|
@@ -2214,7 +1499,7 @@ __Returns:__
|
|
2214
1499
|
|
2215
1500
|
--
|
2216
1501
|
|
2217
|
-
##### [find_eles_by_predicate](https://github.com/appium/ruby_lib/blob/
|
1502
|
+
##### [find_eles_by_predicate](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/ios/common/helper.rb#L162) ios
|
2218
1503
|
|
2219
1504
|
> def find_eles_by_predicate(class_name: '*', value:)
|
2220
1505
|
|
@@ -2233,7 +1518,7 @@ __Returns:__
|
|
2233
1518
|
|
2234
1519
|
--
|
2235
1520
|
|
2236
|
-
##### [find_ele_by_attr_include](https://github.com/appium/ruby_lib/blob/
|
1521
|
+
##### [find_ele_by_attr_include](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/ios/common/helper.rb#L178) ios
|
2237
1522
|
|
2238
1523
|
> def find_ele_by_attr_include(class_name, attr, value)
|
2239
1524
|
|
@@ -2254,7 +1539,7 @@ __Returns:__
|
|
2254
1539
|
|
2255
1540
|
--
|
2256
1541
|
|
2257
|
-
##### [find_eles_by_attr_include](https://github.com/appium/ruby_lib/blob/
|
1542
|
+
##### [find_eles_by_attr_include](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/ios/common/helper.rb#L188) ios
|
2258
1543
|
|
2259
1544
|
> def find_eles_by_attr_include(class_name, attr, value)
|
2260
1545
|
|
@@ -2275,7 +1560,7 @@ __Returns:__
|
|
2275
1560
|
|
2276
1561
|
--
|
2277
1562
|
|
2278
|
-
##### [find_ele_by_predicate_include](https://github.com/appium/ruby_lib/blob/
|
1563
|
+
##### [find_ele_by_predicate_include](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/ios/common/helper.rb#L196) ios
|
2279
1564
|
|
2280
1565
|
> def find_ele_by_predicate_include(class_name: '*', value:)
|
2281
1566
|
|
@@ -2292,7 +1577,7 @@ __Returns:__
|
|
2292
1577
|
|
2293
1578
|
--
|
2294
1579
|
|
2295
|
-
##### [find_eles_by_predicate_include](https://github.com/appium/ruby_lib/blob/
|
1580
|
+
##### [find_eles_by_predicate_include](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/ios/common/helper.rb#L207) ios
|
2296
1581
|
|
2297
1582
|
> def find_eles_by_predicate_include(class_name: '*', value:)
|
2298
1583
|
|
@@ -2311,7 +1596,7 @@ __Returns:__
|
|
2311
1596
|
|
2312
1597
|
--
|
2313
1598
|
|
2314
|
-
##### [first_ele](https://github.com/appium/ruby_lib/blob/
|
1599
|
+
##### [first_ele](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/ios/common/helper.rb#L220) ios
|
2315
1600
|
|
2316
1601
|
> def first_ele(class_name)
|
2317
1602
|
|
@@ -2327,7 +1612,7 @@ __Returns:__
|
|
2327
1612
|
|
2328
1613
|
--
|
2329
1614
|
|
2330
|
-
##### [last_ele](https://github.com/appium/ruby_lib/blob/
|
1615
|
+
##### [last_ele](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/ios/common/helper.rb#L227) ios
|
2331
1616
|
|
2332
1617
|
> def last_ele(class_name)
|
2333
1618
|
|
@@ -2343,7 +1628,7 @@ __Returns:__
|
|
2343
1628
|
|
2344
1629
|
--
|
2345
1630
|
|
2346
|
-
##### [tag](https://github.com/appium/ruby_lib/blob/
|
1631
|
+
##### [tag](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/ios/common/helper.rb#L235) ios
|
2347
1632
|
|
2348
1633
|
> def tag(class_name)
|
2349
1634
|
|
@@ -2359,7 +1644,7 @@ __Returns:__
|
|
2359
1644
|
|
2360
1645
|
--
|
2361
1646
|
|
2362
|
-
##### [tags](https://github.com/appium/ruby_lib/blob/
|
1647
|
+
##### [tags](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/ios/common/helper.rb#L243) ios
|
2363
1648
|
|
2364
1649
|
> def tags(class_name)
|
2365
1650
|
|
@@ -2375,7 +1660,7 @@ __Returns:__
|
|
2375
1660
|
|
2376
1661
|
--
|
2377
1662
|
|
2378
|
-
##### [tags_include](https://github.com/appium/ruby_lib/blob/
|
1663
|
+
##### [tags_include](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/ios/common/helper.rb#L254) ios
|
2379
1664
|
|
2380
1665
|
> def tags_include(class_names:, value: nil)
|
2381
1666
|
|
@@ -2395,7 +1680,7 @@ __Returns:__
|
|
2395
1680
|
|
2396
1681
|
--
|
2397
1682
|
|
2398
|
-
##### [tags_exact](https://github.com/appium/ruby_lib/blob/
|
1683
|
+
##### [tags_exact](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/ios/common/helper.rb#L269) ios
|
2399
1684
|
|
2400
1685
|
> def tags_exact(class_names:, value: nil)
|
2401
1686
|
|
@@ -2415,7 +1700,7 @@ __Returns:__
|
|
2415
1700
|
|
2416
1701
|
--
|
2417
1702
|
|
2418
|
-
##### [ele_by_json_visible_contains](https://github.com/appium/ruby_lib/blob/
|
1703
|
+
##### [ele_by_json_visible_contains](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/ios/common/helper.rb#L306) ios
|
2419
1704
|
|
2420
1705
|
> def ele_by_json_visible_contains(element, value)
|
2421
1706
|
|
@@ -2434,7 +1719,7 @@ __Returns:__
|
|
2434
1719
|
|
2435
1720
|
--
|
2436
1721
|
|
2437
|
-
##### [eles_by_json_visible_contains](https://github.com/appium/ruby_lib/blob/
|
1722
|
+
##### [eles_by_json_visible_contains](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/ios/common/helper.rb#L315) ios
|
2438
1723
|
|
2439
1724
|
> def eles_by_json_visible_contains(element, value)
|
2440
1725
|
|
@@ -2453,7 +1738,7 @@ __Returns:__
|
|
2453
1738
|
|
2454
1739
|
--
|
2455
1740
|
|
2456
|
-
##### [ele_by_json_visible_exact](https://github.com/appium/ruby_lib/blob/
|
1741
|
+
##### [ele_by_json_visible_exact](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/ios/common/helper.rb#L345) ios
|
2457
1742
|
|
2458
1743
|
> def ele_by_json_visible_exact(element, value)
|
2459
1744
|
|
@@ -2472,7 +1757,7 @@ __Returns:__
|
|
2472
1757
|
|
2473
1758
|
--
|
2474
1759
|
|
2475
|
-
##### [eles_by_json_visible_exact](https://github.com/appium/ruby_lib/blob/
|
1760
|
+
##### [eles_by_json_visible_exact](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/ios/common/helper.rb#L354) ios
|
2476
1761
|
|
2477
1762
|
> def eles_by_json_visible_exact(element, value)
|
2478
1763
|
|
@@ -2491,7 +1776,7 @@ __Returns:__
|
|
2491
1776
|
|
2492
1777
|
--
|
2493
1778
|
|
2494
|
-
##### [_all_pred](https://github.com/appium/ruby_lib/blob/
|
1779
|
+
##### [_all_pred](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/ios/common/helper.rb#L363) ios
|
2495
1780
|
|
2496
1781
|
> def _all_pred(opts)
|
2497
1782
|
|
@@ -2501,7 +1786,7 @@ visible - if true, only visible elements are returned. default true
|
|
2501
1786
|
|
2502
1787
|
--
|
2503
1788
|
|
2504
|
-
##### [ele_with_pred](https://github.com/appium/ruby_lib/blob/
|
1789
|
+
##### [ele_with_pred](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/ios/common/helper.rb#L376) ios
|
2505
1790
|
|
2506
1791
|
> def ele_with_pred(opts)
|
2507
1792
|
|
@@ -2517,7 +1802,7 @@ __Returns:__
|
|
2517
1802
|
|
2518
1803
|
--
|
2519
1804
|
|
2520
|
-
##### [eles_with_pred](https://github.com/appium/ruby_lib/blob/
|
1805
|
+
##### [eles_with_pred](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/ios/common/helper.rb#L387) ios
|
2521
1806
|
|
2522
1807
|
> def eles_with_pred(opts)
|
2523
1808
|
|
@@ -2533,7 +1818,7 @@ __Returns:__
|
|
2533
1818
|
|
2534
1819
|
--
|
2535
1820
|
|
2536
|
-
##### [source](https://github.com/appium/ruby_lib/blob/
|
1821
|
+
##### [source](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/ios/common/helper.rb#L393) ios
|
2537
1822
|
|
2538
1823
|
> def source
|
2539
1824
|
|
@@ -2541,212 +1826,94 @@ Prints xml of the current page
|
|
2541
1826
|
|
2542
1827
|
__Returns:__
|
2543
1828
|
|
2544
|
-
[void]
|
2545
|
-
|
2546
|
-
--
|
2547
|
-
|
2548
|
-
##### [_validate_object](https://github.com/appium/ruby_lib/blob/95118d4e0a6ec285e55862ea6b6fed528711ad84/lib/appium_lib/ios/helper.rb#L498) ios
|
2549
|
-
|
2550
|
-
> def _validate_object(*objects)
|
2551
|
-
|
2552
|
-
|
2553
|
-
|
2554
|
-
--
|
2555
|
-
|
2556
|
-
##### [_by_json](https://github.com/appium/ruby_lib/blob/95118d4e0a6ec285e55862ea6b6fed528711ad84/lib/appium_lib/ios/helper.rb#L547) ios
|
2557
|
-
|
2558
|
-
> def _by_json(opts)
|
2559
|
-
|
2560
|
-
For Appium(automation name), not XCUITest
|
2561
|
-
typeArray - array of string types to search for. Example: ["UIAStaticText"]
|
2562
|
-
onlyFirst - boolean. returns only the first result if true. Example: true
|
2563
|
-
onlyVisible - boolean. returns only visible elements if true. Example: true
|
2564
|
-
target - string. the target value to search for. Example: "Buttons, Various uses of UIButton"
|
2565
|
-
substring - boolean. matches on substrings if true otherwise an exact mathc is required. Example: true
|
2566
|
-
insensitive - boolean. ignores case sensitivity if true otherwise it's case sensitive. Example: true
|
2567
|
-
|
2568
|
-
opts = {
|
2569
|
-
typeArray: ["UIAStaticText"],
|
2570
|
-
onlyFirst: true,
|
2571
|
-
onlyVisible: true,
|
2572
|
-
name: {
|
2573
|
-
target: "Buttons, Various uses of UIButton",
|
2574
|
-
substring: false,
|
2575
|
-
insensitive: false,
|
2576
|
-
},
|
2577
|
-
label: {
|
2578
|
-
target: "Buttons, Various uses of UIButton",
|
2579
|
-
substring: false,
|
2580
|
-
insensitive: false,
|
2581
|
-
},
|
2582
|
-
value: {
|
2583
|
-
target: "Buttons, Various uses of UIButton",
|
2584
|
-
substring: false,
|
2585
|
-
insensitive: false,
|
2586
|
-
}
|
2587
|
-
}
|
2588
|
-
|
2589
|
-
--
|
2590
|
-
|
2591
|
-
##### [eles_by_json](https://github.com/appium/ruby_lib/blob/95118d4e0a6ec285e55862ea6b6fed528711ad84/lib/appium_lib/ios/helper.rb#L597) ios
|
2592
|
-
|
2593
|
-
> def eles_by_json(opts)
|
2594
|
-
|
2595
|
-
For Appium(automation name), not XCUITest
|
2596
|
-
example usage:
|
2597
|
-
|
2598
|
-
eles_by_json({
|
2599
|
-
typeArray: ["UIAStaticText"],
|
2600
|
-
onlyVisible: true,
|
2601
|
-
name: {
|
2602
|
-
target: "Buttons, Various uses of UIButton",
|
2603
|
-
substring: false,
|
2604
|
-
insensitive: false,
|
2605
|
-
},
|
2606
|
-
})
|
2607
|
-
|
2608
|
-
--
|
2609
|
-
|
2610
|
-
##### [ele_by_json](https://github.com/appium/ruby_lib/blob/95118d4e0a6ec285e55862ea6b6fed528711ad84/lib/appium_lib/ios/helper.rb#L603) ios
|
2611
|
-
|
2612
|
-
> def ele_by_json(opts)
|
2613
|
-
|
2614
|
-
see eles_by_json
|
2615
|
-
|
2616
|
-
--
|
2617
|
-
|
2618
|
-
##### [get_source](https://github.com/appium/ruby_lib/blob/95118d4e0a6ec285e55862ea6b6fed528711ad84/lib/appium_lib/ios/helper.rb#L613) ios
|
2619
|
-
|
2620
|
-
> def get_source
|
2621
|
-
|
2622
|
-
Returns XML string for the current page
|
2623
|
-
Same as driver.page_source
|
2624
|
-
|
2625
|
-
__Returns:__
|
2626
|
-
|
2627
|
-
[String]
|
2628
|
-
|
2629
|
-
--
|
2630
|
-
|
2631
|
-
##### [UIAStaticText](https://github.com/appium/ruby_lib/blob/95118d4e0a6ec285e55862ea6b6fed528711ad84/lib/appium_lib/ios/element/text.rb#L4) ios
|
2632
|
-
|
2633
|
-
> UIAStaticText = 'UIAStaticText'.freeze
|
2634
|
-
|
2635
|
-
|
2636
|
-
|
2637
|
-
--
|
2638
|
-
|
2639
|
-
##### [XCUIElementTypeStaticText](https://github.com/appium/ruby_lib/blob/95118d4e0a6ec285e55862ea6b6fed528711ad84/lib/appium_lib/ios/element/text.rb#L5) ios
|
2640
|
-
|
2641
|
-
> XCUIElementTypeStaticText = 'XCUIElementTypeStaticText'.freeze
|
2642
|
-
|
2643
|
-
|
2644
|
-
|
2645
|
-
--
|
2646
|
-
|
2647
|
-
##### [static_text_class](https://github.com/appium/ruby_lib/blob/95118d4e0a6ec285e55862ea6b6fed528711ad84/lib/appium_lib/ios/element/text.rb#L8) ios
|
2648
|
-
|
2649
|
-
> def static_text_class
|
2650
|
-
|
2651
|
-
|
2652
|
-
|
2653
|
-
__Returns:__
|
2654
|
-
|
2655
|
-
[String] Class name for text
|
2656
|
-
|
2657
|
-
--
|
2658
|
-
|
2659
|
-
##### [text](https://github.com/appium/ruby_lib/blob/95118d4e0a6ec285e55862ea6b6fed528711ad84/lib/appium_lib/ios/element/text.rb#L16) ios
|
2660
|
-
|
2661
|
-
> def text(value)
|
2662
|
-
|
2663
|
-
Find the first UIAStaticText|XCUIElementTypeStaticText that contains value or by index.
|
2664
|
-
If int then the UIAStaticText|XCUIElementTypeStaticText at that index is returned.
|
2665
|
-
|
2666
|
-
__Parameters:__
|
2667
|
-
|
2668
|
-
[String, Integer] value - the value to find.
|
2669
|
-
|
2670
|
-
__Returns:__
|
2671
|
-
|
2672
|
-
[UIAStaticText|XCUIElementTypeStaticText]
|
2673
|
-
|
2674
|
-
--
|
2675
|
-
|
2676
|
-
##### [texts](https://github.com/appium/ruby_lib/blob/95118d4e0a6ec285e55862ea6b6fed528711ad84/lib/appium_lib/ios/element/text.rb#L25) ios
|
2677
|
-
|
2678
|
-
> def texts(value = false)
|
2679
|
-
|
2680
|
-
Find all UIAStaticTexts|XCUIElementTypeStaticTexts containing value.
|
2681
|
-
If value is omitted, all UIAStaticTexts|XCUIElementTypeStaticTexts are returned
|
2682
|
-
|
2683
|
-
__Parameters:__
|
2684
|
-
|
2685
|
-
[String] value - the value to search for
|
2686
|
-
|
2687
|
-
__Returns:__
|
2688
|
-
|
2689
|
-
[Array<UIAStaticText|XCUIElementTypeStaticText>]
|
2690
|
-
|
2691
|
-
--
|
2692
|
-
|
2693
|
-
##### [first_text](https://github.com/appium/ruby_lib/blob/95118d4e0a6ec285e55862ea6b6fed528711ad84/lib/appium_lib/ios/element/text.rb#L32) ios
|
2694
|
-
|
2695
|
-
> def first_text
|
2696
|
-
|
2697
|
-
Find the first UIAStaticText|XCUIElementTypeStaticText.
|
2698
|
-
|
2699
|
-
__Returns:__
|
2700
|
-
|
2701
|
-
[UIAStaticText|XCUIElementTypeStaticText]
|
1829
|
+
[void]
|
2702
1830
|
|
2703
1831
|
--
|
2704
1832
|
|
2705
|
-
##### [
|
2706
|
-
|
2707
|
-
> def last_text
|
1833
|
+
##### [_validate_object](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/ios/common/helper.rb#L397) ios
|
2708
1834
|
|
2709
|
-
|
1835
|
+
> def _validate_object(*objects)
|
2710
1836
|
|
2711
|
-
__Returns:__
|
2712
1837
|
|
2713
|
-
[UIAStaticText|XCUIElementTypeStaticText]
|
2714
1838
|
|
2715
1839
|
--
|
2716
1840
|
|
2717
|
-
##### [
|
1841
|
+
##### [_by_json](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/ios/common/helper.rb#L446) ios
|
2718
1842
|
|
2719
|
-
> def
|
1843
|
+
> def _by_json(opts)
|
2720
1844
|
|
2721
|
-
|
1845
|
+
For Appium(automation name), not XCUITest
|
1846
|
+
typeArray - array of string types to search for. Example: ["UIAStaticText"]
|
1847
|
+
onlyFirst - boolean. returns only the first result if true. Example: true
|
1848
|
+
onlyVisible - boolean. returns only visible elements if true. Example: true
|
1849
|
+
target - string. the target value to search for. Example: "Buttons, Various uses of UIButton"
|
1850
|
+
substring - boolean. matches on substrings if true otherwise an exact mathc is required. Example: true
|
1851
|
+
insensitive - boolean. ignores case sensitivity if true otherwise it's case sensitive. Example: true
|
2722
1852
|
|
2723
|
-
|
1853
|
+
opts = {
|
1854
|
+
typeArray: ["UIAStaticText"],
|
1855
|
+
onlyFirst: true,
|
1856
|
+
onlyVisible: true,
|
1857
|
+
name: {
|
1858
|
+
target: "Buttons, Various uses of UIButton",
|
1859
|
+
substring: false,
|
1860
|
+
insensitive: false,
|
1861
|
+
},
|
1862
|
+
label: {
|
1863
|
+
target: "Buttons, Various uses of UIButton",
|
1864
|
+
substring: false,
|
1865
|
+
insensitive: false,
|
1866
|
+
},
|
1867
|
+
value: {
|
1868
|
+
target: "Buttons, Various uses of UIButton",
|
1869
|
+
substring: false,
|
1870
|
+
insensitive: false,
|
1871
|
+
}
|
1872
|
+
}
|
2724
1873
|
|
2725
|
-
|
1874
|
+
--
|
2726
1875
|
|
2727
|
-
|
1876
|
+
##### [eles_by_json](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/ios/common/helper.rb#L496) ios
|
2728
1877
|
|
2729
|
-
|
1878
|
+
> def eles_by_json(opts)
|
1879
|
+
|
1880
|
+
For Appium(automation name), not XCUITest
|
1881
|
+
example usage:
|
1882
|
+
|
1883
|
+
eles_by_json({
|
1884
|
+
typeArray: ["UIAStaticText"],
|
1885
|
+
onlyVisible: true,
|
1886
|
+
name: {
|
1887
|
+
target: "Buttons, Various uses of UIButton",
|
1888
|
+
substring: false,
|
1889
|
+
insensitive: false,
|
1890
|
+
},
|
1891
|
+
})
|
2730
1892
|
|
2731
1893
|
--
|
2732
1894
|
|
2733
|
-
##### [
|
1895
|
+
##### [ele_by_json](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/ios/common/helper.rb#L502) ios
|
2734
1896
|
|
2735
|
-
> def
|
1897
|
+
> def ele_by_json(opts)
|
2736
1898
|
|
2737
|
-
|
1899
|
+
see eles_by_json
|
2738
1900
|
|
2739
|
-
|
1901
|
+
--
|
2740
1902
|
|
2741
|
-
|
1903
|
+
##### [get_source](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/ios/common/helper.rb#L512) ios
|
1904
|
+
|
1905
|
+
> def get_source
|
1906
|
+
|
1907
|
+
Returns XML string for the current page
|
1908
|
+
Same as driver.page_source
|
2742
1909
|
|
2743
1910
|
__Returns:__
|
2744
1911
|
|
2745
|
-
[
|
1912
|
+
[String]
|
2746
1913
|
|
2747
1914
|
--
|
2748
1915
|
|
2749
|
-
##### [alert_accept](https://github.com/appium/ruby_lib/blob/
|
1916
|
+
##### [alert_accept](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/ios/element/alert.rb#L5) ios
|
2750
1917
|
|
2751
1918
|
> def alert_accept
|
2752
1919
|
|
@@ -2758,7 +1925,7 @@ __Returns:__
|
|
2758
1925
|
|
2759
1926
|
--
|
2760
1927
|
|
2761
|
-
##### [alert_dismiss](https://github.com/appium/ruby_lib/blob/
|
1928
|
+
##### [alert_dismiss](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/ios/element/alert.rb#L13) ios
|
2762
1929
|
|
2763
1930
|
> def alert_dismiss
|
2764
1931
|
|
@@ -2770,7 +1937,7 @@ __Returns:__
|
|
2770
1937
|
|
2771
1938
|
--
|
2772
1939
|
|
2773
|
-
##### [UIAButton](https://github.com/appium/ruby_lib/blob/
|
1940
|
+
##### [UIAButton](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/ios/element/button.rb#L4) ios
|
2774
1941
|
|
2775
1942
|
> UIAButton = 'UIAButton'.freeze
|
2776
1943
|
|
@@ -2778,7 +1945,7 @@ __Returns:__
|
|
2778
1945
|
|
2779
1946
|
--
|
2780
1947
|
|
2781
|
-
##### [XCUIElementTypeButton](https://github.com/appium/ruby_lib/blob/
|
1948
|
+
##### [XCUIElementTypeButton](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/ios/element/button.rb#L5) ios
|
2782
1949
|
|
2783
1950
|
> XCUIElementTypeButton = 'XCUIElementTypeButton'.freeze
|
2784
1951
|
|
@@ -2786,7 +1953,7 @@ __Returns:__
|
|
2786
1953
|
|
2787
1954
|
--
|
2788
1955
|
|
2789
|
-
##### [button_class](https://github.com/appium/ruby_lib/blob/
|
1956
|
+
##### [button_class](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/ios/element/button.rb#L8) ios
|
2790
1957
|
|
2791
1958
|
> def button_class
|
2792
1959
|
|
@@ -2798,7 +1965,7 @@ __Returns:__
|
|
2798
1965
|
|
2799
1966
|
--
|
2800
1967
|
|
2801
|
-
##### [button](https://github.com/appium/ruby_lib/blob/
|
1968
|
+
##### [button](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/ios/element/button.rb#L16) ios
|
2802
1969
|
|
2803
1970
|
> def button(value)
|
2804
1971
|
|
@@ -2815,7 +1982,7 @@ __Returns:__
|
|
2815
1982
|
|
2816
1983
|
--
|
2817
1984
|
|
2818
|
-
##### [buttons](https://github.com/appium/ruby_lib/blob/
|
1985
|
+
##### [buttons](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/ios/element/button.rb#L26) ios
|
2819
1986
|
|
2820
1987
|
> def buttons(value = false)
|
2821
1988
|
|
@@ -2832,7 +1999,7 @@ __Returns:__
|
|
2832
1999
|
|
2833
2000
|
--
|
2834
2001
|
|
2835
|
-
##### [first_button](https://github.com/appium/ruby_lib/blob/
|
2002
|
+
##### [first_button](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/ios/element/button.rb#L33) ios
|
2836
2003
|
|
2837
2004
|
> def first_button
|
2838
2005
|
|
@@ -2844,7 +2011,7 @@ __Returns:__
|
|
2844
2011
|
|
2845
2012
|
--
|
2846
2013
|
|
2847
|
-
##### [last_button](https://github.com/appium/ruby_lib/blob/
|
2014
|
+
##### [last_button](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/ios/element/button.rb#L41) ios
|
2848
2015
|
|
2849
2016
|
> def last_button
|
2850
2017
|
|
@@ -2858,7 +2025,7 @@ __Returns:__
|
|
2858
2025
|
|
2859
2026
|
--
|
2860
2027
|
|
2861
|
-
##### [button_exact](https://github.com/appium/ruby_lib/blob/
|
2028
|
+
##### [button_exact](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/ios/element/button.rb#L48) ios
|
2862
2029
|
|
2863
2030
|
> def button_exact(value)
|
2864
2031
|
|
@@ -2874,7 +2041,7 @@ __Returns:__
|
|
2874
2041
|
|
2875
2042
|
--
|
2876
2043
|
|
2877
|
-
##### [buttons_exact](https://github.com/appium/ruby_lib/blob/
|
2044
|
+
##### [buttons_exact](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/ios/element/button.rb#L55) ios
|
2878
2045
|
|
2879
2046
|
> def buttons_exact(value)
|
2880
2047
|
|
@@ -2890,33 +2057,7 @@ __Returns:__
|
|
2890
2057
|
|
2891
2058
|
--
|
2892
2059
|
|
2893
|
-
##### [
|
2894
|
-
|
2895
|
-
> def uiautomation_find
|
2896
|
-
|
2897
|
-
find_element/s can be used with a [UIAutomation command](https://developer.apple.com/library/ios/documentation/ToolsLanguages/Reference/UIAWindowClassReference/UIAWindow/UIAWindow.html#//apple_ref/doc/uid/TP40009930).
|
2898
|
-
|
2899
|
-
```ruby
|
2900
|
-
find_elements :uiautomation, 'elements()
|
2901
|
-
```
|
2902
|
-
|
2903
|
-
--
|
2904
|
-
|
2905
|
-
##### [ios_predicate_string_find](https://github.com/appium/ruby_lib/blob/95118d4e0a6ec285e55862ea6b6fed528711ad84/lib/appium_lib/ios/mobile_methods.rb#L19) ios
|
2906
|
-
|
2907
|
-
> def ios_predicate_string_find
|
2908
|
-
|
2909
|
-
find_element/s can be used with a [Predicates](https://developer.apple.com/library/content/documentation/Cocoa/Conceptual/Predicates/AdditionalChapters/Introduction.html)
|
2910
|
-
|
2911
|
-
```ruby
|
2912
|
-
find_elements :predicate, "isWDVisible == 1"
|
2913
|
-
find_elements :predicate, 'wdName == "Buttons"'
|
2914
|
-
find_elements :predicate, 'wdValue == "SearchBar" AND isWDDivisible == 1'
|
2915
|
-
```
|
2916
|
-
|
2917
|
-
--
|
2918
|
-
|
2919
|
-
##### [find](https://github.com/appium/ruby_lib/blob/95118d4e0a6ec285e55862ea6b6fed528711ad84/lib/appium_lib/ios/element/generic.rb#L6) ios
|
2060
|
+
##### [find](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/ios/element/generic.rb#L6) ios
|
2920
2061
|
|
2921
2062
|
> def find(value)
|
2922
2063
|
|
@@ -2932,7 +2073,7 @@ __Returns:__
|
|
2932
2073
|
|
2933
2074
|
--
|
2934
2075
|
|
2935
|
-
##### [finds](https://github.com/appium/ruby_lib/blob/
|
2076
|
+
##### [finds](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/ios/element/generic.rb#L13) ios
|
2936
2077
|
|
2937
2078
|
> def finds(value)
|
2938
2079
|
|
@@ -2948,7 +2089,7 @@ __Returns:__
|
|
2948
2089
|
|
2949
2090
|
--
|
2950
2091
|
|
2951
|
-
##### [find_exact](https://github.com/appium/ruby_lib/blob/
|
2092
|
+
##### [find_exact](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/ios/element/generic.rb#L20) ios
|
2952
2093
|
|
2953
2094
|
> def find_exact(value)
|
2954
2095
|
|
@@ -2964,7 +2105,7 @@ __Returns:__
|
|
2964
2105
|
|
2965
2106
|
--
|
2966
2107
|
|
2967
|
-
##### [finds_exact](https://github.com/appium/ruby_lib/blob/
|
2108
|
+
##### [finds_exact](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/ios/element/generic.rb#L27) ios
|
2968
2109
|
|
2969
2110
|
> def finds_exact(value)
|
2970
2111
|
|
@@ -2980,7 +2121,7 @@ __Returns:__
|
|
2980
2121
|
|
2981
2122
|
--
|
2982
2123
|
|
2983
|
-
##### [raise_error_if_no_element](https://github.com/appium/ruby_lib/blob/
|
2124
|
+
##### [raise_error_if_no_element](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/ios/element/generic.rb#L33) ios
|
2984
2125
|
|
2985
2126
|
> def raise_error_if_no_element(element)
|
2986
2127
|
|
@@ -2988,7 +2129,7 @@ __Returns:__
|
|
2988
2129
|
|
2989
2130
|
--
|
2990
2131
|
|
2991
|
-
##### [select_visible_elements](https://github.com/appium/ruby_lib/blob/
|
2132
|
+
##### [select_visible_elements](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/ios/element/generic.rb#L40) ios
|
2992
2133
|
|
2993
2134
|
> def select_visible_elements(elements)
|
2994
2135
|
|
@@ -2996,35 +2137,15 @@ Return visible elements.
|
|
2996
2137
|
|
2997
2138
|
--
|
2998
2139
|
|
2999
|
-
##### [
|
3000
|
-
|
3001
|
-
> def hide_keyboard
|
3002
|
-
|
3003
|
-
Hide the onscreen keyboard
|
3004
|
-
|
3005
|
-
__Parameters:__
|
3006
|
-
|
3007
|
-
[String] close_key - The name of the key which closes the keyboard.
|
3008
|
-
|
3009
|
-
[Symbol] strategy - The symbol of the strategy which closes the keyboard.
|
3010
|
-
XCUITest ignore this argument.
|
3011
|
-
Default for iOS is `:pressKey`. Default for Android is `:tapOutside`.
|
3012
|
-
|
3013
|
-
--
|
3014
|
-
|
3015
|
-
##### [ios_version](https://github.com/appium/ruby_lib/blob/95118d4e0a6ec285e55862ea6b6fed528711ad84/lib/appium_lib/ios/xcuitest/helper.rb#L7) ios
|
2140
|
+
##### [for](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/ios/xcuitest/bridge.rb#L7) ios
|
3016
2141
|
|
3017
|
-
> def
|
2142
|
+
> def self.for(target)
|
3018
2143
|
|
3019
|
-
Return the iOS version as an array of integers
|
3020
2144
|
|
3021
|
-
__Returns:__
|
3022
|
-
|
3023
|
-
[Array<Integer>]
|
3024
2145
|
|
3025
2146
|
--
|
3026
2147
|
|
3027
|
-
##### [last_ele](https://github.com/appium/ruby_lib/blob/
|
2148
|
+
##### [last_ele](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/ios/xcuitest/helper.rb#L26) ios
|
3028
2149
|
|
3029
2150
|
> def last_ele(class_name)
|
3030
2151
|
|
@@ -3040,7 +2161,7 @@ __Returns:__
|
|
3040
2161
|
|
3041
2162
|
--
|
3042
2163
|
|
3043
|
-
##### [tag](https://github.com/appium/ruby_lib/blob/
|
2164
|
+
##### [tag](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/ios/xcuitest/helper.rb#L36) ios
|
3044
2165
|
|
3045
2166
|
> def tag(class_name)
|
3046
2167
|
|
@@ -3056,7 +2177,7 @@ __Returns:__
|
|
3056
2177
|
|
3057
2178
|
--
|
3058
2179
|
|
3059
|
-
##### [tags](https://github.com/appium/ruby_lib/blob/
|
2180
|
+
##### [tags](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/ios/xcuitest/helper.rb#L44) ios
|
3060
2181
|
|
3061
2182
|
> def tags(class_name)
|
3062
2183
|
|
@@ -3072,7 +2193,7 @@ __Returns:__
|
|
3072
2193
|
|
3073
2194
|
--
|
3074
2195
|
|
3075
|
-
##### [tags_include](https://github.com/appium/ruby_lib/blob/
|
2196
|
+
##### [tags_include](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/ios/xcuitest/helper.rb#L56) ios
|
3076
2197
|
|
3077
2198
|
> def tags_include(class_names:, value: nil)
|
3078
2199
|
|
@@ -3092,7 +2213,7 @@ __Returns:__
|
|
3092
2213
|
|
3093
2214
|
--
|
3094
2215
|
|
3095
|
-
##### [tags_exact](https://github.com/appium/ruby_lib/blob/
|
2216
|
+
##### [tags_exact](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/ios/xcuitest/helper.rb#L79) ios
|
3096
2217
|
|
3097
2218
|
> def tags_exact(class_names:, value: nil)
|
3098
2219
|
|
@@ -3112,7 +2233,7 @@ __Returns:__
|
|
3112
2233
|
|
3113
2234
|
--
|
3114
2235
|
|
3115
|
-
##### [UIATextField](https://github.com/appium/ruby_lib/blob/
|
2236
|
+
##### [UIATextField](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/ios/element/textfield.rb#L3) ios
|
3116
2237
|
|
3117
2238
|
> UIATextField = 'UIATextField'.freeze
|
3118
2239
|
|
@@ -3120,7 +2241,7 @@ __Returns:__
|
|
3120
2241
|
|
3121
2242
|
--
|
3122
2243
|
|
3123
|
-
##### [UIASecureTextField](https://github.com/appium/ruby_lib/blob/
|
2244
|
+
##### [UIASecureTextField](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/ios/element/textfield.rb#L4) ios
|
3124
2245
|
|
3125
2246
|
> UIASecureTextField = 'UIASecureTextField'.freeze
|
3126
2247
|
|
@@ -3128,7 +2249,7 @@ __Returns:__
|
|
3128
2249
|
|
3129
2250
|
--
|
3130
2251
|
|
3131
|
-
##### [XCUIElementTypeTextField](https://github.com/appium/ruby_lib/blob/
|
2252
|
+
##### [XCUIElementTypeTextField](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/ios/element/textfield.rb#L6) ios
|
3132
2253
|
|
3133
2254
|
> XCUIElementTypeTextField = 'XCUIElementTypeTextField'.freeze
|
3134
2255
|
|
@@ -3136,7 +2257,7 @@ __Returns:__
|
|
3136
2257
|
|
3137
2258
|
--
|
3138
2259
|
|
3139
|
-
##### [XCUIElementTypeSecureTextField](https://github.com/appium/ruby_lib/blob/
|
2260
|
+
##### [XCUIElementTypeSecureTextField](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/ios/element/textfield.rb#L7) ios
|
3140
2261
|
|
3141
2262
|
> XCUIElementTypeSecureTextField = 'XCUIElementTypeSecureTextField'.freeze
|
3142
2263
|
|
@@ -3144,7 +2265,7 @@ __Returns:__
|
|
3144
2265
|
|
3145
2266
|
--
|
3146
2267
|
|
3147
|
-
##### [text_field_class](https://github.com/appium/ruby_lib/blob/
|
2268
|
+
##### [text_field_class](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/ios/element/textfield.rb#L10) ios
|
3148
2269
|
|
3149
2270
|
> def text_field_class
|
3150
2271
|
|
@@ -3156,7 +2277,7 @@ __Returns:__
|
|
3156
2277
|
|
3157
2278
|
--
|
3158
2279
|
|
3159
|
-
##### [secure_text_field_class](https://github.com/appium/ruby_lib/blob/
|
2280
|
+
##### [secure_text_field_class](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/ios/element/textfield.rb#L15) ios
|
3160
2281
|
|
3161
2282
|
> def secure_text_field_class
|
3162
2283
|
|
@@ -3168,7 +2289,7 @@ __Returns:__
|
|
3168
2289
|
|
3169
2290
|
--
|
3170
2291
|
|
3171
|
-
##### [textfield](https://github.com/appium/ruby_lib/blob/
|
2292
|
+
##### [textfield](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/ios/element/textfield.rb#L24) ios
|
3172
2293
|
|
3173
2294
|
> def textfield(value)
|
3174
2295
|
|
@@ -3186,7 +2307,7 @@ __Returns:__
|
|
3186
2307
|
|
3187
2308
|
--
|
3188
2309
|
|
3189
|
-
##### [textfields](https://github.com/appium/ruby_lib/blob/
|
2310
|
+
##### [textfields](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/ios/element/textfield.rb#L42) ios
|
3190
2311
|
|
3191
2312
|
> def textfields(value = false)
|
3192
2313
|
|
@@ -3203,252 +2324,87 @@ __Returns:__
|
|
3203
2324
|
|
3204
2325
|
--
|
3205
2326
|
|
3206
|
-
##### [first_textfield](https://github.com/appium/ruby_lib/blob/
|
3207
|
-
|
3208
|
-
> def first_textfield
|
3209
|
-
|
3210
|
-
Find the first TextField.
|
3211
|
-
|
3212
|
-
__Returns:__
|
3213
|
-
|
3214
|
-
[TextField]
|
3215
|
-
|
3216
|
-
--
|
3217
|
-
|
3218
|
-
##### [last_textfield](https://github.com/appium/ruby_lib/blob/95118d4e0a6ec285e55862ea6b6fed528711ad84/lib/appium_lib/ios/element/textfield.rb#L55) ios
|
3219
|
-
|
3220
|
-
> def last_textfield
|
3221
|
-
|
3222
|
-
Find the last TextField.
|
3223
|
-
|
3224
|
-
__Returns:__
|
3225
|
-
|
3226
|
-
[TextField]
|
3227
|
-
|
3228
|
-
--
|
3229
|
-
|
3230
|
-
##### [textfield_exact](https://github.com/appium/ruby_lib/blob/95118d4e0a6ec285e55862ea6b6fed528711ad84/lib/appium_lib/ios/element/textfield.rb#L64) ios
|
3231
|
-
|
3232
|
-
> def textfield_exact(value)
|
3233
|
-
|
3234
|
-
Find the first TextField that exactly matches value.
|
3235
|
-
|
3236
|
-
__Parameters:__
|
3237
|
-
|
3238
|
-
[String] value - the value to match exactly
|
3239
|
-
|
3240
|
-
__Returns:__
|
3241
|
-
|
3242
|
-
[TextField]
|
3243
|
-
|
3244
|
-
--
|
3245
|
-
|
3246
|
-
##### [textfields_exact](https://github.com/appium/ruby_lib/blob/95118d4e0a6ec285e55862ea6b6fed528711ad84/lib/appium_lib/ios/element/textfield.rb#L71) ios
|
3247
|
-
|
3248
|
-
> def textfields_exact(value)
|
3249
|
-
|
3250
|
-
Find all TextFields that exactly match value.
|
3251
|
-
|
3252
|
-
__Parameters:__
|
3253
|
-
|
3254
|
-
[String] value - the value to match exactly
|
3255
|
-
|
3256
|
-
__Returns:__
|
3257
|
-
|
3258
|
-
[Array<TextField>]
|
3259
|
-
|
3260
|
-
--
|
3261
|
-
|
3262
|
-
##### [_textfield_visible](https://github.com/appium/ruby_lib/blob/95118d4e0a6ec285e55862ea6b6fed528711ad84/lib/appium_lib/ios/element/textfield.rb#L78) ios
|
3263
|
-
|
3264
|
-
> def _textfield_visible
|
3265
|
-
|
3266
|
-
Appium
|
3267
|
-
|
3268
|
-
--
|
3269
|
-
|
3270
|
-
##### [_textfield_exact_string](https://github.com/appium/ruby_lib/blob/95118d4e0a6ec285e55862ea6b6fed528711ad84/lib/appium_lib/ios/element/textfield.rb#L83) ios
|
3271
|
-
|
3272
|
-
> def _textfield_exact_string(value)
|
3273
|
-
|
3274
|
-
Appium
|
3275
|
-
|
3276
|
-
--
|
3277
|
-
|
3278
|
-
##### [_textfield_contains_string](https://github.com/appium/ruby_lib/blob/95118d4e0a6ec285e55862ea6b6fed528711ad84/lib/appium_lib/ios/element/textfield.rb#L90) ios
|
3279
|
-
|
3280
|
-
> def _textfield_contains_string(value)
|
3281
|
-
|
3282
|
-
Appium
|
3283
|
-
|
3284
|
-
--
|
3285
|
-
|
3286
|
-
##### [swipe](https://github.com/appium/ruby_lib/blob/95118d4e0a6ec285e55862ea6b6fed528711ad84/lib/appium_lib/ios/xcuitest/gestures.rb#L11) ios
|
3287
|
-
|
3288
|
-
> def swipe(direction:, element: nil)
|
3289
|
-
|
3290
|
-
|
3291
|
-
|
3292
|
-
__Parameters:__
|
3293
|
-
|
3294
|
-
[string] direction - Either 'up', 'down', 'left' or 'right'.
|
3295
|
-
|
3296
|
-
[Hash] opts - a customizable set of options
|
3297
|
-
|
3298
|
-
--
|
3299
|
-
|
3300
|
-
##### [scroll](https://github.com/appium/ruby_lib/blob/95118d4e0a6ec285e55862ea6b6fed528711ad84/lib/appium_lib/ios/xcuitest/gestures.rb#L29) ios
|
3301
|
-
|
3302
|
-
> def scroll(direction:, name: nil, element: nil, to_visible: nil, predicate_string: nil)
|
3303
|
-
|
3304
|
-
|
3305
|
-
|
3306
|
-
__Parameters:__
|
3307
|
-
|
3308
|
-
[string] direction - Either 'up', 'down', 'left' or 'right'.
|
3309
|
-
|
3310
|
-
[Hash] opts - a customizable set of options
|
3311
|
-
|
3312
|
-
--
|
3313
|
-
|
3314
|
-
##### [pinch](https://github.com/appium/ruby_lib/blob/95118d4e0a6ec285e55862ea6b6fed528711ad84/lib/appium_lib/ios/xcuitest/gestures.rb#L48) ios
|
3315
|
-
|
3316
|
-
> def pinch(scale:, velocity: 1.0, element: nil)
|
3317
|
-
|
3318
|
-
|
3319
|
-
|
3320
|
-
__Parameters:__
|
3321
|
-
|
3322
|
-
[scale] scale - X tap coordinate of type float. Mandatory parameter
|
3323
|
-
|
3324
|
-
[float] velocity - Y tap coordinate of type float. Mandatory parameter
|
3325
|
-
|
3326
|
-
[Hash] opts - a customizable set of options
|
3327
|
-
|
3328
|
-
--
|
3329
|
-
|
3330
|
-
##### [double_tap](https://github.com/appium/ruby_lib/blob/95118d4e0a6ec285e55862ea6b6fed528711ad84/lib/appium_lib/ios/xcuitest/gestures.rb#L63) ios
|
3331
|
-
|
3332
|
-
> def double_tap(x: nil, y: nil, element: nil)
|
3333
|
-
|
3334
|
-
|
3335
|
-
|
3336
|
-
__Parameters:__
|
3337
|
-
|
3338
|
-
[float] x - X Screen x tap coordinate of type float. Mandatory parameter only if element is not set
|
3339
|
-
|
3340
|
-
[float] y - Y Screen y tap coordinate of type float. Mandatory parameter only if element is not set
|
3341
|
-
|
3342
|
-
[Hash] opts - a customizable set of options
|
3343
|
-
|
3344
|
-
--
|
3345
|
-
|
3346
|
-
##### [touch_and_hold](https://github.com/appium/ruby_lib/blob/95118d4e0a6ec285e55862ea6b6fed528711ad84/lib/appium_lib/ios/xcuitest/gestures.rb#L80) ios
|
3347
|
-
|
3348
|
-
> def touch_and_hold(x: nil, y: nil, element: nil, duration: 1.0)
|
3349
|
-
|
3350
|
-
|
3351
|
-
|
3352
|
-
__Parameters:__
|
3353
|
-
|
3354
|
-
[float] x - Screen x long tap coordinate of type float. Mandatory parameter only if element is not set
|
3355
|
-
|
3356
|
-
[float] y - Screen y long tap coordinate of type float. Mandatory parameter only if element is not set
|
3357
|
-
|
3358
|
-
[Float] duration - The float duration of press action in seconds. Mandatory parameter
|
3359
|
-
|
3360
|
-
[Hash] opts - a customizable set of options
|
3361
|
-
|
3362
|
-
--
|
3363
|
-
|
3364
|
-
##### [two_finger_tap](https://github.com/appium/ruby_lib/blob/95118d4e0a6ec285e55862ea6b6fed528711ad84/lib/appium_lib/ios/xcuitest/gestures.rb#L93) ios
|
3365
|
-
|
3366
|
-
> def two_finger_tap(element:)
|
3367
|
-
|
3368
|
-
|
3369
|
-
|
3370
|
-
__Parameters:__
|
3371
|
-
|
3372
|
-
[Element] :element - Element to long tap on.
|
3373
|
-
|
3374
|
-
```ruby
|
3375
|
-
two_finger_tap element: find_element(:accessibility_id, "some item")
|
3376
|
-
```
|
2327
|
+
##### [first_textfield](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/ios/element/textfield.rb#L49) ios
|
3377
2328
|
|
3378
|
-
|
2329
|
+
> def first_textfield
|
3379
2330
|
|
3380
|
-
|
2331
|
+
Find the first TextField.
|
3381
2332
|
|
3382
|
-
|
2333
|
+
__Returns:__
|
3383
2334
|
|
2335
|
+
[TextField]
|
3384
2336
|
|
2337
|
+
--
|
3385
2338
|
|
3386
|
-
|
2339
|
+
##### [last_textfield](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/ios/element/textfield.rb#L55) ios
|
3387
2340
|
|
3388
|
-
|
2341
|
+
> def last_textfield
|
3389
2342
|
|
3390
|
-
|
2343
|
+
Find the last TextField.
|
3391
2344
|
|
3392
|
-
|
2345
|
+
__Returns:__
|
2346
|
+
|
2347
|
+
[TextField]
|
3393
2348
|
|
3394
2349
|
--
|
3395
2350
|
|
3396
|
-
##### [
|
2351
|
+
##### [textfield_exact](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/ios/element/textfield.rb#L64) ios
|
3397
2352
|
|
3398
|
-
> def
|
2353
|
+
> def textfield_exact(value)
|
3399
2354
|
|
3400
|
-
|
2355
|
+
Find the first TextField that exactly matches value.
|
3401
2356
|
|
3402
2357
|
__Parameters:__
|
3403
2358
|
|
3404
|
-
[
|
3405
|
-
drag point should be before to start dragging. Mandatory parameter
|
2359
|
+
[String] value - the value to match exactly
|
3406
2360
|
|
3407
|
-
|
2361
|
+
__Returns:__
|
3408
2362
|
|
3409
|
-
[
|
2363
|
+
[TextField]
|
3410
2364
|
|
3411
|
-
|
2365
|
+
--
|
3412
2366
|
|
3413
|
-
|
2367
|
+
##### [textfields_exact](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/ios/element/textfield.rb#L71) ios
|
3414
2368
|
|
3415
|
-
|
2369
|
+
> def textfields_exact(value)
|
3416
2370
|
|
3417
|
-
|
2371
|
+
Find all TextFields that exactly match value.
|
3418
2372
|
|
3419
|
-
|
2373
|
+
__Parameters:__
|
3420
2374
|
|
3421
|
-
|
2375
|
+
[String] value - the value to match exactly
|
3422
2376
|
|
3423
|
-
|
3424
|
-
https://github.com/appium/appium-xcuitest-driver/pull/420
|
2377
|
+
__Returns:__
|
3425
2378
|
|
3426
|
-
|
2379
|
+
[Array<TextField>]
|
3427
2380
|
|
3428
|
-
|
2381
|
+
--
|
3429
2382
|
|
3430
|
-
|
2383
|
+
##### [_textfield_visible](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/ios/element/textfield.rb#L78) ios
|
3431
2384
|
|
3432
|
-
|
2385
|
+
> def _textfield_visible
|
2386
|
+
|
2387
|
+
Appium
|
3433
2388
|
|
3434
2389
|
--
|
3435
2390
|
|
3436
|
-
##### [
|
2391
|
+
##### [_textfield_exact_string](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/ios/element/textfield.rb#L83) ios
|
3437
2392
|
|
3438
|
-
> def
|
2393
|
+
> def _textfield_exact_string(value)
|
3439
2394
|
|
2395
|
+
Appium
|
3440
2396
|
|
2397
|
+
--
|
3441
2398
|
|
3442
|
-
|
2399
|
+
##### [_textfield_contains_string](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/ios/element/textfield.rb#L90) ios
|
3443
2400
|
|
3444
|
-
|
2401
|
+
> def _textfield_contains_string(value)
|
3445
2402
|
|
3446
|
-
|
3447
|
-
This is an optional parameter and is only valid in combination with accept and dismiss actions.
|
2403
|
+
Appium
|
3448
2404
|
|
3449
2405
|
--
|
3450
2406
|
|
3451
|
-
##### [static_text_class](https://github.com/appium/ruby_lib/blob/
|
2407
|
+
##### [static_text_class](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/ios/xcuitest/element/text.rb#L9) ios
|
3452
2408
|
|
3453
2409
|
> def static_text_class
|
3454
2410
|
|
@@ -3460,7 +2416,7 @@ __Returns:__
|
|
3460
2416
|
|
3461
2417
|
--
|
3462
2418
|
|
3463
|
-
##### [text](https://github.com/appium/ruby_lib/blob/
|
2419
|
+
##### [text](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/ios/xcuitest/element/text.rb#L17) ios
|
3464
2420
|
|
3465
2421
|
> def text(value)
|
3466
2422
|
|
@@ -3477,7 +2433,7 @@ __Returns:__
|
|
3477
2433
|
|
3478
2434
|
--
|
3479
2435
|
|
3480
|
-
##### [texts](https://github.com/appium/ruby_lib/blob/
|
2436
|
+
##### [texts](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/ios/xcuitest/element/text.rb#L26) ios
|
3481
2437
|
|
3482
2438
|
> def texts(value = false)
|
3483
2439
|
|
@@ -3494,7 +2450,7 @@ __Returns:__
|
|
3494
2450
|
|
3495
2451
|
--
|
3496
2452
|
|
3497
|
-
##### [first_text](https://github.com/appium/ruby_lib/blob/
|
2453
|
+
##### [first_text](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/ios/xcuitest/element/text.rb#L34) ios
|
3498
2454
|
|
3499
2455
|
> def first_text
|
3500
2456
|
|
@@ -3506,7 +2462,7 @@ __Returns:__
|
|
3506
2462
|
|
3507
2463
|
--
|
3508
2464
|
|
3509
|
-
##### [last_text](https://github.com/appium/ruby_lib/blob/
|
2465
|
+
##### [last_text](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/ios/xcuitest/element/text.rb#L40) ios
|
3510
2466
|
|
3511
2467
|
> def last_text
|
3512
2468
|
|
@@ -3518,7 +2474,7 @@ __Returns:__
|
|
3518
2474
|
|
3519
2475
|
--
|
3520
2476
|
|
3521
|
-
##### [text_exact](https://github.com/appium/ruby_lib/blob/
|
2477
|
+
##### [text_exact](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/ios/xcuitest/element/text.rb#L47) ios
|
3522
2478
|
|
3523
2479
|
> def text_exact(value)
|
3524
2480
|
|
@@ -3534,7 +2490,7 @@ __Returns:__
|
|
3534
2490
|
|
3535
2491
|
--
|
3536
2492
|
|
3537
|
-
##### [texts_exact](https://github.com/appium/ruby_lib/blob/
|
2493
|
+
##### [texts_exact](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/ios/xcuitest/element/text.rb#L54) ios
|
3538
2494
|
|
3539
2495
|
> def texts_exact(value)
|
3540
2496
|
|
@@ -3550,7 +2506,7 @@ __Returns:__
|
|
3550
2506
|
|
3551
2507
|
--
|
3552
2508
|
|
3553
|
-
##### [button_class](https://github.com/appium/ruby_lib/blob/
|
2509
|
+
##### [button_class](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/ios/xcuitest/element/button.rb#L9) ios
|
3554
2510
|
|
3555
2511
|
> def button_class
|
3556
2512
|
|
@@ -3562,7 +2518,7 @@ __Returns:__
|
|
3562
2518
|
|
3563
2519
|
--
|
3564
2520
|
|
3565
|
-
##### [button](https://github.com/appium/ruby_lib/blob/
|
2521
|
+
##### [button](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/ios/xcuitest/element/button.rb#L17) ios
|
3566
2522
|
|
3567
2523
|
> def button(value)
|
3568
2524
|
|
@@ -3579,7 +2535,7 @@ __Returns:__
|
|
3579
2535
|
|
3580
2536
|
--
|
3581
2537
|
|
3582
|
-
##### [buttons](https://github.com/appium/ruby_lib/blob/
|
2538
|
+
##### [buttons](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/ios/xcuitest/element/button.rb#L27) ios
|
3583
2539
|
|
3584
2540
|
> def buttons(value = false)
|
3585
2541
|
|
@@ -3596,7 +2552,7 @@ __Returns:__
|
|
3596
2552
|
|
3597
2553
|
--
|
3598
2554
|
|
3599
|
-
##### [first_button](https://github.com/appium/ruby_lib/blob/
|
2555
|
+
##### [first_button](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/ios/xcuitest/element/button.rb#L35) ios
|
3600
2556
|
|
3601
2557
|
> def first_button
|
3602
2558
|
|
@@ -3608,7 +2564,7 @@ __Returns:__
|
|
3608
2564
|
|
3609
2565
|
--
|
3610
2566
|
|
3611
|
-
##### [last_button](https://github.com/appium/ruby_lib/blob/
|
2567
|
+
##### [last_button](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/ios/xcuitest/element/button.rb#L43) ios
|
3612
2568
|
|
3613
2569
|
> def last_button
|
3614
2570
|
|
@@ -3622,7 +2578,7 @@ __Returns:__
|
|
3622
2578
|
|
3623
2579
|
--
|
3624
2580
|
|
3625
|
-
##### [button_exact](https://github.com/appium/ruby_lib/blob/
|
2581
|
+
##### [button_exact](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/ios/xcuitest/element/button.rb#L50) ios
|
3626
2582
|
|
3627
2583
|
> def button_exact(value)
|
3628
2584
|
|
@@ -3638,7 +2594,7 @@ __Returns:__
|
|
3638
2594
|
|
3639
2595
|
--
|
3640
2596
|
|
3641
|
-
##### [buttons_exact](https://github.com/appium/ruby_lib/blob/
|
2597
|
+
##### [buttons_exact](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/ios/xcuitest/element/button.rb#L57) ios
|
3642
2598
|
|
3643
2599
|
> def buttons_exact(value)
|
3644
2600
|
|
@@ -3654,25 +2610,7 @@ __Returns:__
|
|
3654
2610
|
|
3655
2611
|
--
|
3656
2612
|
|
3657
|
-
##### [
|
3658
|
-
|
3659
|
-
> def ios_class_chain_find
|
3660
|
-
|
3661
|
-
Only for XCUITest(WebDriverAgent)
|
3662
|
-
find_element/s can be used with a [class chain]( https://github.com/facebook/WebDriverAgent/wiki/Queries)
|
3663
|
-
|
3664
|
-
```ruby
|
3665
|
-
# select the third child button of the first child window element
|
3666
|
-
find_elements :class_chain, 'XCUIElementTypeWindow/XCUIElementTypeButton[3]'
|
3667
|
-
# select all the children windows
|
3668
|
-
find_elements :class_chain, 'XCUIElementTypeWindow'
|
3669
|
-
# select the second last child of the second child window
|
3670
|
-
find_elements :class_chain, 'XCUIElementTypeWindow[2]/XCUIElementTypeAny[-2]'
|
3671
|
-
```
|
3672
|
-
|
3673
|
-
--
|
3674
|
-
|
3675
|
-
##### [find](https://github.com/appium/ruby_lib/blob/95118d4e0a6ec285e55862ea6b6fed528711ad84/lib/appium_lib/ios/xcuitest/element/generic.rb#L8) ios
|
2613
|
+
##### [find](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/ios/xcuitest/element/generic.rb#L8) ios
|
3676
2614
|
|
3677
2615
|
> def find(value)
|
3678
2616
|
|
@@ -3688,7 +2626,7 @@ __Returns:__
|
|
3688
2626
|
|
3689
2627
|
--
|
3690
2628
|
|
3691
|
-
##### [finds](https://github.com/appium/ruby_lib/blob/
|
2629
|
+
##### [finds](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/ios/xcuitest/element/generic.rb#L15) ios
|
3692
2630
|
|
3693
2631
|
> def finds(value)
|
3694
2632
|
|
@@ -3704,7 +2642,7 @@ __Returns:__
|
|
3704
2642
|
|
3705
2643
|
--
|
3706
2644
|
|
3707
|
-
##### [find_exact](https://github.com/appium/ruby_lib/blob/
|
2645
|
+
##### [find_exact](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/ios/xcuitest/element/generic.rb#L23) ios
|
3708
2646
|
|
3709
2647
|
> def find_exact(value)
|
3710
2648
|
|
@@ -3720,7 +2658,7 @@ __Returns:__
|
|
3720
2658
|
|
3721
2659
|
--
|
3722
2660
|
|
3723
|
-
##### [finds_exact](https://github.com/appium/ruby_lib/blob/
|
2661
|
+
##### [finds_exact](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/ios/xcuitest/element/generic.rb#L30) ios
|
3724
2662
|
|
3725
2663
|
> def finds_exact(value)
|
3726
2664
|
|
@@ -3736,7 +2674,7 @@ __Returns:__
|
|
3736
2674
|
|
3737
2675
|
--
|
3738
2676
|
|
3739
|
-
##### [raise_error_if_no_element](https://github.com/appium/ruby_lib/blob/
|
2677
|
+
##### [raise_error_if_no_element](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/ios/xcuitest/element/generic.rb#L37) ios
|
3740
2678
|
|
3741
2679
|
> def raise_error_if_no_element(element)
|
3742
2680
|
|
@@ -3744,7 +2682,7 @@ __Returns:__
|
|
3744
2682
|
|
3745
2683
|
--
|
3746
2684
|
|
3747
|
-
##### [select_visible_elements](https://github.com/appium/ruby_lib/blob/
|
2685
|
+
##### [select_visible_elements](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/ios/xcuitest/element/generic.rb#L44) ios
|
3748
2686
|
|
3749
2687
|
> def select_visible_elements(elements)
|
3750
2688
|
|
@@ -3752,7 +2690,172 @@ Return visible elements.
|
|
3752
2690
|
|
3753
2691
|
--
|
3754
2692
|
|
3755
|
-
##### [
|
2693
|
+
##### [swipe](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/ios/xcuitest/command/gestures.rb#L11) ios
|
2694
|
+
|
2695
|
+
> def swipe(direction:, element: nil)
|
2696
|
+
|
2697
|
+
|
2698
|
+
|
2699
|
+
__Parameters:__
|
2700
|
+
|
2701
|
+
[string] direction - Either 'up', 'down', 'left' or 'right'.
|
2702
|
+
|
2703
|
+
[Hash] opts - a customizable set of options
|
2704
|
+
|
2705
|
+
--
|
2706
|
+
|
2707
|
+
##### [scroll](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/ios/xcuitest/command/gestures.rb#L29) ios
|
2708
|
+
|
2709
|
+
> def scroll(direction:, name: nil, element: nil, to_visible: nil, predicate_string: nil)
|
2710
|
+
|
2711
|
+
|
2712
|
+
|
2713
|
+
__Parameters:__
|
2714
|
+
|
2715
|
+
[string] direction - Either 'up', 'down', 'left' or 'right'.
|
2716
|
+
|
2717
|
+
[Hash] opts - a customizable set of options
|
2718
|
+
|
2719
|
+
--
|
2720
|
+
|
2721
|
+
##### [pinch](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/ios/xcuitest/command/gestures.rb#L48) ios
|
2722
|
+
|
2723
|
+
> def pinch(scale:, velocity: 1.0, element: nil)
|
2724
|
+
|
2725
|
+
|
2726
|
+
|
2727
|
+
__Parameters:__
|
2728
|
+
|
2729
|
+
[scale] scale - X tap coordinate of type float. Mandatory parameter
|
2730
|
+
|
2731
|
+
[float] velocity - Y tap coordinate of type float. Mandatory parameter
|
2732
|
+
|
2733
|
+
[Hash] opts - a customizable set of options
|
2734
|
+
|
2735
|
+
--
|
2736
|
+
|
2737
|
+
##### [double_tap](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/ios/xcuitest/command/gestures.rb#L63) ios
|
2738
|
+
|
2739
|
+
> def double_tap(x: nil, y: nil, element: nil)
|
2740
|
+
|
2741
|
+
|
2742
|
+
|
2743
|
+
__Parameters:__
|
2744
|
+
|
2745
|
+
[float] x - X Screen x tap coordinate of type float. Mandatory parameter only if element is not set
|
2746
|
+
|
2747
|
+
[float] y - Y Screen y tap coordinate of type float. Mandatory parameter only if element is not set
|
2748
|
+
|
2749
|
+
[Hash] opts - a customizable set of options
|
2750
|
+
|
2751
|
+
--
|
2752
|
+
|
2753
|
+
##### [touch_and_hold](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/ios/xcuitest/command/gestures.rb#L80) ios
|
2754
|
+
|
2755
|
+
> def touch_and_hold(x: nil, y: nil, element: nil, duration: 1.0)
|
2756
|
+
|
2757
|
+
|
2758
|
+
|
2759
|
+
__Parameters:__
|
2760
|
+
|
2761
|
+
[float] x - Screen x long tap coordinate of type float. Mandatory parameter only if element is not set
|
2762
|
+
|
2763
|
+
[float] y - Screen y long tap coordinate of type float. Mandatory parameter only if element is not set
|
2764
|
+
|
2765
|
+
[Float] duration - The float duration of press action in seconds. Mandatory parameter
|
2766
|
+
|
2767
|
+
[Hash] opts - a customizable set of options
|
2768
|
+
|
2769
|
+
--
|
2770
|
+
|
2771
|
+
##### [two_finger_tap](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/ios/xcuitest/command/gestures.rb#L93) ios
|
2772
|
+
|
2773
|
+
> def two_finger_tap(element:)
|
2774
|
+
|
2775
|
+
|
2776
|
+
|
2777
|
+
__Parameters:__
|
2778
|
+
|
2779
|
+
[Element] element - Element to long tap on.
|
2780
|
+
|
2781
|
+
```ruby
|
2782
|
+
two_finger_tap element: find_element(:accessibility_id, "some item")
|
2783
|
+
```
|
2784
|
+
|
2785
|
+
--
|
2786
|
+
|
2787
|
+
##### [tap](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/ios/xcuitest/command/gestures.rb#L108) ios
|
2788
|
+
|
2789
|
+
> def tap(x:, y:, element: nil)
|
2790
|
+
|
2791
|
+
|
2792
|
+
|
2793
|
+
__Parameters:__
|
2794
|
+
|
2795
|
+
[float] x - X tap coordinate of type float. Mandatory parameter
|
2796
|
+
|
2797
|
+
[float] y - Y tap coordinate of type float. Mandatory parameter
|
2798
|
+
|
2799
|
+
[Hash] opts - a customizable set of options
|
2800
|
+
|
2801
|
+
--
|
2802
|
+
|
2803
|
+
##### [drag_from_to_for_duration](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/ios/xcuitest/command/gestures.rb#L128) ios
|
2804
|
+
|
2805
|
+
> def drag_from_to_for_duration(from_x:, from_y:, to_x:, to_y:, duration: 1.0, element: nil)
|
2806
|
+
|
2807
|
+
rubocop:disable Metrics/ParameterLists
|
2808
|
+
|
2809
|
+
__Parameters:__
|
2810
|
+
|
2811
|
+
[float] duration - Float number of seconds in range [0.5, 60]. How long the tap gesture at starting
|
2812
|
+
drag point should be before to start dragging. Mandatory parameter
|
2813
|
+
|
2814
|
+
[float] from_x - The x coordinate of starting drag point (type float). Mandatory parameter
|
2815
|
+
|
2816
|
+
[float] from_y - The y coordinate of starting drag point (type float). Mandatory parameter
|
2817
|
+
|
2818
|
+
[float] to_x - The x coordinate of ending drag point (type float). Mandatory parameter
|
2819
|
+
|
2820
|
+
[float] to_y - The y coordinate of ending drag point (type float). Mandatory parameter
|
2821
|
+
|
2822
|
+
[Hash] opts - a customizable set of options
|
2823
|
+
|
2824
|
+
--
|
2825
|
+
|
2826
|
+
##### [select_picker_wheel](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/ios/xcuitest/command/gestures.rb#L145) ios
|
2827
|
+
|
2828
|
+
> def select_picker_wheel(element:, order:, offset: nil)
|
2829
|
+
|
2830
|
+
https://github.com/facebook/WebDriverAgent/pull/523
|
2831
|
+
https://github.com/appium/appium-xcuitest-driver/pull/420
|
2832
|
+
|
2833
|
+
__Parameters:__
|
2834
|
+
|
2835
|
+
[String] order - The order to move picker to. "next" or "previous".
|
2836
|
+
|
2837
|
+
[Element] element - Element id to perform select picker wheel on.
|
2838
|
+
|
2839
|
+
[Hash] opts - a customizable set of options
|
2840
|
+
|
2841
|
+
--
|
2842
|
+
|
2843
|
+
##### [alert](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/ios/xcuitest/command/gestures.rb#L163) ios
|
2844
|
+
|
2845
|
+
> def alert(action:, button_label: nil)
|
2846
|
+
|
2847
|
+
|
2848
|
+
|
2849
|
+
__Parameters:__
|
2850
|
+
|
2851
|
+
[String] action - The following actions are supported: accept, dismiss and getButtons. Mandatory parameter
|
2852
|
+
|
2853
|
+
[String] button_label - The label text of an existing alert button to click on.
|
2854
|
+
This is an optional parameter and is only valid in combination with accept and dismiss actions.
|
2855
|
+
|
2856
|
+
--
|
2857
|
+
|
2858
|
+
##### [text_field_class](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/ios/xcuitest/element/textfield.rb#L9) ios
|
3756
2859
|
|
3757
2860
|
> def text_field_class
|
3758
2861
|
|
@@ -3764,7 +2867,7 @@ __Returns:__
|
|
3764
2867
|
|
3765
2868
|
--
|
3766
2869
|
|
3767
|
-
##### [secure_text_field_class](https://github.com/appium/ruby_lib/blob/
|
2870
|
+
##### [secure_text_field_class](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/ios/xcuitest/element/textfield.rb#L14) ios
|
3768
2871
|
|
3769
2872
|
> def secure_text_field_class
|
3770
2873
|
|
@@ -3776,7 +2879,7 @@ __Returns:__
|
|
3776
2879
|
|
3777
2880
|
--
|
3778
2881
|
|
3779
|
-
##### [textfield](https://github.com/appium/ruby_lib/blob/
|
2882
|
+
##### [textfield](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/ios/xcuitest/element/textfield.rb#L23) ios
|
3780
2883
|
|
3781
2884
|
> def textfield(value)
|
3782
2885
|
|
@@ -3794,7 +2897,7 @@ __Returns:__
|
|
3794
2897
|
|
3795
2898
|
--
|
3796
2899
|
|
3797
|
-
##### [textfields](https://github.com/appium/ruby_lib/blob/
|
2900
|
+
##### [textfields](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/ios/xcuitest/element/textfield.rb#L41) ios
|
3798
2901
|
|
3799
2902
|
> def textfields(value = false)
|
3800
2903
|
|
@@ -3811,7 +2914,7 @@ __Returns:__
|
|
3811
2914
|
|
3812
2915
|
--
|
3813
2916
|
|
3814
|
-
##### [first_textfield](https://github.com/appium/ruby_lib/blob/
|
2917
|
+
##### [first_textfield](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/ios/xcuitest/element/textfield.rb#L50) ios
|
3815
2918
|
|
3816
2919
|
> def first_textfield
|
3817
2920
|
|
@@ -3823,7 +2926,7 @@ __Returns:__
|
|
3823
2926
|
|
3824
2927
|
--
|
3825
2928
|
|
3826
|
-
##### [last_textfield](https://github.com/appium/ruby_lib/blob/
|
2929
|
+
##### [last_textfield](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/ios/xcuitest/element/textfield.rb#L56) ios
|
3827
2930
|
|
3828
2931
|
> def last_textfield
|
3829
2932
|
|
@@ -3835,7 +2938,7 @@ __Returns:__
|
|
3835
2938
|
|
3836
2939
|
--
|
3837
2940
|
|
3838
|
-
##### [textfield_exact](https://github.com/appium/ruby_lib/blob/
|
2941
|
+
##### [textfield_exact](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/ios/xcuitest/element/textfield.rb#L65) ios
|
3839
2942
|
|
3840
2943
|
> def textfield_exact(value)
|
3841
2944
|
|
@@ -3851,7 +2954,7 @@ __Returns:__
|
|
3851
2954
|
|
3852
2955
|
--
|
3853
2956
|
|
3854
|
-
##### [textfields_exact](https://github.com/appium/ruby_lib/blob/
|
2957
|
+
##### [textfields_exact](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/ios/xcuitest/element/textfield.rb#L72) ios
|
3855
2958
|
|
3856
2959
|
> def textfields_exact(value)
|
3857
2960
|
|
@@ -3867,7 +2970,7 @@ __Returns:__
|
|
3867
2970
|
|
3868
2971
|
--
|
3869
2972
|
|
3870
|
-
##### [set_pasteboard](https://github.com/appium/ruby_lib/blob/
|
2973
|
+
##### [set_pasteboard](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/ios/xcuitest/command/pasteboard.rb#L12) ios
|
3871
2974
|
|
3872
2975
|
> def set_pasteboard(content:, encoding: nil)
|
3873
2976
|
|
@@ -3882,7 +2985,7 @@ The parameter is mandatory
|
|
3882
2985
|
|
3883
2986
|
--
|
3884
2987
|
|
3885
|
-
##### [get_pasteboard](https://github.com/appium/ruby_lib/blob/
|
2988
|
+
##### [get_pasteboard](https://github.com/appium/ruby_lib/blob/01c8b6f15e8d01eb6b4e995eb265d1d1e8cf2332/lib/appium_lib/ios/xcuitest/command/pasteboard.rb#L24) ios
|
3886
2989
|
|
3887
2990
|
> def get_pasteboard(encoding: nil)
|
3888
2991
|
|
@@ -3894,55 +2997,3 @@ __Parameters:__
|
|
3894
2997
|
|
3895
2998
|
--
|
3896
2999
|
|
3897
|
-
##### [value](https://github.com/appium/ruby_lib/blob/95118d4e0a6ec285e55862ea6b6fed528711ad84/lib/appium_lib/common/patch.rb#L12)
|
3898
|
-
|
3899
|
-
> def value
|
3900
|
-
|
3901
|
-
Returns the value attribute
|
3902
|
-
|
3903
|
-
Fixes NoMethodError: undefined method `value' for Selenium::WebDriver::Element
|
3904
|
-
|
3905
|
-
--
|
3906
|
-
|
3907
|
-
##### [name](https://github.com/appium/ruby_lib/blob/95118d4e0a6ec285e55862ea6b6fed528711ad84/lib/appium_lib/common/patch.rb#L19)
|
3908
|
-
|
3909
|
-
> def name
|
3910
|
-
|
3911
|
-
Returns the name attribute
|
3912
|
-
|
3913
|
-
Fixes NoMethodError: undefined method `name' for Selenium::WebDriver::Element
|
3914
|
-
|
3915
|
-
--
|
3916
|
-
|
3917
|
-
##### [location_rel](https://github.com/appium/ruby_lib/blob/95118d4e0a6ec285e55862ea6b6fed528711ad84/lib/appium_lib/common/patch.rb#L30)
|
3918
|
-
|
3919
|
-
> def location_rel(driver = $driver)
|
3920
|
-
|
3921
|
-
For use with mobile tap.
|
3922
|
-
|
3923
|
-
```ruby
|
3924
|
-
execute_script 'mobile: tap', :x => 0.0, :y => 0.98
|
3925
|
-
```
|
3926
|
-
|
3927
|
-
__Returns:__
|
3928
|
-
|
3929
|
-
[OpenStruct] the relative x, y in a struct. ex: { x: 0.50, y: 0.20 }
|
3930
|
-
|
3931
|
-
--
|
3932
|
-
|
3933
|
-
##### [DEFAULT_HEADERS](https://github.com/appium/ruby_lib/blob/95118d4e0a6ec285e55862ea6b6fed528711ad84/lib/appium_lib/common/patch.rb#L170)
|
3934
|
-
|
3935
|
-
> DEFAULT_HEADERS = { 'Accept' => CONTENT_TYPE, 'User-Agent' => "appium/ruby_lib/#{::Appium::VERSION}" }.freeze
|
3936
|
-
|
3937
|
-
|
3938
|
-
|
3939
|
-
--
|
3940
|
-
|
3941
|
-
##### [patch_remote_driver_commands](https://github.com/appium/ruby_lib/blob/95118d4e0a6ec285e55862ea6b6fed528711ad84/lib/appium_lib/common/patch.rb#L173)
|
3942
|
-
|
3943
|
-
> def patch_remote_driver_commands
|
3944
|
-
|
3945
|
-
|
3946
|
-
|
3947
|
-
--
|
3948
|
-
|