appium_lib_core 8.0.2 → 9.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 22e57b152d3c94c2b86f65520b00899c2f9c5bd0231a8496c9f0726849601e93
4
- data.tar.gz: ec392fd1c14218a5306489c05c3364dcd15a6a5f1191e2a42589698429fb9e8c
3
+ metadata.gz: ccf2b5c0df2ae8489c0c9b3382d260f2464c20828b02484888c7f1c738a42084
4
+ data.tar.gz: 6aa81ba96bd097f6075a947656533fd20476de3199855827d4278e71449b842e
5
5
  SHA512:
6
- metadata.gz: d4525eac2deb92a9356842d1fa9d518029d8166df50dbc628661e3637ed3f1c0527bfdb7c302a6f2d3fc32c39eee2ca2ca405fd72b572e7413bb91ee0ec66b2b
7
- data.tar.gz: 645d56159c0a8f444511ef25e6ef7d1ead6a428360928adc3219fc2c3e105d6d1fd6dbf204841a107657eecc64c6cfee0dd4326851771fc9eb73b1bc9f79c80b
6
+ metadata.gz: 7b7c967d705ffd0034af99c930ed6840e272a064cda6dd461710ac8990413b1ee7de7bbb577e9a3231113ec77c5007b737beb82811600c5d2061d21add41b129
7
+ data.tar.gz: 24405ae6731acb21cc504d0867410523a63943244d718700b0c24504bdf9cecae0ae54b7e5a647660cd8aec7e5bd9bd6391e160e1796246250e6dfecd78ca2ec
data/CHANGELOG.md CHANGED
@@ -10,6 +10,15 @@ Read `release_notes.md` for commit level details.
10
10
 
11
11
  ### Deprecations
12
12
 
13
+ ## [9.0.0] - 2024-05-14
14
+
15
+ ### Deprecations
16
+ - Stop converting snake cases to camel case for symbols in capabilities
17
+ - Please define camel/snake cases in capabilities as-is for the WebDriver capabilities
18
+ - Stop implicit symbolizing capabilities
19
+ - Historically ruby_lib/ruby_lib_core symbolized capabilities keys from string internally.
20
+ - `Appium.symbolize_keys` to build symbolized capabilities if issues occurred by this change.
21
+
13
22
  ## [8.0.2] - 2024-04-26
14
23
 
15
24
  ### Enhancements
@@ -30,7 +30,7 @@ Gem::Specification.new do |spec|
30
30
  spec.add_development_dependency 'minitest', '~> 5.0'
31
31
  spec.add_development_dependency 'minitest-reporters', '~> 1.1'
32
32
  spec.add_development_dependency 'webmock', '~> 3.23.0'
33
- spec.add_development_dependency 'rubocop', '1.63.3'
33
+ spec.add_development_dependency 'rubocop', '1.63.5'
34
34
  spec.add_development_dependency 'appium_thor', '~> 2.0'
35
35
  spec.add_development_dependency 'parallel_tests'
36
36
  spec.add_development_dependency 'simplecov'
@@ -23,6 +23,20 @@ module Appium
23
23
  # Appium's capabilities could change by depending on Appium versions. So it does not have
24
24
  # standard options like chrome and firefox etc. So, the implementation should differ from
25
25
  # other browsers. But here should inherit `Options` to follow Selenium.
26
+
27
+ # Method override
28
+ # FIXME: when we drop "symbolize_keys", this can be removed.
29
+ def convert_key(key)
30
+ case key
31
+ when String
32
+ key.to_s
33
+ when Symbol
34
+ # here do not convert to camel case
35
+ key.to_s
36
+ else
37
+ raise TypeError, "expected String or Symbol, got #{key.inspect}:#{key.class}"
38
+ end
39
+ end
26
40
  end
27
41
  end
28
42
  end
@@ -338,12 +338,6 @@ module Appium
338
338
  def setup_for_new_session(opts = {})
339
339
  @custom_url = opts.delete :url # to set the custom url as :url
340
340
 
341
- # TODO: Remove when we implement Options
342
- # The symbolize_keys is to keep compatiility for the legacy code, which allows capabilities to give 'string' as the key.
343
- # The toplevel `caps`, `capabilities` and `appium_lib` are expected to be symbol.
344
- # FIXME: First, please try to remove `nested: true` to `nested: false`.
345
- opts = Appium.symbolize_keys(opts, nested: true)
346
-
347
341
  @caps = get_caps(opts)
348
342
 
349
343
  set_appium_lib_specific_values(get_appium_lib_opts(opts))
@@ -635,22 +629,27 @@ module Appium
635
629
  opts[:appium_lib] || {}
636
630
  end
637
631
 
632
+ # @private
633
+ def get_app
634
+ @caps[:app] || @caps['app']
635
+ end
636
+
638
637
  # @private
639
638
  # Path to the .apk, .app or .app.zip.
640
639
  # The path can be local, HTTP/S, Windows Share and other path like 'sauce-storage:'.
641
640
  # Use @caps[:app] without modifications if the path isn't HTTP/S or local path.
642
641
  def set_app_path
643
642
  # FIXME: maybe `:app` should check `app` as well.
644
- return unless @caps && @caps[:app] && !@caps[:app].empty?
645
- return if @caps[:app] =~ URI::DEFAULT_PARSER.make_regexp
646
-
647
- app_path = File.expand_path(@caps[:app])
648
- @caps[:app] = if File.exist? app_path
649
- app_path
650
- else
651
- ::Appium::Logger.warn("Use #{@caps[:app]} directly since #{app_path} does not exist.")
652
- @caps[:app]
653
- end
643
+ return unless @caps && get_app && !get_app.empty?
644
+ return if get_app =~ URI::DEFAULT_PARSER.make_regexp
645
+
646
+ app_path = File.expand_path(get_app)
647
+ @caps['app'] = if File.exist? app_path
648
+ app_path
649
+ else
650
+ ::Appium::Logger.warn("Use #{get_app} directly since #{app_path} does not exist.")
651
+ get_app
652
+ end
654
653
  end
655
654
 
656
655
  # @private
@@ -676,7 +675,6 @@ module Appium
676
675
  # @private
677
676
  def set_appium_device
678
677
  # https://code.google.com/p/selenium/source/browse/spec-draft.md?repo=mobile
679
- # TODO: check if the Appium.symbolize_keys(opts, nested: false) enoug with this
680
678
  @device = @caps[:platformName] || @caps['platformName']
681
679
  return @device unless @device
682
680
 
@@ -685,7 +683,6 @@ module Appium
685
683
 
686
684
  # @private
687
685
  def set_automation_name
688
- # TODO: check if the Appium.symbolize_keys(opts, nested: false) enoug with this
689
686
  candidate = @caps[:automationName] || @caps['automationName']
690
687
  @automation_name = candidate if candidate
691
688
  @automation_name = convert_downcase @automation_name if @automation_name
@@ -14,7 +14,7 @@
14
14
 
15
15
  module Appium
16
16
  module Core
17
- VERSION = '8.0.2' unless defined? ::Appium::Core::VERSION
18
- DATE = '2024-04-26' unless defined? ::Appium::Core::DATE
17
+ VERSION = '9.0.0' unless defined? ::Appium::Core::VERSION
18
+ DATE = '2024-05-14' unless defined? ::Appium::Core::DATE
19
19
  end
20
20
  end
@@ -22,15 +22,17 @@ require_relative 'appium_lib_core/element'
22
22
  require_relative 'appium_lib_core/support/event_firing_bridge'
23
23
 
24
24
  module Appium
25
- # @private
26
- #
27
25
  # convert the top level keys to symbols.
28
26
  #
29
27
  # @param [Hash] hash Hash value to make symbolise
28
+ #
29
+ # @example
30
+ # opts = Appium.symbolize_keys(opts)
31
+ #
30
32
  def self.symbolize_keys(hash, nested: false, enable_deprecation_msg: true)
31
33
  # FIXME: As https://github.com/appium/ruby_lib/issues/945, we must remove this implicit string to symbol.
32
34
  # But appium_lib_core's some capability handling expect to be symbol, so we should test to remove
33
- # the mehotds which expect the symbol first.
35
+ # the methods which expect the symbol first.
34
36
  raise ::Appium::Core::Error::ArgumentError, 'symbolize_keys requires a hash' unless hash.is_a? Hash
35
37
 
36
38
  hash.each_with_object({}) do |pair, acc|
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: 8.0.2
4
+ version: 9.0.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: 2024-04-27 00:00:00.000000000 Z
11
+ date: 2024-05-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: selenium-webdriver
@@ -114,14 +114,14 @@ dependencies:
114
114
  requirements:
115
115
  - - '='
116
116
  - !ruby/object:Gem::Version
117
- version: 1.63.3
117
+ version: 1.63.5
118
118
  type: :development
119
119
  prerelease: false
120
120
  version_requirements: !ruby/object:Gem::Requirement
121
121
  requirements:
122
122
  - - '='
123
123
  - !ruby/object:Gem::Version
124
- version: 1.63.3
124
+ version: 1.63.5
125
125
  - !ruby/object:Gem::Dependency
126
126
  name: appium_thor
127
127
  requirement: !ruby/object:Gem::Requirement
@@ -274,7 +274,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
274
274
  - !ruby/object:Gem::Version
275
275
  version: '0'
276
276
  requirements: []
277
- rubygems_version: 3.5.9
277
+ rubygems_version: 3.4.10
278
278
  signing_key:
279
279
  specification_version: 4
280
280
  summary: Minimal Ruby library for Appium.