appium_lib_core 5.4.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 +5 -0
- data/lib/appium_lib_core/common/base/bridge.rb +13 -10
- 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 +2 -2
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,11 @@ 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
|
+
|
13
18
|
## [5.4.0] - 2022-10-01
|
14
19
|
|
15
20
|
### Enhancements
|
@@ -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,7 +182,7 @@ 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
188
|
# Override for safe. Newer ruby selenium webdriver already has the same code
|
@@ -345,6 +345,9 @@ module Appium
|
|
345
345
|
element_id = element_id_from(arg)
|
346
346
|
return ::Appium::Core::Element.new(self, element_id) if element_id
|
347
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
|
+
|
348
351
|
arg.each { |k, v| arg[k] = unwrap_script_result(v) }
|
349
352
|
else
|
350
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-10-
|
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-10-
|
11
|
+
date: 2022-10-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: selenium-webdriver
|