appium_lib_core 1.6.0 → 1.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.rubocop.yml +2 -2
- data/CHANGELOG.md +16 -0
- data/lib/appium_lib_core/android/device.rb +301 -406
- data/lib/appium_lib_core/android/device/clipboard.rb +42 -0
- data/lib/appium_lib_core/android/device/emulator.rb +149 -147
- data/lib/appium_lib_core/android/device/network.rb +47 -0
- data/lib/appium_lib_core/android/device/performance.rb +24 -0
- data/lib/appium_lib_core/android/device/screen.rb +39 -0
- data/lib/appium_lib_core/android/espresso/bridge.rb +1 -1
- data/lib/appium_lib_core/android/uiautomator1/bridge.rb +1 -1
- data/lib/appium_lib_core/android/uiautomator2/bridge.rb +1 -1
- data/lib/appium_lib_core/android/uiautomator2/device.rb +3 -14
- data/lib/appium_lib_core/android/uiautomator2/device/battery.rb +28 -0
- data/lib/appium_lib_core/common/base/http_default.rb +5 -1
- data/lib/appium_lib_core/device.rb +50 -370
- data/lib/appium_lib_core/device/app_management.rb +113 -0
- data/lib/appium_lib_core/device/app_state.rb +18 -1
- data/lib/appium_lib_core/device/context.rb +48 -0
- data/lib/appium_lib_core/device/device_lock.rb +28 -0
- data/lib/appium_lib_core/device/file_management.rb +32 -0
- data/lib/appium_lib_core/device/image_comparison.rb +1 -3
- data/lib/appium_lib_core/device/ime_actions.rb +43 -0
- data/lib/appium_lib_core/device/keyboard.rb +26 -0
- data/lib/appium_lib_core/device/keyevent.rb +44 -0
- data/lib/appium_lib_core/device/screen_record.rb +21 -0
- data/lib/appium_lib_core/device/setting.rb +21 -0
- data/lib/appium_lib_core/device/touch_actions.rb +22 -0
- data/lib/appium_lib_core/device/value.rb +23 -0
- data/lib/appium_lib_core/driver.rb +8 -0
- data/lib/appium_lib_core/ios/device.rb +70 -101
- data/lib/appium_lib_core/ios/device/clipboard.rb +41 -0
- data/lib/appium_lib_core/ios/uiautomation/bridge.rb +1 -1
- data/lib/appium_lib_core/ios/xcuitest/bridge.rb +2 -2
- data/lib/appium_lib_core/ios/xcuitest/device.rb +166 -227
- data/lib/appium_lib_core/ios/xcuitest/device/battery.rb +28 -0
- data/lib/appium_lib_core/ios/xcuitest/device/performance.rb +40 -0
- data/lib/appium_lib_core/ios/xcuitest/device/screen.rb +30 -0
- data/lib/appium_lib_core/version.rb +2 -2
- data/release_notes.md +12 -0
- metadata +21 -2
@@ -0,0 +1,28 @@
|
|
1
|
+
module Appium
|
2
|
+
module Core
|
3
|
+
module Ios
|
4
|
+
module Xcuitest
|
5
|
+
module Device
|
6
|
+
module Battery
|
7
|
+
def self.add_methods
|
8
|
+
::Appium::Core::Device.add_endpoint_method(:battery_info) do
|
9
|
+
def battery_info
|
10
|
+
response = execute_script 'mobile: batteryInfo', {}
|
11
|
+
|
12
|
+
state = case response['state']
|
13
|
+
when 1, 2, 3
|
14
|
+
::Appium::Core::Device::BatteryStatus::IOS[response['state']]
|
15
|
+
else
|
16
|
+
::Appium::Logger.warn("The state is unknown or undefined: #{response['state']}")
|
17
|
+
::Appium::Core::Device::BatteryStatus::IOS[0] # :unknown
|
18
|
+
end
|
19
|
+
{ state: state, level: response['level'] }
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end # module Battery
|
24
|
+
end # module Device
|
25
|
+
end # module Xcuitest
|
26
|
+
end # module Ios
|
27
|
+
end # module Core
|
28
|
+
end # module Appium
|
@@ -0,0 +1,40 @@
|
|
1
|
+
module Appium
|
2
|
+
module Core
|
3
|
+
module Ios
|
4
|
+
module Xcuitest
|
5
|
+
module Device
|
6
|
+
module Performance
|
7
|
+
def self.add_methods
|
8
|
+
::Appium::Core::Device.add_endpoint_method(:start_performance_record) do
|
9
|
+
def start_performance_record(timeout: 300_000, profile_name: 'Activity Monitor', pid: nil)
|
10
|
+
option = {}
|
11
|
+
option[:timeout] = timeout
|
12
|
+
option[:profileName] = profile_name
|
13
|
+
option[:pid] = pid if pid
|
14
|
+
|
15
|
+
execute_script 'mobile: startPerfRecord', option
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
::Appium::Core::Device.add_endpoint_method(:get_performance_record) do
|
20
|
+
# rubocop:disable Metrics/ParameterLists
|
21
|
+
def get_performance_record(save_file_path: './performance', profile_name: 'Activity Monitor',
|
22
|
+
remote_path: nil, user: nil, pass: nil, method: 'PUT')
|
23
|
+
option = ::Appium::Core::Device::ScreenRecord.new(
|
24
|
+
remote_path: remote_path, user: user, pass: pass, method: method
|
25
|
+
).upload_option
|
26
|
+
|
27
|
+
option[:profileName] = profile_name
|
28
|
+
result = execute_script 'mobile: stopPerfRecord', option
|
29
|
+
|
30
|
+
File.open("#{save_file_path}.zip", 'wb') { |f| f << result.unpack('m')[0] }
|
31
|
+
end
|
32
|
+
# rubocop:enable Metrics/ParameterLists
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end # module Performance
|
36
|
+
end # module Device
|
37
|
+
end # module Xcuitest
|
38
|
+
end # module Ios
|
39
|
+
end # module Core
|
40
|
+
end # module Appium
|
@@ -0,0 +1,30 @@
|
|
1
|
+
module Appium
|
2
|
+
module Core
|
3
|
+
module Ios
|
4
|
+
module Xcuitest
|
5
|
+
module Device
|
6
|
+
module Screen
|
7
|
+
def self.add_methods
|
8
|
+
::Appium::Core::Device.add_endpoint_method(:start_recording_screen) do
|
9
|
+
# rubocop:disable Metrics/ParameterLists
|
10
|
+
def start_recording_screen(remote_path: nil, user: nil, pass: nil, method: nil, force_restart: nil,
|
11
|
+
video_type: 'mp4', time_limit: '180', video_quality: 'medium')
|
12
|
+
option = ::Appium::Core::Device::ScreenRecord.new(
|
13
|
+
remote_path: remote_path, user: user, pass: pass, method: method, force_restart: force_restart
|
14
|
+
).upload_option
|
15
|
+
|
16
|
+
option[:videoType] = video_type
|
17
|
+
option[:timeLimit] = time_limit
|
18
|
+
option[:videoQuality] = video_quality
|
19
|
+
|
20
|
+
execute(:start_recording_screen, {}, { options: option })
|
21
|
+
end
|
22
|
+
# rubocop:enable Metrics/ParameterLists
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end # module Screen
|
26
|
+
end # module Device
|
27
|
+
end # module Xcuitest
|
28
|
+
end # module Ios
|
29
|
+
end # module Core
|
30
|
+
end # module Appium
|
@@ -1,6 +1,6 @@
|
|
1
1
|
module Appium
|
2
2
|
module Core
|
3
|
-
VERSION = '1.
|
4
|
-
DATE = '2018-05-
|
3
|
+
VERSION = '1.7.0'.freeze unless defined? ::Appium::Core::VERSION
|
4
|
+
DATE = '2018-05-28'.freeze unless defined? ::Appium::Core::DATE
|
5
5
|
end
|
6
6
|
end
|
data/release_notes.md
CHANGED
@@ -1,3 +1,15 @@
|
|
1
|
+
#### v1.7.0 2018-05-28
|
2
|
+
|
3
|
+
- [619b964](https://github.com/appium/ruby_lib_core/commit/619b96483dc4bce50295ae831e445053e3d9f1d9) Release 1.7.0
|
4
|
+
- [e58cd36](https://github.com/appium/ruby_lib_core/commit/e58cd36edb8e819c944c4c8b9c1b186602fc9aa0) Update CHANGELOG.md
|
5
|
+
- [55527cc](https://github.com/appium/ruby_lib_core/commit/55527cc5135892057aa2921b2ec3a7054a90489a) set default content type (#92)
|
6
|
+
- [9eff655](https://github.com/appium/ruby_lib_core/commit/9eff6558f321cca26855c9795e76905559c5c54f) Add tests for delegates (#90)
|
7
|
+
- [9d0b03e](https://github.com/appium/ruby_lib_core/commit/9d0b03e77087a910ebefdadb88d765e126719e91) add ::
|
8
|
+
- [f225bbc](https://github.com/appium/ruby_lib_core/commit/f225bbc01c271abb1ff88649ea6000b8e0fc8ec6) split one device file into multiple separated files (#89)
|
9
|
+
- [a306f1a](https://github.com/appium/ruby_lib_core/commit/a306f1a8690d02f21c6392b0c46f6729037088a8) Refactor unit tests (#88)
|
10
|
+
- [695c17d](https://github.com/appium/ruby_lib_core/commit/695c17d42c5b43b462f70599ae90db7dd3d8b2e0) add flags for key press (#87)
|
11
|
+
|
12
|
+
|
1
13
|
#### v1.6.0 2018-05-08
|
2
14
|
|
3
15
|
- [37a35f0](https://github.com/appium/ruby_lib_core/commit/37a35f022d35f43a9770c17e25b8fa3c57737dd6) Release 1.6.0
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: appium_lib_core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kazuaki MATSUO
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-05-
|
11
|
+
date: 2018-05-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: selenium-webdriver
|
@@ -223,12 +223,17 @@ files:
|
|
223
223
|
- lib/appium_lib_core.rb
|
224
224
|
- lib/appium_lib_core/android.rb
|
225
225
|
- lib/appium_lib_core/android/device.rb
|
226
|
+
- lib/appium_lib_core/android/device/clipboard.rb
|
226
227
|
- lib/appium_lib_core/android/device/emulator.rb
|
228
|
+
- lib/appium_lib_core/android/device/network.rb
|
229
|
+
- lib/appium_lib_core/android/device/performance.rb
|
230
|
+
- lib/appium_lib_core/android/device/screen.rb
|
227
231
|
- lib/appium_lib_core/android/espresso/bridge.rb
|
228
232
|
- lib/appium_lib_core/android/search_context.rb
|
229
233
|
- lib/appium_lib_core/android/uiautomator1/bridge.rb
|
230
234
|
- lib/appium_lib_core/android/uiautomator2/bridge.rb
|
231
235
|
- lib/appium_lib_core/android/uiautomator2/device.rb
|
236
|
+
- lib/appium_lib_core/android/uiautomator2/device/battery.rb
|
232
237
|
- lib/appium_lib_core/android_espresso.rb
|
233
238
|
- lib/appium_lib_core/android_uiautomator2.rb
|
234
239
|
- lib/appium_lib_core/common.rb
|
@@ -254,19 +259,33 @@ files:
|
|
254
259
|
- lib/appium_lib_core/common/wait/timer.rb
|
255
260
|
- lib/appium_lib_core/common/ws/websocket.rb
|
256
261
|
- lib/appium_lib_core/device.rb
|
262
|
+
- lib/appium_lib_core/device/app_management.rb
|
257
263
|
- lib/appium_lib_core/device/app_state.rb
|
258
264
|
- lib/appium_lib_core/device/battery_status.rb
|
259
265
|
- lib/appium_lib_core/device/clipboard_content_type.rb
|
266
|
+
- lib/appium_lib_core/device/context.rb
|
267
|
+
- lib/appium_lib_core/device/device_lock.rb
|
268
|
+
- lib/appium_lib_core/device/file_management.rb
|
260
269
|
- lib/appium_lib_core/device/image_comparison.rb
|
270
|
+
- lib/appium_lib_core/device/ime_actions.rb
|
271
|
+
- lib/appium_lib_core/device/keyboard.rb
|
272
|
+
- lib/appium_lib_core/device/keyevent.rb
|
261
273
|
- lib/appium_lib_core/device/screen_record.rb
|
274
|
+
- lib/appium_lib_core/device/setting.rb
|
275
|
+
- lib/appium_lib_core/device/touch_actions.rb
|
276
|
+
- lib/appium_lib_core/device/value.rb
|
262
277
|
- lib/appium_lib_core/driver.rb
|
263
278
|
- lib/appium_lib_core/ios.rb
|
264
279
|
- lib/appium_lib_core/ios/device.rb
|
280
|
+
- lib/appium_lib_core/ios/device/clipboard.rb
|
265
281
|
- lib/appium_lib_core/ios/search_context.rb
|
266
282
|
- lib/appium_lib_core/ios/uiautomation/bridge.rb
|
267
283
|
- lib/appium_lib_core/ios/uiautomation/patch.rb
|
268
284
|
- lib/appium_lib_core/ios/xcuitest/bridge.rb
|
269
285
|
- lib/appium_lib_core/ios/xcuitest/device.rb
|
286
|
+
- lib/appium_lib_core/ios/xcuitest/device/battery.rb
|
287
|
+
- lib/appium_lib_core/ios/xcuitest/device/performance.rb
|
288
|
+
- lib/appium_lib_core/ios/xcuitest/device/screen.rb
|
270
289
|
- lib/appium_lib_core/ios/xcuitest/search_context.rb
|
271
290
|
- lib/appium_lib_core/ios_xcuitest.rb
|
272
291
|
- lib/appium_lib_core/patch.rb
|