appium_lib_core 2.1.0 → 2.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +20 -1
- data/README.md +6 -1
- data/Rakefile +6 -7
- data/lib/appium_lib_core/android/uiautomator2/device.rb +1 -1
- data/lib/appium_lib_core/common/base/driver.rb +6 -2
- data/lib/appium_lib_core/common/base/screenshot.rb +1 -1
- data/lib/appium_lib_core/common/command/w3c.rb +4 -4
- data/lib/appium_lib_core/driver.rb +10 -6
- data/lib/appium_lib_core/ios/xcuitest/device.rb +20 -11
- data/lib/appium_lib_core/ios/xcuitest/device/screen.rb +4 -1
- data/lib/appium_lib_core/version.rb +2 -2
- data/release_notes.md +18 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a02e68202c9a9657245c1fbcd79a7542159e387a
|
4
|
+
data.tar.gz: 30bbcd68a1f774ebce2622625991b019c904a1b9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ec058b2ed3e35946d41835e336859b0fa4d28db2eb08286cc85f5f0b0703928f41b2ddb8f6c417385125f6cd5973dd53d4d6c38e708afa1932621ad296051af9
|
7
|
+
data.tar.gz: 07aa605217f51dfaf94bc189cd953c2db7a1c41f67ad8cc239ee0b43b4e7c48adbfd38d0ffcd256f23e8fec9bca5ffc68e92537b8d0ff5ba514e4e41705ea10f
|
data/CHANGELOG.md
CHANGED
@@ -9,6 +9,25 @@ Read `release_notes.md` for commit level details.
|
|
9
9
|
|
10
10
|
### Deprecations
|
11
11
|
|
12
|
+
## [2.1.1] - 2018-11-23
|
13
|
+
### Enhancements
|
14
|
+
- `desired_capabilities:` is available in addition to `caps:` as a capability
|
15
|
+
```ruby
|
16
|
+
# case 1
|
17
|
+
opts = { caps: { }, appium_lib: { } }
|
18
|
+
@driver = Appium::Core.for(opts).start_driver
|
19
|
+
|
20
|
+
# case 2
|
21
|
+
opts = { desired_capabilities: { }, appium_lib: { } }
|
22
|
+
@driver = Appium::Core.for(opts).start_driver
|
23
|
+
```
|
24
|
+
- Update `start_recording_screen` for iOS, Appium 1.10.0
|
25
|
+
- Add `:video_scale` and update `:video_type`
|
26
|
+
|
27
|
+
### Bug fixes
|
28
|
+
|
29
|
+
### Deprecations
|
30
|
+
|
12
31
|
## [2.1.0] - 2018-11-14
|
13
32
|
### Enhancements
|
14
33
|
- Support below style _1_, has _url_ parameter, in addition to style _2_
|
@@ -19,7 +38,7 @@ Read `release_notes.md` for commit level details.
|
|
19
38
|
# 2
|
20
39
|
Appium::Core.for caps: {...}, appium_lib: {...}
|
21
40
|
```
|
22
|
-
- Add `
|
41
|
+
- Add `:video_fps` param for screen recording in iOS(XCUITest) to sync with Appium 1.10.0
|
23
42
|
|
24
43
|
### Bug fixes
|
25
44
|
|
data/README.md
CHANGED
@@ -5,6 +5,11 @@
|
|
5
5
|
|
6
6
|
[![Build Status](https://travis-ci.org/appium/ruby_lib_core.svg?branch=master)](https://travis-ci.org/appium/ruby_lib_core)
|
7
7
|
|
8
|
+
|
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
|
+
|
11
|
+
This library wraps [selenium-webdriver](https://github.com/SeleniumHQ/selenium/wiki/Ruby-Bindings) and adapts WebDriver APIs for Appium. [ruby_lib](https://github.com/appium/ruby_lib) calls all of Appium/Selenium related APIs via this core library. It works instance based driver.
|
12
|
+
|
8
13
|
# Documentation
|
9
14
|
|
10
15
|
- http://www.rubydoc.info/github/appium/ruby_lib_core
|
@@ -67,7 +72,7 @@ require 'rubygems'
|
|
67
72
|
require 'appium_lib_core'
|
68
73
|
|
69
74
|
opts = {
|
70
|
-
caps: {
|
75
|
+
desired_capabilities: { # or { caps: {....} }
|
71
76
|
platformName: :ios,
|
72
77
|
platformVersion: '11.0',
|
73
78
|
deviceName: 'iPhone Simulator',
|
data/Rakefile
CHANGED
@@ -66,12 +66,11 @@ namespace :android do
|
|
66
66
|
`adb uninstall io.appium.espressoserver.test`
|
67
67
|
end
|
68
68
|
|
69
|
-
|
70
69
|
desc('Generate and launch android emulators')
|
71
70
|
task :gen_device do |_t, _args|
|
72
|
-
SWARMER_VERSION = '0.2.4'
|
73
|
-
CPU_ARCHITECTURE = 'x86'
|
74
|
-
IMAGE = 'google_apis'
|
71
|
+
SWARMER_VERSION = '0.2.4'.freeze
|
72
|
+
CPU_ARCHITECTURE = 'x86'.freeze
|
73
|
+
IMAGE = 'google_apis'.freeze
|
75
74
|
ANDROID_API = 27
|
76
75
|
system %W(
|
77
76
|
curl
|
@@ -89,13 +88,13 @@ namespace :android do
|
|
89
88
|
).join(' ')
|
90
89
|
end
|
91
90
|
|
92
|
-
system %
|
91
|
+
system %w(java -jar /tmp/swarmer.jar start).concat(cmds).flatten.join(' ')
|
93
92
|
end
|
94
93
|
end
|
95
94
|
|
96
95
|
desc('Generate yardoc')
|
97
96
|
YARD::Rake::YardocTask.new do |t|
|
98
|
-
t.files
|
97
|
+
t.files = %w(lib/**/*.rb)
|
99
98
|
end
|
100
99
|
|
101
100
|
desc('Execute RuboCop static code analysis')
|
@@ -105,7 +104,7 @@ RuboCop::RakeTask.new(:rubocop) do |t|
|
|
105
104
|
t.fail_on_error = true
|
106
105
|
end
|
107
106
|
|
108
|
-
desc(
|
107
|
+
desc('print commands which Ruby client has not implemented them yet')
|
109
108
|
namespace :commands do
|
110
109
|
require './script/commands'
|
111
110
|
|
@@ -583,6 +583,12 @@ module Appium
|
|
583
583
|
#
|
584
584
|
# @example
|
585
585
|
#
|
586
|
+
# # iOS
|
587
|
+
# @driver.start_recording_screen video_type: 'libx264'
|
588
|
+
# @driver.stop_and_save_recording_screen 'example.mp4' # Video type `libx264` can be play as `.mp4` video
|
589
|
+
#
|
590
|
+
# # Android
|
591
|
+
# @driver.start_recording_screen
|
586
592
|
# @driver.stop_and_save_recording_screen 'example.mp4'
|
587
593
|
#
|
588
594
|
def stop_and_save_recording_screen(file_path)
|
@@ -807,8 +813,6 @@ module Appium
|
|
807
813
|
@bridge.session_capabilities
|
808
814
|
end
|
809
815
|
|
810
|
-
DEFAULT_MATCH_THRESHOLD = 0.5
|
811
|
-
|
812
816
|
# Image Comparison
|
813
817
|
def match_images_features(first_image:,
|
814
818
|
second_image:,
|
@@ -7,12 +7,12 @@ module Appium
|
|
7
7
|
{
|
8
8
|
# ::Appium::Core::Base::Commands::OSS has the following commands and Appium also use them.
|
9
9
|
# Delegated to ::Appium::Core::Base::Commands::OSS commands
|
10
|
-
status: [:get, 'status'.freeze],
|
11
|
-
is_element_displayed: [:get, 'session/:session_id/element/:id/displayed'.freeze],
|
10
|
+
status: [:get, 'status'.freeze], # https://w3c.github.io/webdriver/#dfn-status
|
11
|
+
is_element_displayed: [:get, 'session/:session_id/element/:id/displayed'.freeze], # hint: https://w3c.github.io/webdriver/#element-displayedness
|
12
12
|
|
13
|
-
get_timeouts: [:get, 'session/:session_id/timeouts'.freeze],
|
13
|
+
get_timeouts: [:get, 'session/:session_id/timeouts'.freeze], # https://w3c.github.io/webdriver/#get-timeouts
|
14
14
|
|
15
|
-
|
15
|
+
# Add OSS commands to W3C commands. We can remove them if we would like to remove them from W3C module.
|
16
16
|
### Session capability
|
17
17
|
get_capabilities: [:get, 'session/:session_id'.freeze],
|
18
18
|
|
@@ -84,8 +84,10 @@ module Appium
|
|
84
84
|
#
|
85
85
|
# # format 1
|
86
86
|
# @core = Appium::Core.for caps: {...}, appium_lib: {...}
|
87
|
-
# # format 2
|
88
|
-
# @core = Appium::Core.for url: "http://127.0.0.1:8080/wd/hub",
|
87
|
+
# # format 2. `desired_capabilities:` is also available instead of `caps:`. Either is fine.
|
88
|
+
# @core = Appium::Core.for url: "http://127.0.0.1:8080/wd/hub", desired_capabilities: {...}, appium_lib: {...}
|
89
|
+
# # format 3. `appium_lib: {...}` can be blank
|
90
|
+
# @core = Appium::Core.for url: "http://127.0.0.1:8080/wd/hub", desired_capabilities: {...}
|
89
91
|
#
|
90
92
|
#
|
91
93
|
# require 'rubygems'
|
@@ -113,8 +115,9 @@ module Appium
|
|
113
115
|
# @core.start_driver # Connect to `http://127.0.0.1:8080/wd/hub` because of `port: 8080`
|
114
116
|
#
|
115
117
|
# # Start iOS driver with .zip file over HTTP
|
118
|
+
# # `desired_capabilities:` is also available instead of `caps:`. Either is fine.
|
116
119
|
# opts = {
|
117
|
-
#
|
120
|
+
# desired_capabilities: {
|
118
121
|
# platformName: :ios,
|
119
122
|
# platformVersion: '11.0',
|
120
123
|
# deviceName: 'iPhone Simulator',
|
@@ -136,7 +139,7 @@ module Appium
|
|
136
139
|
# # Start iOS driver as another format. `url` is available like below
|
137
140
|
# opts = {
|
138
141
|
# url: "http://custom-host:8080/wd/hub.com",
|
139
|
-
#
|
142
|
+
# desired_capabilities: {
|
140
143
|
# platformName: :ios,
|
141
144
|
# platformVersion: '11.0',
|
142
145
|
# deviceName: 'iPhone Simulator',
|
@@ -392,7 +395,8 @@ module Appium
|
|
392
395
|
def validate_keys(opts)
|
393
396
|
flatten_ops = flatten_hash_keys(opts)
|
394
397
|
|
395
|
-
raise Error::NoCapabilityError unless opts.member?(:caps)
|
398
|
+
raise Error::NoCapabilityError unless opts.member?(:caps) || opts.member?(:desired_capabilities)
|
399
|
+
|
396
400
|
if !opts.member?(:appium_lib) && flatten_ops.member?(:appium_lib)
|
397
401
|
raise Error::CapabilityStructureError, 'Please check the value of appium_lib in the capability'
|
398
402
|
end
|
@@ -412,7 +416,7 @@ module Appium
|
|
412
416
|
|
413
417
|
# @private
|
414
418
|
def get_caps(opts)
|
415
|
-
Core::Base::Capabilities.create_capabilities(opts[:caps] || {})
|
419
|
+
Core::Base::Capabilities.create_capabilities(opts[:caps] || opts[:desired_capabilities] || {})
|
416
420
|
end
|
417
421
|
|
418
422
|
# @private
|
@@ -36,7 +36,13 @@ module Appium
|
|
36
36
|
# @driver.background_app(-1) #=> the app never come back. https://github.com/appium/appium/issues/7741
|
37
37
|
#
|
38
38
|
|
39
|
-
#
|
39
|
+
# @since Appium 1.9.1
|
40
|
+
# @!method start_recording_screen(remote_path: nil, user: nil, pass: nil, method: nil, force_restart: nil, video_type: 'mjpeg', time_limit: '180', video_quality: 'medium', video_scale: '320:240')
|
41
|
+
#
|
42
|
+
# Record the display of devices running iOS Simulator since Xcode 9 or real devices since iOS 11
|
43
|
+
# (ffmpeg utility is required: 'brew install ffmpeg').
|
44
|
+
# We would recommend to play the video by VLC or Mplayer if you can not play the video with other video players.
|
45
|
+
#
|
40
46
|
# @param [String] remote_path: The path to the remote location, where the resulting video should be uploaded.
|
41
47
|
# The following protocols are supported: http/https, ftp.
|
42
48
|
# Null or empty string value (the default setting) means the content of resulting
|
@@ -51,25 +57,28 @@ module Appium
|
|
51
57
|
# @param [Boolean] force_restart: Whether to try to catch and upload/return the currently running screen recording
|
52
58
|
# (`false`, the default setting on server) or ignore the result of it
|
53
59
|
# and start a new recording immediately (`true`).
|
54
|
-
# @param [String] video_type: The
|
55
|
-
#
|
56
|
-
#
|
60
|
+
# @param [String] video_type: The video codec type used for encoding of the be recorded screen capture.
|
61
|
+
# Execute `ffmpeg -codecs` in the terminal to see the list of supported video codecs.
|
62
|
+
# 'mjpeg' by default.
|
57
63
|
# @param [String] time_limit: Recording time. 180 seconds is by default.
|
58
64
|
# @param [String] video_quality: The video encoding quality (low, medium, high, photo - defaults to medium).
|
59
|
-
# Only works for real devices.
|
60
65
|
# @param [String] video_fps: The Frames Per Second rate of the recorded video. Change this value if the resulting video
|
61
|
-
# is too slow or too fast. Defaults to 10.
|
66
|
+
# is too slow or too fast. Defaults to 10. This can decrease the resulting file size.
|
67
|
+
# @param [String] video_scale: The scaling value to apply. Read https://trac.ffmpeg.org/wiki/Scaling for possible values.
|
68
|
+
# No scale is applied by default.
|
62
69
|
#
|
63
70
|
# @example
|
64
71
|
#
|
65
72
|
# @driver.start_recording_screen
|
66
|
-
# @driver.start_recording_screen video_type: '
|
73
|
+
# @driver.start_recording_screen video_type: 'mjpeg', time_limit: '260'
|
74
|
+
# @driver.start_recording_screen video_type: 'libx264', time_limit: '260' # Can get `.mp4` video
|
67
75
|
#
|
68
76
|
|
69
|
-
# @since 1.3.4
|
77
|
+
# @since Appium 1.3.4
|
70
78
|
# @!method start_performance_record(timeout: 300000, profile_name: 'Activity Monitor')
|
71
79
|
#
|
72
|
-
# This is a blocking application.
|
80
|
+
# This is a blocking application. Read https://help.apple.com/instruments/mac/current/ to understand the profiler.
|
81
|
+
#
|
73
82
|
# @param [Integer|String] timeout: The maximum count of milliseconds to record the profiling information.
|
74
83
|
# @param [String] profile_name: The name of existing performance profile to apply.
|
75
84
|
# Execute `instruments -s` to show the list of available profiles.
|
@@ -89,7 +98,7 @@ module Appium
|
|
89
98
|
# @driver.start_performance_record(timeout: 300000, profile_name: 'Activity Monitor')
|
90
99
|
#
|
91
100
|
|
92
|
-
# @since 1.3.4
|
101
|
+
# @since Appium 1.3.4
|
93
102
|
# @!method get_performance_record(save_file_path: './performance', profile_name: 'Activity Monitor', remote_path: nil, user: nil, pass: nil, method: 'PUT')
|
94
103
|
#
|
95
104
|
# This is a blocking application.
|
@@ -116,7 +125,7 @@ module Appium
|
|
116
125
|
# @driver.get_performance_record
|
117
126
|
# @driver.get_performance_record(save_file_path: './performance', profile_name: 'Activity Monitor')
|
118
127
|
|
119
|
-
# @since 1.6.0
|
128
|
+
# @since Appium 1.6.0
|
120
129
|
# @!method battery_info
|
121
130
|
#
|
122
131
|
# Get battery information.
|
@@ -8,7 +8,8 @@ module Appium
|
|
8
8
|
::Appium::Core::Device.add_endpoint_method(:start_recording_screen) do
|
9
9
|
# rubocop:disable Metrics/ParameterLists
|
10
10
|
def start_recording_screen(remote_path: nil, user: nil, pass: nil, method: nil, force_restart: nil,
|
11
|
-
video_type: '
|
11
|
+
video_type: 'mjpeg', time_limit: '180', video_quality: 'medium',
|
12
|
+
video_fps: nil, video_scale: nil)
|
12
13
|
option = ::Appium::Core::Base::Device::ScreenRecord.new(
|
13
14
|
remote_path: remote_path, user: user, pass: pass, method: method, force_restart: force_restart
|
14
15
|
).upload_option
|
@@ -16,7 +17,9 @@ module Appium
|
|
16
17
|
option[:videoType] = video_type
|
17
18
|
option[:timeLimit] = time_limit
|
18
19
|
option[:videoQuality] = video_quality
|
20
|
+
|
19
21
|
option[:videoFps] = video_fps unless video_fps.nil?
|
22
|
+
option[:videoScale] = video_scale unless video_scale.nil?
|
20
23
|
|
21
24
|
execute(:start_recording_screen, {}, { options: option })
|
22
25
|
end
|
@@ -1,6 +1,6 @@
|
|
1
1
|
module Appium
|
2
2
|
module Core
|
3
|
-
VERSION = '2.1.
|
4
|
-
DATE = '2018-11-
|
3
|
+
VERSION = '2.1.1'.freeze unless defined? ::Appium::Core::VERSION
|
4
|
+
DATE = '2018-11-23'.freeze unless defined? ::Appium::Core::DATE
|
5
5
|
end
|
6
6
|
end
|
data/release_notes.md
CHANGED
@@ -1,3 +1,21 @@
|
|
1
|
+
#### v2.1.1 2018-11-23
|
2
|
+
|
3
|
+
- [56e3904](https://github.com/appium/ruby_lib_core/commit/56e39043a9cd65205dd75632863d5911fac80d96) Release 2.1.1
|
4
|
+
- [64bea89](https://github.com/appium/ruby_lib_core/commit/64bea89301606d984de1a6d0b926ebe3c4f81e99) update screenshot test for ios (#166)
|
5
|
+
- [4790685](https://github.com/appium/ruby_lib_core/commit/4790685b6ee8b3a34539da5ed2612b3171ecb2cf) append https://help.apple.com/instruments/mac/current/#
|
6
|
+
- [0600769](https://github.com/appium/ruby_lib_core/commit/0600769e945349c9bb598a3a4af4381c53313699) update test_start_performance_record_and_stop
|
7
|
+
- [69080b1](https://github.com/appium/ruby_lib_core/commit/69080b16e1c02a729b8edf56efabf4dde9e76e23) Add screenshot quality tests (#165)
|
8
|
+
- [e1d6b11](https://github.com/appium/ruby_lib_core/commit/e1d6b11da52b2472240307b063f171c23b98c78c) Add tests for mjpeg and recording screen (#164)
|
9
|
+
- [8042627](https://github.com/appium/ruby_lib_core/commit/804262784ba9e444a6c28952d99d5c9dfdf6e9a1) tweak rubocop in Rakefile
|
10
|
+
- [eff797d](https://github.com/appium/ruby_lib_core/commit/eff797df68b318b3895d2ee5249540070f3365ba) make desired_capabilities name available in the capability (#163)
|
11
|
+
- [de80883](https://github.com/appium/ruby_lib_core/commit/de808835203efc9e52a9efbc3121a10a1cb4c3d5) remove unused const
|
12
|
+
- [2a398c5](https://github.com/appium/ruby_lib_core/commit/2a398c54d680851f8b2dc3b6bea8fe3a1e052fdb) remove pry
|
13
|
+
- [d07be96](https://github.com/appium/ruby_lib_core/commit/d07be96e1c25a6262703d778a4246c989fd03de6) add a --chromedriver_version in _web
|
14
|
+
- [fd46ae8](https://github.com/appium/ruby_lib_core/commit/fd46ae870efd21467ff2c6228fc2012d71b2e307) add a description for this
|
15
|
+
- [6e4dbe7](https://github.com/appium/ruby_lib_core/commit/6e4dbe72adb1b788daa639853fa1b8cbfb304a91) add one note for start_recording_screen
|
16
|
+
- [6b74a67](https://github.com/appium/ruby_lib_core/commit/6b74a67b9cbadadaf8e721866f5a4a539ea20b31) remove unneeded line in doc
|
17
|
+
|
18
|
+
|
1
19
|
#### v2.1.0 2018-11-14
|
2
20
|
|
3
21
|
- [6dafbd6](https://github.com/appium/ruby_lib_core/commit/6dafbd6cbc270f94a5e8b2ea5a779b644fdc3cdf) Release 2.1.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: 2.1.
|
4
|
+
version: 2.1.1
|
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-11-
|
11
|
+
date: 2018-11-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: selenium-webdriver
|