appium_lib_core 5.3.0 → 5.5.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/CHANGELOG.md +10 -0
- data/appium_lib_core.gemspec +3 -3
- data/lib/appium_lib_core/common/base/bridge.rb +14 -16
- data/lib/appium_lib_core/common/base/capabilities.rb +8 -16
- data/lib/appium_lib_core/driver.rb +2 -28
- data/lib/appium_lib_core/version.rb +2 -2
- metadata +8 -8
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 5568507385da95987810f6234f38634ed832f09c328b42f340ed8f012eb979e3
|
|
4
|
+
data.tar.gz: f1e8d745816ef89c07a1f19adca47a4fbf6889cc533b3c50c671df749b55d084
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: '0508a3eeabfab5868052600c767ef21ad93ac5d5efed1deab030966e5e6125d07e98bffb2ca5b5c2aababa20cf140643b7e086c90b315dc3040627d3f70357fa'
|
|
7
|
+
data.tar.gz: 0b3e01eac1d50376d0c9bb669f8360587113472ccb5706473e64b0d349a19267c6723d5ce3d4db01ca658fe4df2b2d79a98f6d66946f0426a285241732939b8f
|
data/CHANGELOG.md
CHANGED
|
@@ -10,6 +10,16 @@ Read `release_notes.md` for commit level details.
|
|
|
10
10
|
|
|
11
11
|
### Deprecations
|
|
12
12
|
|
|
13
|
+
## [5.5.0] - 2022-10-09
|
|
14
|
+
|
|
15
|
+
### Bug fixes
|
|
16
|
+
- Removed forcefully converting keys of capabilities into symbol, which caused unexpected capabilities format issue [ruby_lib/945](https://github.com/appium/ruby_lib/issues/945)
|
|
17
|
+
|
|
18
|
+
## [5.4.0] - 2022-10-01
|
|
19
|
+
|
|
20
|
+
### Enhancements
|
|
21
|
+
- Append `selnium-webdriver` `4.5` support
|
|
22
|
+
|
|
13
23
|
## [5.3.0] - 2022-08-10
|
|
14
24
|
|
|
15
25
|
### Enhancements
|
data/appium_lib_core.gemspec
CHANGED
|
@@ -22,15 +22,15 @@ Gem::Specification.new do |spec|
|
|
|
22
22
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
|
23
23
|
spec.require_paths = ['lib']
|
|
24
24
|
|
|
25
|
-
spec.add_runtime_dependency 'selenium-webdriver', '~> 4.2', '< 4.
|
|
25
|
+
spec.add_runtime_dependency 'selenium-webdriver', '~> 4.2', '< 4.6'
|
|
26
26
|
spec.add_runtime_dependency 'faye-websocket', '~> 0.11.0'
|
|
27
27
|
|
|
28
28
|
spec.add_development_dependency 'rake', '~> 13.0'
|
|
29
29
|
spec.add_development_dependency 'yard', '~> 0.9.11'
|
|
30
30
|
spec.add_development_dependency 'minitest', '~> 5.0'
|
|
31
31
|
spec.add_development_dependency 'minitest-reporters', '~> 1.1'
|
|
32
|
-
spec.add_development_dependency 'webmock', '~> 3.
|
|
33
|
-
spec.add_development_dependency 'rubocop', '1.
|
|
32
|
+
spec.add_development_dependency 'webmock', '~> 3.18.1'
|
|
33
|
+
spec.add_development_dependency 'rubocop', '1.36.0'
|
|
34
34
|
spec.add_development_dependency 'appium_thor', '~> 1.0'
|
|
35
35
|
spec.add_development_dependency 'parallel_tests'
|
|
36
36
|
spec.add_development_dependency 'simplecov'
|
|
@@ -53,8 +53,8 @@ module Appium
|
|
|
53
53
|
# Override
|
|
54
54
|
# Creates session handling.
|
|
55
55
|
#
|
|
56
|
-
# @param [::
|
|
57
|
-
# @return [::
|
|
56
|
+
# @param [::Appium::Core::Base::Capabilities, Hash] capabilities A capability
|
|
57
|
+
# @return [::Appium::Core::Base::Capabilities]
|
|
58
58
|
#
|
|
59
59
|
# @example
|
|
60
60
|
#
|
|
@@ -89,10 +89,10 @@ module Appium
|
|
|
89
89
|
# Append +appium:+ prefix for Appium following W3C spec
|
|
90
90
|
# https://www.w3.org/TR/webdriver/#dfn-validate-capabilities
|
|
91
91
|
#
|
|
92
|
-
# @param [::
|
|
93
|
-
# @return [::
|
|
92
|
+
# @param [::Appium::Core::Base::Capabilities, Hash] capabilities A capability
|
|
93
|
+
# @return [::Appium::Core::Base::Capabilities]
|
|
94
94
|
def add_appium_prefix(capabilities)
|
|
95
|
-
w3c_capabilities = ::
|
|
95
|
+
w3c_capabilities = ::Appium::Core::Base::Capabilities.new
|
|
96
96
|
|
|
97
97
|
capabilities = capabilities.send(:capabilities) unless capabilities.is_a?(Hash)
|
|
98
98
|
|
|
@@ -111,12 +111,12 @@ module Appium
|
|
|
111
111
|
|
|
112
112
|
private
|
|
113
113
|
|
|
114
|
-
def camel_case(
|
|
115
|
-
|
|
114
|
+
def camel_case(str_or_sym)
|
|
115
|
+
str_or_sym.to_s.gsub(/_([a-z])/) { Regexp.last_match(1).upcase }
|
|
116
116
|
end
|
|
117
117
|
|
|
118
118
|
def extension_prefix?(capability_name)
|
|
119
|
-
snake_cased_capability_names = ::
|
|
119
|
+
snake_cased_capability_names = ::Appium::Core::Base::Capabilities::KNOWN.map(&:to_s)
|
|
120
120
|
camel_cased_capability_names = snake_cased_capability_names.map { |v| camel_case(v) }
|
|
121
121
|
|
|
122
122
|
# Check 'EXTENSION_CAPABILITY_PATTERN'
|
|
@@ -126,7 +126,7 @@ module Appium
|
|
|
126
126
|
end
|
|
127
127
|
|
|
128
128
|
def json_create(value)
|
|
129
|
-
::
|
|
129
|
+
::Appium::Core::Base::Capabilities.json_create(value)
|
|
130
130
|
end
|
|
131
131
|
|
|
132
132
|
public
|
|
@@ -182,16 +182,11 @@ module Appium
|
|
|
182
182
|
|
|
183
183
|
# Port from MJSONWP
|
|
184
184
|
def session_capabilities
|
|
185
|
-
::
|
|
185
|
+
::Appium::Core::Base::Capabilities.json_create execute(:get_capabilities)
|
|
186
186
|
end
|
|
187
187
|
|
|
188
|
-
#
|
|
189
|
-
# override
|
|
188
|
+
# Override for safe. Newer ruby selenium webdriver already has the same code
|
|
190
189
|
def page_source
|
|
191
|
-
# For W3C
|
|
192
|
-
# execute_script('var source = document.documentElement.outerHTML;' \
|
|
193
|
-
# 'if (!source) { source = new XMLSerializer().serializeToString(document); }' \
|
|
194
|
-
# 'return source;')
|
|
195
190
|
execute :get_page_source
|
|
196
191
|
end
|
|
197
192
|
|
|
@@ -350,6 +345,9 @@ module Appium
|
|
|
350
345
|
element_id = element_id_from(arg)
|
|
351
346
|
return ::Appium::Core::Element.new(self, element_id) if element_id
|
|
352
347
|
|
|
348
|
+
shadow_root_id = shadow_root_id_from(arg)
|
|
349
|
+
return ::Selenium::WebDriver::Remote::ShadowRoot.new self, shadow_root_id if shadow_root_id
|
|
350
|
+
|
|
353
351
|
arg.each { |k, v| arg[k] = unwrap_script_result(v) }
|
|
354
352
|
else
|
|
355
353
|
arg
|
|
@@ -15,22 +15,14 @@
|
|
|
15
15
|
module Appium
|
|
16
16
|
module Core
|
|
17
17
|
class Base
|
|
18
|
-
|
|
19
|
-
#
|
|
20
|
-
#
|
|
21
|
-
#
|
|
22
|
-
#
|
|
23
|
-
#
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
# Selenium 5 will have Options instead of 'Capabilities'.
|
|
27
|
-
# https://github.com/SeleniumHQ/selenium/blob/trunk/rb/lib/selenium/webdriver/common/options.rb
|
|
28
|
-
# Then, Ruby client also shoud move to the Options way.
|
|
29
|
-
# Appium's capabilities could change by depending on Appium versions. So it does not have
|
|
30
|
-
# standard options like chrome and firefox etc. So, the implementation should differ from
|
|
31
|
-
# other browsers. But here should inherit `Options` to follow Selenium.
|
|
32
|
-
::Selenium::WebDriver::Remote::Capabilities.new(opts_caps)
|
|
33
|
-
end
|
|
18
|
+
class Capabilities < ::Selenium::WebDriver::Remote::Capabilities
|
|
19
|
+
# TODO: Move to 'Options' way instead of 'Capabilities'.
|
|
20
|
+
# Selenium 5 will have Options instead of 'Capabilities'.
|
|
21
|
+
# https://github.com/SeleniumHQ/selenium/blob/trunk/rb/lib/selenium/webdriver/common/options.rb
|
|
22
|
+
# Then, Ruby client also shoud move to the Options way.
|
|
23
|
+
# Appium's capabilities could change by depending on Appium versions. So it does not have
|
|
24
|
+
# standard options like chrome and firefox etc. So, the implementation should differ from
|
|
25
|
+
# other browsers. But here should inherit `Options` to follow Selenium.
|
|
34
26
|
end
|
|
35
27
|
end
|
|
36
28
|
end
|
|
@@ -293,9 +293,6 @@ module Appium
|
|
|
293
293
|
@delegate_target = self # for testing purpose
|
|
294
294
|
@automation_name = nil # initialise before 'set_automation_name'
|
|
295
295
|
|
|
296
|
-
opts = Appium.symbolize_keys opts
|
|
297
|
-
validate_keys(opts)
|
|
298
|
-
|
|
299
296
|
@custom_url = opts.delete :url
|
|
300
297
|
@caps = get_caps(opts)
|
|
301
298
|
|
|
@@ -371,7 +368,7 @@ module Appium
|
|
|
371
368
|
begin
|
|
372
369
|
@driver = ::Appium::Core::Base::Driver.new(listener: @listener,
|
|
373
370
|
http_client: @http_client,
|
|
374
|
-
capabilities: @caps, # ::
|
|
371
|
+
capabilities: @caps, # ::Appium::Core::Base::Capabilities
|
|
375
372
|
url: @custom_url,
|
|
376
373
|
wait_timeout: @wait_timeout,
|
|
377
374
|
wait_interval: @wait_interval,
|
|
@@ -555,32 +552,9 @@ module Appium
|
|
|
555
552
|
self
|
|
556
553
|
end
|
|
557
554
|
|
|
558
|
-
# @private
|
|
559
|
-
def validate_keys(opts)
|
|
560
|
-
flatten_ops = flatten_hash_keys(opts)
|
|
561
|
-
|
|
562
|
-
raise Error::NoCapabilityError unless opts.member?(:caps) || opts.member?(:capabilities)
|
|
563
|
-
|
|
564
|
-
if !opts.member?(:appium_lib) && flatten_ops.member?(:appium_lib)
|
|
565
|
-
raise Error::CapabilityStructureError, 'Please check the value of appium_lib in the capability'
|
|
566
|
-
end
|
|
567
|
-
|
|
568
|
-
true
|
|
569
|
-
end
|
|
570
|
-
|
|
571
|
-
# @private
|
|
572
|
-
def flatten_hash_keys(hash, flatten_keys_result = [])
|
|
573
|
-
hash.each do |key, value|
|
|
574
|
-
flatten_keys_result << key
|
|
575
|
-
flatten_hash_keys(value, flatten_keys_result) if value.is_a?(Hash)
|
|
576
|
-
end
|
|
577
|
-
|
|
578
|
-
flatten_keys_result
|
|
579
|
-
end
|
|
580
|
-
|
|
581
555
|
# @private
|
|
582
556
|
def get_caps(opts)
|
|
583
|
-
Core::Base::Capabilities.
|
|
557
|
+
Core::Base::Capabilities.new(opts[:caps] || opts[:capabilities] || {})
|
|
584
558
|
end
|
|
585
559
|
|
|
586
560
|
# @private
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
|
|
15
15
|
module Appium
|
|
16
16
|
module Core
|
|
17
|
-
VERSION = '5.
|
|
18
|
-
DATE = '2022-
|
|
17
|
+
VERSION = '5.5.0' unless defined? ::Appium::Core::VERSION
|
|
18
|
+
DATE = '2022-10-09' unless defined? ::Appium::Core::DATE
|
|
19
19
|
end
|
|
20
20
|
end
|
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: 5.
|
|
4
|
+
version: 5.5.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: 2022-
|
|
11
|
+
date: 2022-10-09 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: selenium-webdriver
|
|
@@ -19,7 +19,7 @@ dependencies:
|
|
|
19
19
|
version: '4.2'
|
|
20
20
|
- - "<"
|
|
21
21
|
- !ruby/object:Gem::Version
|
|
22
|
-
version: '4.
|
|
22
|
+
version: '4.6'
|
|
23
23
|
type: :runtime
|
|
24
24
|
prerelease: false
|
|
25
25
|
version_requirements: !ruby/object:Gem::Requirement
|
|
@@ -29,7 +29,7 @@ dependencies:
|
|
|
29
29
|
version: '4.2'
|
|
30
30
|
- - "<"
|
|
31
31
|
- !ruby/object:Gem::Version
|
|
32
|
-
version: '4.
|
|
32
|
+
version: '4.6'
|
|
33
33
|
- !ruby/object:Gem::Dependency
|
|
34
34
|
name: faye-websocket
|
|
35
35
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -106,28 +106,28 @@ dependencies:
|
|
|
106
106
|
requirements:
|
|
107
107
|
- - "~>"
|
|
108
108
|
- !ruby/object:Gem::Version
|
|
109
|
-
version: 3.
|
|
109
|
+
version: 3.18.1
|
|
110
110
|
type: :development
|
|
111
111
|
prerelease: false
|
|
112
112
|
version_requirements: !ruby/object:Gem::Requirement
|
|
113
113
|
requirements:
|
|
114
114
|
- - "~>"
|
|
115
115
|
- !ruby/object:Gem::Version
|
|
116
|
-
version: 3.
|
|
116
|
+
version: 3.18.1
|
|
117
117
|
- !ruby/object:Gem::Dependency
|
|
118
118
|
name: rubocop
|
|
119
119
|
requirement: !ruby/object:Gem::Requirement
|
|
120
120
|
requirements:
|
|
121
121
|
- - '='
|
|
122
122
|
- !ruby/object:Gem::Version
|
|
123
|
-
version: 1.
|
|
123
|
+
version: 1.36.0
|
|
124
124
|
type: :development
|
|
125
125
|
prerelease: false
|
|
126
126
|
version_requirements: !ruby/object:Gem::Requirement
|
|
127
127
|
requirements:
|
|
128
128
|
- - '='
|
|
129
129
|
- !ruby/object:Gem::Version
|
|
130
|
-
version: 1.
|
|
130
|
+
version: 1.36.0
|
|
131
131
|
- !ruby/object:Gem::Dependency
|
|
132
132
|
name: appium_thor
|
|
133
133
|
requirement: !ruby/object:Gem::Requirement
|