appium_lib_core 14.1.0 → 14.2.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9359ffb00a01237b935e603c3fc243e2373ed523f4ff0d10596f0292650a95f0
4
- data.tar.gz: 3a0d4e1cc70b21d2cd6784c107e373541016728d5c05680bee6eca6831a5964f
3
+ metadata.gz: d7ae5f85685e3c0d36e111b188590f6393c1a6f98623858dc90cfff728e962c0
4
+ data.tar.gz: 7b33cf72cdf1c461f222cc5d57f8969670009f909b5ec9b875bd35e9384941d3
5
5
  SHA512:
6
- metadata.gz: e9d170db8ea667b1d17973c7d5f732daf505acae8e8532b89635c65226d673d23c970f18e368d76853027aa7d078c8c5963b0b98daf6fad16b6e68ccdeaed1e1
7
- data.tar.gz: fe35e3471d8db66d5799e75d16f6f52e781dd9ec85c5a955bca6aef562ba2978760411ee55779d4c2fb170b430f22b53319a5023349d6e26558eb238ba2d642d
6
+ metadata.gz: 73f19222727e08b71323a056c04c4e9679eb2a4c6a464e1473ed9cb5f5f6246d69832a4d24837fe6e71a09f20498272e2116c1eb15a6392faef06ec2168bffaa
7
+ data.tar.gz: 7e7b2b442894d35d29fb8974d5e4b201a9507d9fa3f6e4a59a3b287ce2c0140fe2019e01e5f2180869aa4af92e5c26b89aaf4ee0c8df676f16eed88cc7d2d853
data/CHANGELOG.md CHANGED
@@ -117,6 +117,13 @@ relax the core version constraint. Applications using
117
117
  `appium_console` or `appium_capybara` through `appium_lib` should upgrade with that
118
118
  compatible release. Direct users of `appium_lib_core` can migrate as described above.
119
119
 
120
+ ## [14.2.0](https://github.com/appium/ruby_lib_core/compare/v14.1.0...v14.2.0) (2026-11-26)
121
+
122
+
123
+ ### Features
124
+
125
+ * support Appium 4 while retaining Appium 3 compatibility ([#745](https://github.com/appium/ruby_lib_core/issues/745)) ([4057608](https://github.com/appium/ruby_lib_core/commit/405760898bc32d9cfffe0cc62e6b69dbb5f623eb))
126
+
120
127
  ## [14.1.0](https://github.com/appium/ruby_lib_core/compare/v14.0.0...v14.1.0) (2026-11-24)
121
128
 
122
129
 
data/README.md CHANGED
@@ -14,8 +14,7 @@ This library wraps [selenium-webdriver](https://github.com/SeleniumHQ/selenium/w
14
14
 
15
15
  - https://www.rubydoc.info/gems/appium_lib_core
16
16
  - You can find working API examples in test code, [test/functional](test/functional)
17
- - Appium 2.0
18
- - https://appium.github.io/appium/docs/en/2.0/ (Not completed yet)
17
+ - [Migrating to Appium 4](https://appium.io/docs/en/latest/guides/migrating-3-to-4/)
19
18
 
20
19
  # Migration from v13 to v14
21
20
 
@@ -58,14 +57,17 @@ $ UNIT_TEST=1 bundle exec rake test:unit
58
57
  ### Functional Tests
59
58
  Run functional tests which require the Appium server and real device, Simulator/Emulator.
60
59
 
61
- - Start Appium server (Appium 2.0 base)
60
+ - Start an Appium 4 server
62
61
  ```bash
63
- $ npm install --location=global appium
62
+ $ npm install --location=global appium@4
64
63
  $ appium driver install xcuitest
65
64
  $ appium driver install uiautomator2 # etc
66
65
  $ appium --relaxed-security # To run all tests in local
67
66
  ```
68
67
 
68
+ With Appium 4, use the WinCore driver (`appium driver install wincore`) for Windows sessions.
69
+ Set `automationName` to `Wincore`. Event timings are available through `driver.logs.events`.
70
+
69
71
  - Conduct tests
70
72
  ```bash
71
73
  $ bundle install
@@ -44,6 +44,10 @@ module Appium
44
44
  # Prefix for extra capability defined by W3C
45
45
  APPIUM_PREFIX = 'appium:'
46
46
 
47
+ STANDARD_CAPABILITY_NAMES = ::Appium::Core::Base::Capabilities::KNOWN.to_h do |key|
48
+ [key.to_s, ::Appium::Core::Base::Capabilities.camel_case(key)]
49
+ end.freeze
50
+
47
51
  # No 'browserName' means the session is native appium connection
48
52
  APPIUM_NATIVE_BROWSER_NAME = 'appium'
49
53
 
@@ -154,6 +158,13 @@ module Appium
154
158
  bidi.ws # steep:ignore
155
159
  end
156
160
 
161
+ # Selenium 4.46 accesses generated BiDi commands through a transport.
162
+ if ::Selenium::WebDriver::Remote::Bridge.method_defined?(:transport)
163
+ def transport
164
+ ::Selenium::WebDriver::BiDi::Transport.new(connection) # steep:ignore
165
+ end
166
+ end
167
+
157
168
  # Override
158
169
  def quit
159
170
  super
@@ -178,7 +189,13 @@ module Appium
178
189
 
179
190
  capabilities.each do |name, value|
180
191
  capability_name = name.to_s
181
- w3c_name = extension_prefix?(capability_name) ? name : "#{APPIUM_PREFIX}#{capability_name}"
192
+ w3c_name = if STANDARD_CAPABILITY_NAMES.key?(capability_name)
193
+ STANDARD_CAPABILITY_NAMES.fetch(capability_name)
194
+ elsif STANDARD_CAPABILITY_NAMES.value?(capability_name) || capability_name.include?(':')
195
+ name
196
+ else
197
+ "#{APPIUM_PREFIX}#{capability_name}"
198
+ end
182
199
 
183
200
  w3c_capabilities[w3c_name] = value
184
201
  end
@@ -216,20 +233,6 @@ module Appium
216
233
  end
217
234
  end
218
235
 
219
- def camel_case(str_or_sym)
220
- str_or_sym.to_s.gsub(/_([a-z])/) { Regexp.last_match(1)&.upcase }
221
- end
222
-
223
- def extension_prefix?(capability_name)
224
- snake_cased_capability_names = ::Appium::Core::Base::Capabilities::KNOWN.map(&:to_s)
225
- camel_cased_capability_names = snake_cased_capability_names.map { |v| camel_case(v) }
226
-
227
- # Check 'EXTENSION_CAPABILITY_PATTERN'
228
- snake_cased_capability_names.include?(capability_name) ||
229
- camel_cased_capability_names.include?(capability_name) ||
230
- capability_name.match(':')
231
- end
232
-
233
236
  def json_create(value)
234
237
  ::Appium::Core::Base::Capabilities.json_create(value)
235
238
  end
@@ -30,9 +30,9 @@ require_relative 'device/execute_driver'
30
30
  require_relative 'device/orientation'
31
31
 
32
32
  # The following files have selenium-webdriver related stuff.
33
+ require_relative 'base/capabilities'
33
34
  require_relative 'base/bridge'
34
35
  require_relative 'base/driver'
35
- require_relative 'base/capabilities'
36
36
  require_relative 'base/http_default'
37
37
  require_relative 'base/search_context'
38
38
  require_relative 'base/platform'
@@ -716,7 +716,7 @@ module Appium
716
716
  # @private
717
717
  def set_appium_device
718
718
  # https://code.google.com/p/selenium/source/browse/spec-draft.md?repo=mobile
719
- @device = get_cap 'platformName'
719
+ @device = get_cap('platformName') || @caps[:platform_name] || @caps['platform_name']
720
720
  return unless @device
721
721
 
722
722
  @device = convert_to_symbol(convert_downcase(@device))
@@ -14,7 +14,7 @@
14
14
 
15
15
  module Appium
16
16
  module Core
17
- VERSION = '14.1.0' unless defined? ::Appium::Core::VERSION
18
- DATE = '2026-11-24' unless defined? ::Appium::Core::DATE # x-release-please-date
17
+ VERSION = '14.2.0' unless defined? ::Appium::Core::VERSION
18
+ DATE = '2026-11-26' unless defined? ::Appium::Core::DATE # x-release-please-date
19
19
  end
20
20
  end
@@ -6,7 +6,7 @@ module Selenium
6
6
  def []: (untyped key) -> untyped
7
7
  def []=: (untyped key, untyped value) -> untyped
8
8
 
9
- # Add this:
9
+ def self.camel_case: (String | Symbol key) -> String
10
10
  def self.json_create: (Hash[untyped, untyped] value) -> Capabilities
11
11
  end
12
12
  end
@@ -8,6 +8,8 @@ module Appium
8
8
  class Bridge < ::Selenium::WebDriver::Remote::Bridge
9
9
  include _Bridge
10
10
 
11
+ STANDARD_CAPABILITY_NAMES: Hash[String, String]
12
+
11
13
  @browser: untyped
12
14
 
13
15
  @session_id: untyped
@@ -102,6 +104,8 @@ module Appium
102
104
 
103
105
  def connection: () -> untyped
104
106
 
107
+ def transport: () -> untyped
108
+
105
109
  def quit: () -> untyped
106
110
 
107
111
  def close: () -> untyped
@@ -121,10 +125,6 @@ module Appium
121
125
 
122
126
  def selenium_bridge_accepts_url?: () -> bool
123
127
 
124
- def camel_case: (untyped str_or_sym) -> untyped
125
-
126
- def extension_prefix?: (untyped capability_name) -> untyped
127
-
128
128
  def json_create: (untyped value) -> untyped
129
129
 
130
130
  public
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: appium_lib_core
3
3
  version: !ruby/object:Gem::Version
4
- version: 14.1.0
4
+ version: 14.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kazuaki MATSUO