appium_lib_core 3.2.0 → 3.2.1
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 -0
- data/CHANGELOG.md +14 -0
- data/README.md +11 -1
- data/azure-pipelines.yml +9 -0
- data/ci-jobs/functional/run_appium.yml +5 -3
- data/ci-jobs/functional_test.yml +73 -34
- data/lib/appium_lib_core/android/device.rb +12 -12
- data/lib/appium_lib_core/android/uiautomator2/device.rb +1 -1
- data/lib/appium_lib_core/common/base/bridge.rb +4 -4
- data/lib/appium_lib_core/common/base/bridge/w3c.rb +17 -8
- data/lib/appium_lib_core/common/base/driver.rb +38 -34
- data/lib/appium_lib_core/common/base/http_default.rb +2 -2
- data/lib/appium_lib_core/common/base/platform.rb +1 -1
- data/lib/appium_lib_core/common/base/screenshot.rb +1 -1
- data/lib/appium_lib_core/common/base/search_context.rb +4 -4
- data/lib/appium_lib_core/common/device/image_comparison.rb +7 -7
- data/lib/appium_lib_core/common/touch_action/multi_touch.rb +2 -2
- data/lib/appium_lib_core/common/touch_action/touch_actions.rb +6 -6
- data/lib/appium_lib_core/common/wait.rb +8 -8
- data/lib/appium_lib_core/common/ws/websocket.rb +5 -5
- data/lib/appium_lib_core/driver.rb +22 -19
- data/lib/appium_lib_core/ios/xcuitest/device.rb +27 -18
- data/lib/appium_lib_core/ios/xcuitest/device/screen.rb +2 -1
- data/lib/appium_lib_core/patch.rb +21 -1
- data/lib/appium_lib_core/version.rb +2 -2
- data/release_notes.md +17 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3ff75e0359bf70b322aa12cd173ef3fea0df195997233905a017e6fe4cf5f38c
|
4
|
+
data.tar.gz: 114ac1d61568e2cbe0325f8d1b286e9ae1955cb1a48bd9400c7c3e153c859ee9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d5787feb8efa19498e62c01a0458801c69979a32325b61f92367a4dca60c29dfcf7510d88e25d237196332ac63db22593177e6523981b960e28bc6e7c25e7e8a
|
7
|
+
data.tar.gz: e81f4f201e7fe44c4f97da21738c9399823ca8cdafe86f9f10e81c7d55f7847e37b9471745fbe180cb69aa2a59614d20cf5995835af0001b519aed7013654438
|
data/.rubocop.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -8,7 +8,21 @@ Read `release_notes.md` for commit level details.
|
|
8
8
|
|
9
9
|
### Bug fixes
|
10
10
|
|
11
|
+
|
12
|
+
## [3.2.1] - 2019-07-19
|
13
|
+
|
14
|
+
### Enhancements
|
15
|
+
- Add `video_filters` argument for `start_recording_screen` iOS
|
16
|
+
- It is available over Appium 1.15.0
|
17
|
+
|
18
|
+
### Bug fixes
|
19
|
+
- Fix wrong warning message in driver detection
|
20
|
+
|
11
21
|
### Deprecations
|
22
|
+
- `Driver#set_immediate_value(element, *value)`
|
23
|
+
- Use `Element#immediate_value(*value)` instead
|
24
|
+
- `Driver#replace_value(element, *value)`
|
25
|
+
- Use `Element#replace_value(*value)` instead
|
12
26
|
|
13
27
|
## [3.2.0] - 2019-06-27
|
14
28
|
|
data/README.md
CHANGED
@@ -4,7 +4,7 @@
|
|
4
4
|
|
5
5
|
| Travis, Ubuntu | Azure, Windows and functional tests |
|
6
6
|
|:---:|:---:|
|
7
|
-
|[![Build Status](https://travis-ci.org/appium/ruby_lib_core.svg?branch=master)](https://travis-ci.org/appium/ruby_lib_core)|[![Build Status](https://dev.azure.com/kazucocoa/
|
7
|
+
|[![Build Status](https://travis-ci.org/appium/ruby_lib_core.svg?branch=master)](https://travis-ci.org/appium/ruby_lib_core)|[![Build Status](https://dev.azure.com/kazucocoa/ruby_lib_core/_apis/build/status/ruby_lib_core?branchName=master)](https://dev.azure.com/kazucocoa/ruby_lib_core/_build/latest?definitionId=9&branchName=master)|
|
8
8
|
|
9
9
|
This library is a Ruby client for Appium. The gem is available via [appium_lib_core](https://rubygems.org/gems/appium_lib_core).
|
10
10
|
|
@@ -76,6 +76,16 @@ $ PARALLEL=1 bundle exec parallel_test test/functional/android -n 3
|
|
76
76
|
$ PARALLEL=1 bundle exec parallel_test test/functional/ios -n 2
|
77
77
|
```
|
78
78
|
|
79
|
+
## CI
|
80
|
+
|
81
|
+
- Runs on CI environment (on Azure)
|
82
|
+
- Non `IGNORE_VERSION_SKIP` or `IGNORE_VERSION_SKIP=true` runs all tests ignoring `skip` them by Appium versions
|
83
|
+
- `IGNORE_VERSION_SKIP=false` skips the following tests if the Appium version is lower than the requirement
|
84
|
+
|
85
|
+
```
|
86
|
+
$ IGNORE_VERSION_SKIP=true CI=true bundle exec rake test:func:android
|
87
|
+
```
|
88
|
+
|
79
89
|
## Run a test case
|
80
90
|
1. Launch the Appium server locally.
|
81
91
|
2. Run the following script.
|
data/azure-pipelines.yml
CHANGED
@@ -24,3 +24,12 @@ jobs:
|
|
24
24
|
- template: ./ci-jobs/functional/publish_test_result.yml
|
25
25
|
parameters:
|
26
26
|
xcodeVersion: 'Run_unit_tests_on_Windows_environment'
|
27
|
+
|
28
|
+
# Runs tests nightly to make sure they works against appium@beta
|
29
|
+
schedules:
|
30
|
+
- cron: "0 0 * * *"
|
31
|
+
displayName: Daily Nightly build (UTC)
|
32
|
+
branches:
|
33
|
+
include:
|
34
|
+
- master
|
35
|
+
always: true
|
@@ -1,12 +1,14 @@
|
|
1
1
|
steps:
|
2
2
|
- task: NodeTool@0
|
3
3
|
inputs:
|
4
|
-
versionSpec:
|
5
|
-
displayName: Install Node
|
6
|
-
- script: npm install -g appium
|
4
|
+
versionSpec: 10.x
|
5
|
+
displayName: Install Node 10.x
|
6
|
+
- script: npm install -g appium@${APPIUM_VERSION} --chromedriver_version='2.44'
|
7
7
|
displayName: Install appium beta
|
8
8
|
- script: npm install -g mjpeg-consumer
|
9
9
|
displayName: Install MJPEG Consumer
|
10
|
+
- script: npm list --depth 2 -g || echo 'ok'
|
11
|
+
displayName: Installed node dependencies
|
10
12
|
- task: UseRubyVersion@0
|
11
13
|
inputs:
|
12
14
|
versionSpec: '2.4' # so far, bundler does not work over 2.5 since it raises openssl error
|
data/ci-jobs/functional_test.yml
CHANGED
@@ -1,18 +1,27 @@
|
|
1
1
|
# jobs for functional test
|
2
2
|
parameters:
|
3
3
|
vmImage: 'macOS-10.14'
|
4
|
+
vmImageForIOS: 'macOS-10.13' # Not sure the reason, but macOS 10.14 instance raises no info.plist error
|
5
|
+
xcodeForIOS: 10.1
|
6
|
+
xcodeForTVOS: 10.2
|
7
|
+
androidSDK: 28
|
8
|
+
appiumVersion: 'beta'
|
9
|
+
ignoreVersionSkip: true
|
10
|
+
CI: true
|
4
11
|
|
5
12
|
jobs:
|
6
13
|
# Run unit tests on different Node versions
|
7
14
|
- job: func_test_ios_base
|
8
15
|
pool:
|
9
|
-
vmImage: ${{ parameters.
|
16
|
+
vmImage: ${{ parameters.vmImageForIOS }}
|
10
17
|
variables:
|
11
|
-
CI:
|
18
|
+
CI: ${{ parameters.ci }}
|
19
|
+
IGNORE_VERSION_SKIP: ${{ parameters.ignoreVersionSkip }}
|
20
|
+
APPIUM_VERSION: ${{ parameters.appiumVersion }}
|
12
21
|
steps:
|
13
22
|
- template: ./functional/ios_setup.yml
|
14
23
|
parameters:
|
15
|
-
xcodeVersion:
|
24
|
+
xcodeVersion: ${{ parameters.xcodeForIOS }}
|
16
25
|
- template: ./functional/run_appium.yml
|
17
26
|
- script: bundle exec rake test:func:ios TESTS=test/functional/ios/driver_test.rb,test/functional/ios/patch_test.rb
|
18
27
|
displayName: Run tests
|
@@ -22,13 +31,15 @@ jobs:
|
|
22
31
|
|
23
32
|
- job: func_test_ios_webdriver1
|
24
33
|
pool:
|
25
|
-
vmImage: ${{ parameters.
|
34
|
+
vmImage: ${{ parameters.vmImageForIOS }}
|
26
35
|
variables:
|
27
|
-
CI:
|
36
|
+
CI: ${{ parameters.ci }}
|
37
|
+
IGNORE_VERSION_SKIP: ${{ parameters.ignoreVersionSkip }}
|
38
|
+
APPIUM_VERSION: ${{ parameters.appiumVersion }}
|
28
39
|
steps:
|
29
40
|
- template: ./functional/ios_setup.yml
|
30
41
|
parameters:
|
31
|
-
xcodeVersion:
|
42
|
+
xcodeVersion: ${{ parameters.xcodeForIOS }}
|
32
43
|
- template: ./functional/run_appium.yml
|
33
44
|
- script: bundle exec rake test:func:ios TESTS=test/functional/ios/webdriver/create_session_test.rb,test/functional/ios/webdriver/w3c_actions_test.rb
|
34
45
|
displayName: Run tests
|
@@ -38,13 +49,15 @@ jobs:
|
|
38
49
|
|
39
50
|
- job: func_test_ios_webdriver2
|
40
51
|
pool:
|
41
|
-
vmImage: ${{ parameters.
|
52
|
+
vmImage: ${{ parameters.vmImageForIOS }}
|
42
53
|
variables:
|
43
|
-
CI:
|
54
|
+
CI: ${{ parameters.ci }}
|
55
|
+
IGNORE_VERSION_SKIP: ${{ parameters.ignoreVersionSkip }}
|
56
|
+
APPIUM_VERSION: ${{ parameters.appiumVersion }}
|
44
57
|
steps:
|
45
58
|
- template: ./functional/ios_setup.yml
|
46
59
|
parameters:
|
47
|
-
xcodeVersion:
|
60
|
+
xcodeVersion: ${{ parameters.xcodeForIOS }}
|
48
61
|
- template: ./functional/run_appium.yml
|
49
62
|
- script: bundle exec rake test:func:ios TESTS=test/functional/ios/webdriver/device_test.rb
|
50
63
|
displayName: Run tests
|
@@ -54,13 +67,15 @@ jobs:
|
|
54
67
|
|
55
68
|
- job: func_test_ios_ios1
|
56
69
|
pool:
|
57
|
-
vmImage: ${{ parameters.
|
70
|
+
vmImage: ${{ parameters.vmImageForIOS }}
|
58
71
|
variables:
|
59
|
-
CI:
|
72
|
+
CI: ${{ parameters.ci }}
|
73
|
+
IGNORE_VERSION_SKIP: ${{ parameters.ignoreVersionSkip }}
|
74
|
+
APPIUM_VERSION: ${{ parameters.appiumVersion }}
|
60
75
|
steps:
|
61
76
|
- template: ./functional/ios_setup.yml
|
62
77
|
parameters:
|
63
|
-
xcodeVersion:
|
78
|
+
xcodeVersion: ${{ parameters.xcodeForIOS }}
|
64
79
|
- template: ./functional/run_appium.yml
|
65
80
|
- script: bundle exec rake test:func:ios TESTS=test/functional/ios/ios/device_test.rb
|
66
81
|
displayName: Run tests
|
@@ -70,14 +85,18 @@ jobs:
|
|
70
85
|
|
71
86
|
- job: func_test_ios_ios2
|
72
87
|
pool:
|
73
|
-
vmImage: ${{ parameters.
|
88
|
+
vmImage: ${{ parameters.vmImageForIOS }}
|
74
89
|
variables:
|
75
|
-
CI:
|
90
|
+
CI: ${{ parameters.ci }}
|
91
|
+
IGNORE_VERSION_SKIP: ${{ parameters.ignoreVersionSkip }}
|
92
|
+
APPIUM_VERSION: ${{ parameters.appiumVersion }}
|
76
93
|
steps:
|
77
94
|
- template: ./functional/ios_setup.yml
|
78
95
|
parameters:
|
79
|
-
xcodeVersion:
|
96
|
+
xcodeVersion: ${{ parameters.xcodeForIOS }}
|
80
97
|
- template: ./functional/run_appium.yml
|
98
|
+
- script: npm install -g appium opencv4nodejs@4.17.0
|
99
|
+
displayName: Install opencv4nodejs@4.17.0
|
81
100
|
- script: bundle exec rake test:func:ios TESTS=test/functional/ios/ios/device_wda_attachment_test.rb,test/functional/ios/ios/image_comparison_test.rb
|
82
101
|
displayName: Run tests
|
83
102
|
- template: ./functional/publish_test_result.yml
|
@@ -86,13 +105,15 @@ jobs:
|
|
86
105
|
|
87
106
|
- job: func_test_ios_ios3
|
88
107
|
pool:
|
89
|
-
vmImage: ${{ parameters.
|
108
|
+
vmImage: ${{ parameters.vmImageForIOS }}
|
90
109
|
variables:
|
91
|
-
CI:
|
110
|
+
CI: ${{ parameters.ci }}
|
111
|
+
IGNORE_VERSION_SKIP: ${{ parameters.ignoreVersionSkip }}
|
112
|
+
APPIUM_VERSION: ${{ parameters.appiumVersion }}
|
92
113
|
steps:
|
93
114
|
- template: ./functional/ios_setup.yml
|
94
115
|
parameters:
|
95
|
-
xcodeVersion:
|
116
|
+
xcodeVersion: ${{ parameters.xcodeForIOS }}
|
96
117
|
- script: brew install ffmpeg && brew tap wix/brew && brew install wix/brew/applesimutils
|
97
118
|
displayName: Install ffmpeg and applesimutils
|
98
119
|
- template: ./functional/run_appium.yml
|
@@ -106,11 +127,13 @@ jobs:
|
|
106
127
|
pool:
|
107
128
|
vmImage: ${{ parameters.vmImage }}
|
108
129
|
variables:
|
109
|
-
CI:
|
130
|
+
CI: ${{ parameters.ci }}
|
131
|
+
IGNORE_VERSION_SKIP: ${{ parameters.ignoreVersionSkip }}
|
132
|
+
APPIUM_VERSION: ${{ parameters.appiumVersion }}
|
110
133
|
steps:
|
111
134
|
- template: ./functional/ios_setup.yml
|
112
135
|
parameters:
|
113
|
-
xcodeVersion:
|
136
|
+
xcodeVersion: ${{ parameters.xcodeForTVOS }}
|
114
137
|
- template: ./functional/run_appium.yml
|
115
138
|
- script: bundle exec rake test:func:ios TESTS=test/functional/ios/tv_driver_test.rb
|
116
139
|
displayName: Run tests
|
@@ -122,8 +145,10 @@ jobs:
|
|
122
145
|
pool:
|
123
146
|
vmImage: ${{ parameters.vmImage }}
|
124
147
|
variables:
|
125
|
-
CI:
|
126
|
-
ANDROID_SDK_VERSION:
|
148
|
+
CI: ${{ parameters.ci }}
|
149
|
+
ANDROID_SDK_VERSION: ${{ parameters.androidSDK }}
|
150
|
+
IGNORE_VERSION_SKIP: ${{ parameters.ignoreVersionSkip }}
|
151
|
+
APPIUM_VERSION: ${{ parameters.appiumVersion }}
|
127
152
|
steps:
|
128
153
|
- template: ./functional/android_setup.yml
|
129
154
|
- template: ./functional/run_appium.yml
|
@@ -137,8 +162,10 @@ jobs:
|
|
137
162
|
pool:
|
138
163
|
vmImage: ${{ parameters.vmImage }}
|
139
164
|
variables:
|
140
|
-
CI:
|
141
|
-
ANDROID_SDK_VERSION:
|
165
|
+
CI: ${{ parameters.ci }}
|
166
|
+
ANDROID_SDK_VERSION: ${{ parameters.androidSDK }}
|
167
|
+
IGNORE_VERSION_SKIP: ${{ parameters.ignoreVersionSkip }}
|
168
|
+
APPIUM_VERSION: ${{ parameters.appiumVersion }}
|
142
169
|
steps:
|
143
170
|
- template: ./functional/android_setup.yml
|
144
171
|
- template: ./functional/run_appium.yml
|
@@ -152,8 +179,10 @@ jobs:
|
|
152
179
|
pool:
|
153
180
|
vmImage: ${{ parameters.vmImage }}
|
154
181
|
variables:
|
155
|
-
CI:
|
156
|
-
ANDROID_SDK_VERSION:
|
182
|
+
CI: ${{ parameters.ci }}
|
183
|
+
ANDROID_SDK_VERSION: ${{ parameters.androidSDK }}
|
184
|
+
IGNORE_VERSION_SKIP: ${{ parameters.ignoreVersionSkip }}
|
185
|
+
APPIUM_VERSION: ${{ parameters.appiumVersion }}
|
157
186
|
steps:
|
158
187
|
- template: ./functional/android_setup.yml
|
159
188
|
- template: ./functional/run_appium.yml
|
@@ -167,11 +196,15 @@ jobs:
|
|
167
196
|
pool:
|
168
197
|
vmImage: ${{ parameters.vmImage }}
|
169
198
|
variables:
|
170
|
-
CI:
|
171
|
-
ANDROID_SDK_VERSION:
|
199
|
+
CI: ${{ parameters.ci }}
|
200
|
+
ANDROID_SDK_VERSION: ${{ parameters.androidSDK }}
|
201
|
+
IGNORE_VERSION_SKIP: ${{ parameters.ignoreVersionSkip }}
|
202
|
+
APPIUM_VERSION: ${{ parameters.appiumVersion }}
|
172
203
|
steps:
|
173
204
|
- template: ./functional/android_setup.yml
|
174
205
|
- template: ./functional/run_appium.yml
|
206
|
+
- script: npm install -g appium opencv4nodejs@4.17.0
|
207
|
+
displayName: Install opencv4nodejs@4.17.0
|
175
208
|
- script: bundle exec rake test:func:android TESTS=test/functional/android/android/image_comparison_test.rb,test/functional/android/android/mjpeg_server_test.rb
|
176
209
|
displayName: Run tests
|
177
210
|
- template: ./functional/publish_test_result.yml
|
@@ -182,8 +215,10 @@ jobs:
|
|
182
215
|
pool:
|
183
216
|
vmImage: ${{ parameters.vmImage }}
|
184
217
|
variables:
|
185
|
-
CI:
|
186
|
-
ANDROID_SDK_VERSION:
|
218
|
+
CI: ${{ parameters.ci }}
|
219
|
+
ANDROID_SDK_VERSION: ${{ parameters.androidSDK }}
|
220
|
+
IGNORE_VERSION_SKIP: ${{ parameters.ignoreVersionSkip }}
|
221
|
+
APPIUM_VERSION: ${{ parameters.appiumVersion }}
|
187
222
|
steps:
|
188
223
|
- template: ./functional/android_setup.yml
|
189
224
|
- template: ./functional/run_appium.yml
|
@@ -197,8 +232,10 @@ jobs:
|
|
197
232
|
pool:
|
198
233
|
vmImage: ${{ parameters.vmImage }}
|
199
234
|
variables:
|
200
|
-
CI:
|
201
|
-
ANDROID_SDK_VERSION:
|
235
|
+
CI: ${{ parameters.ci }}
|
236
|
+
ANDROID_SDK_VERSION: ${{ parameters.androidSDK }}
|
237
|
+
IGNORE_VERSION_SKIP: ${{ parameters.ignoreVersionSkip }}
|
238
|
+
APPIUM_VERSION: ${{ parameters.appiumVersion }}
|
202
239
|
steps:
|
203
240
|
- template: ./functional/android_setup.yml
|
204
241
|
- template: ./functional/run_appium.yml
|
@@ -212,9 +249,11 @@ jobs:
|
|
212
249
|
pool:
|
213
250
|
vmImage: ${{ parameters.vmImage }}
|
214
251
|
variables:
|
215
|
-
CI:
|
216
|
-
ANDROID_SDK_VERSION:
|
252
|
+
CI: ${{ parameters.ci }}
|
253
|
+
ANDROID_SDK_VERSION: ${{ parameters.androidSDK }}
|
217
254
|
AUTOMATION_NAME_DROID: espresso
|
255
|
+
IGNORE_VERSION_SKIP: ${{ parameters.ignoreVersionSkip }}
|
256
|
+
APPIUM_VERSION: ${{ parameters.appiumVersion }}
|
218
257
|
steps:
|
219
258
|
- template: ./functional/android_setup.yml
|
220
259
|
- template: ./functional/run_appium.yml
|
@@ -77,7 +77,7 @@ module Appium
|
|
77
77
|
# Same as #network_connection_type in selenium-webdriver.
|
78
78
|
#
|
79
79
|
# Returns a key of <code>{:airplane_mode: 1, wifi: 2, data: 4, all: 6, none: 0}</code> in #network_connection_type
|
80
|
-
# Returns a number of the mode in
|
80
|
+
# Returns a number of the mode in +#get_network_connection+
|
81
81
|
#
|
82
82
|
# @example
|
83
83
|
#
|
@@ -129,7 +129,7 @@ module Appium
|
|
129
129
|
# Defaults to 'Done' for iOS(except for XCUITest).
|
130
130
|
# @param [Symbol] strategy The symbol of the strategy which closes the keyboard.
|
131
131
|
# XCUITest ignore this argument.
|
132
|
-
# Default for iOS is
|
132
|
+
# Default for iOS is +:pressKey+. Default for Android is +:tapOutside+.
|
133
133
|
#
|
134
134
|
# @example
|
135
135
|
#
|
@@ -154,12 +154,12 @@ module Appium
|
|
154
154
|
# @option opts [String] :app_activity The target activity [required]
|
155
155
|
# @option opts [String] :app_wait_package The package to start before the target package [optional]
|
156
156
|
# @option opts [String] :app_wait_activity The activity to start before the target activity [optional]
|
157
|
-
# @option opts [String] :intent_action The intent action to give it when start the target activity (
|
158
|
-
# @option opts [String] :intent_category The intent category to give it when start the target activity (
|
159
|
-
# @option opts [String] :intent_flags The intent flag to give it when start the target activity (
|
157
|
+
# @option opts [String] :intent_action The intent action to give it when start the target activity (+-a+) [optional]
|
158
|
+
# @option opts [String] :intent_category The intent category to give it when start the target activity (+-c+) [optional]
|
159
|
+
# @option opts [String] :intent_flags The intent flag to give it when start the target activity (+-f+) [optional]
|
160
160
|
# @option opts [String] :optional_intent_arguments The optional intent action to give it when start the target activity [optional]
|
161
161
|
# You can set arbitrary arguments with space as string.
|
162
|
-
# e.g.
|
162
|
+
# e.g. +'--ez your_extra_bool bool --ei your_extra_int 1'+
|
163
163
|
# @option opts [bool] :dont_stop_app_on_reset Do not stop the app when the reset is called in Appium create/delete session [optional]
|
164
164
|
#
|
165
165
|
# @example
|
@@ -170,7 +170,7 @@ module Appium
|
|
170
170
|
|
171
171
|
# @!method set_network_connection(mode)
|
172
172
|
# Set the device network connection mode
|
173
|
-
# Same as
|
173
|
+
# Same as +#network_connection_type+ in selenium-webdriver.
|
174
174
|
#
|
175
175
|
# @param [String] mode Bit mask that represent the network mode
|
176
176
|
# Or the key matched with <code>{:airplane_mode: 1, wifi: 2, data: 4, all: 6, none: 0}</code>
|
@@ -204,7 +204,7 @@ module Appium
|
|
204
204
|
# Get the resource usage information of the application.
|
205
205
|
# https://github.com/appium/appium-base-driver/blob/be29aec2318316d12b5c3295e924a5ba8f09b0fb/lib/mjsonwp/routes.js#L303
|
206
206
|
# @param [String] package_name: Package name
|
207
|
-
# @param [String] data_type: Data type get with
|
207
|
+
# @param [String] data_type: Data type get with +get_performance_data_types+
|
208
208
|
# @param [String] data_read_timeout: Command timeout. Default is 2.
|
209
209
|
#
|
210
210
|
# @example
|
@@ -220,13 +220,13 @@ module Appium
|
|
220
220
|
# An exception will be thrown if the generated media file is too big to
|
221
221
|
# fit into the available process memory.
|
222
222
|
# This option only has an effect if there is screen recording process in progress
|
223
|
-
# and
|
223
|
+
# and +forceRestart+ parameter is not set to +true+.
|
224
224
|
# @param [String] user The name of the user for the remote authentication.
|
225
225
|
# @param [String] pass The password for the remote authentication.
|
226
226
|
# @param [String] method The http multipart upload method name. The 'PUT' one is used by default.
|
227
227
|
# @param [Boolean] force_restart Whether to try to catch and upload/return the currently running screen recording
|
228
|
-
# (
|
229
|
-
# and start a new recording immediately (
|
228
|
+
# (+false+, the default setting on server) or ignore the result of it
|
229
|
+
# and start a new recording immediately (+true+).
|
230
230
|
#
|
231
231
|
# @param [String] video_size The format is widthxheight.
|
232
232
|
# The default value is the device's native display resolution (if supported),
|
@@ -241,7 +241,7 @@ module Appium
|
|
241
241
|
# present then the most recent screen recording chunk is going to be returned as the result.
|
242
242
|
# @param [String] bit_rate The video bit rate for the video, in megabits per second.
|
243
243
|
# 4 Mbp/s(4000000) is by default for Android API level below 27. 20 Mb/s(20000000) for API level 27 and above.
|
244
|
-
# @param [Boolean] bug_report Set it to
|
244
|
+
# @param [Boolean] bug_report Set it to +true+ in order to display additional information on the video overlay,
|
245
245
|
# such as a timestamp, that is helpful in videos captured to illustrate bugs.
|
246
246
|
# This option is only supported since API level 27 (Android P).
|
247
247
|
#
|
@@ -30,7 +30,7 @@ module Appium
|
|
30
30
|
# Battery level in range [0.0, 1.0], where 1.0 means 100% charge. -1 is returned
|
31
31
|
# if the actual value cannot be retrieved from the system.
|
32
32
|
# Battery state. The following symbols are possible
|
33
|
-
#
|
33
|
+
# +:unknown, :charging, :discharging, :not_charging, :full+
|
34
34
|
#
|
35
35
|
# @example
|
36
36
|
#
|
@@ -58,10 +58,10 @@ module Appium
|
|
58
58
|
|
59
59
|
# Override
|
60
60
|
# Creates session handling both OSS and W3C dialects.
|
61
|
-
# Copy from Selenium::WebDriver::Remote::Bridge to keep using
|
61
|
+
# Copy from Selenium::WebDriver::Remote::Bridge to keep using +merged_capabilities+ for Appium
|
62
62
|
#
|
63
|
-
# If
|
64
|
-
# If
|
63
|
+
# If +desired_capabilities+ has +forceMjsonwp: true+ in the capability, this bridge works with mjsonwp protocol.
|
64
|
+
# If +forceMjsonwp: false+ or no the capability, it depends on server side whether this bridge works as w3c or mjsonwp.
|
65
65
|
#
|
66
66
|
# @param [::Selenium::WebDriver::Remote::W3C::Capabilities, Hash] desired_capabilities A capability
|
67
67
|
# @return [::Selenium::WebDriver::Remote::Capabilities, ::Selenium::WebDriver::Remote::W3C::Capabilities]
|
@@ -125,7 +125,7 @@ module Appium
|
|
125
125
|
json_create(oss_status, value)
|
126
126
|
end
|
127
127
|
|
128
|
-
# Append
|
128
|
+
# Append +appium:+ prefix for Appium following W3C spec
|
129
129
|
# https://www.w3.org/TR/webdriver/#dfn-validate-capabilities
|
130
130
|
#
|
131
131
|
# @param [::Selenium::WebDriver::Remote::W3C::Capabilities, Hash] capabilities A capability
|
@@ -43,18 +43,18 @@ module Appium
|
|
43
43
|
end
|
44
44
|
|
45
45
|
# Perform touch actions for W3C module.
|
46
|
-
# Generate
|
46
|
+
# Generate +touch+ pointer action here and users can use this via +driver.action+
|
47
47
|
# - https://seleniumhq.github.io/selenium/docs/api/rb/Selenium/WebDriver/W3CActionBuilder.html
|
48
48
|
# - https://seleniumhq.github.io/selenium/docs/api/rb/Selenium/WebDriver/PointerActions.html
|
49
49
|
# - https://seleniumhq.github.io/selenium/docs/api/rb/Selenium/WebDriver/KeyActions.html
|
50
50
|
#
|
51
|
-
# 'mouse' action is by default in the Ruby client. Appium server force the
|
51
|
+
# 'mouse' action is by default in the Ruby client. Appium server force the +mouse+ action to +touch+ once in
|
52
52
|
# the server side. So we don't consider the case.
|
53
53
|
#
|
54
54
|
# @example
|
55
55
|
#
|
56
56
|
# element = @driver.find_element(:id, "some id")
|
57
|
-
# @driver.action.click(element).perform # The
|
57
|
+
# @driver.action.click(element).perform # The 'click' is a part of 'PointerActions'
|
58
58
|
#
|
59
59
|
def action(async = false)
|
60
60
|
# Used for default duration of each touch actions
|
@@ -143,21 +143,21 @@ module Appium
|
|
143
143
|
|
144
144
|
# For Appium
|
145
145
|
# override
|
146
|
-
# called in
|
146
|
+
# called in 'extend DriverExtensions::HasNetworkConnection'
|
147
147
|
def network_connection
|
148
148
|
execute :get_network_connection
|
149
149
|
end
|
150
150
|
|
151
151
|
# For Appium
|
152
152
|
# override
|
153
|
-
# called in
|
153
|
+
# called in 'extend DriverExtensions::HasNetworkConnection'
|
154
154
|
def network_connection=(type)
|
155
155
|
execute :set_network_connection, {}, { parameters: { type: type } }
|
156
156
|
end
|
157
157
|
|
158
158
|
# For Appium
|
159
159
|
# No implementation for W3C webdriver module
|
160
|
-
# called in
|
160
|
+
# called in 'extend DriverExtensions::HasLocation'
|
161
161
|
def location
|
162
162
|
obj = execute(:get_location) || {}
|
163
163
|
::Selenium::WebDriver::Location.new obj['latitude'], obj['longitude'], obj['altitude']
|
@@ -165,8 +165,17 @@ module Appium
|
|
165
165
|
|
166
166
|
# For Appium
|
167
167
|
# No implementation for W3C webdriver module
|
168
|
-
# called in
|
169
|
-
|
168
|
+
# called in +extend DriverExtensions::HasLocation+
|
169
|
+
# It has below code as well. We should consider the same context in Selenium 4 as backward compatibility.
|
170
|
+
#
|
171
|
+
# def location=(loc)
|
172
|
+
# # note: Location = Struct.new(:latitude, :longitude, :altitude)
|
173
|
+
# raise TypeError, "expected #{Location}, got #{loc.inspect}:#{loc.class}" unless loc.is_a?(Location)
|
174
|
+
#
|
175
|
+
# @bridge.set_location loc.latitude, loc.longitude, loc.altitude
|
176
|
+
# end
|
177
|
+
#
|
178
|
+
def set_location(lat, lon, alt = 0.0)
|
170
179
|
loc = { latitude: lat, longitude: lon, altitude: alt }
|
171
180
|
execute :set_location, {}, { location: loc }
|
172
181
|
end
|