appium_lib_core 5.1.1 → 5.2.1

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: 7498caac67adf73e6d5a8f7127fe6441eadb7cfa705496e72c616d3c389337c7
4
- data.tar.gz: 851dca60890fa41293cae401d308e43f34d3fe94f49fbbe951407a00dea2a329
3
+ metadata.gz: 42914fcf1c4fd36f73bbbb3bf00bcabee5aff1bb8705769a04a1e2a9ed6ef96f
4
+ data.tar.gz: 6d37810efc95e71bc46a4f1285d88b95072501a9568a244bf380770b72472787
5
5
  SHA512:
6
- metadata.gz: 8a4e1dc7ee2b28b0ccfba5e0255d30370232313d4ae51d36b61fca2d0431cf7617b03696529207c8c8de666fba504491d73d2a6ef28c3f6c5cb5cc1612ae5c9d
7
- data.tar.gz: '09528fb3002fd25934c5f1bd0d539e2b13798701b18803de0bda4410ab8fb7116b1458ef619d0d43050548a2deb57ef86848bc3a9a46ac954551fd93e8bc176f'
6
+ metadata.gz: 8806621b56a1522007cfce465921b68d613f0fe540a6170aab1c24e8f435924234a59a0ccf0cb7f17ffeaf9710fe29a099093acfdaaa432b74903205c0904820
7
+ data.tar.gz: f63c926dcbc2ebde94f593d39268f17e5c26164d7ca10c24feb6ef4df8a9bfccce24d615706601a981765eb48dac701d0262bda962273c3477daf4ca07c1f620
data/CHANGELOG.md CHANGED
@@ -10,6 +10,21 @@ Read `release_notes.md` for commit level details.
10
10
 
11
11
  ### Deprecations
12
12
 
13
+ ## [5.2.0] - 2022-06-19
14
+
15
+ ### Enhancements
16
+
17
+ - Update base Selenium Ruby client to `4.2+`
18
+ - Please call `key_action` or set `[::Selenium::WebDriver::Interactions.key('keyboard')]` as the deviecs parameter to build `driver.send_keys().perform` W3C action.
19
+ - `driver.key_action.send_keys('xxx').perform` instead of `driver.action.send_keys('xxx').perform`, or `driver.action(devices: [::Selenium::WebDriver::Interactions.key('keyboard')]).send_keys('xxx').perform`.
20
+ - [This PR change](https://github.com/appium/ruby_lib_core/pull/381/files) will help to update your some actions.
21
+
22
+ ## [5.1.2] - 2022-06-02
23
+
24
+ ### Enhancements
25
+
26
+ - Limit selenium webdriver version less than `4.2`
27
+
13
28
  ## [5.1.1] - 2022-04-18
14
29
 
15
30
  ### Enhancements
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
  require 'appium_lib_core/version'
5
5
 
6
6
  Gem::Specification.new do |spec|
7
- spec.required_ruby_version = '>= 2.6'
7
+ spec.required_ruby_version = '>= 2.7'
8
8
 
9
9
  spec.name = 'appium_lib_core'
10
10
  spec.version = Appium::Core::VERSION
@@ -22,7 +22,7 @@ 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.0'
25
+ spec.add_runtime_dependency 'selenium-webdriver', '~> 4.2.0'
26
26
  spec.add_runtime_dependency 'faye-websocket', '~> 0.11.0'
27
27
 
28
28
  spec.add_development_dependency 'rake', '~> 13.0'
@@ -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.14.0'
33
- spec.add_development_dependency 'rubocop', '1.27.0'
33
+ spec.add_development_dependency 'rubocop', '1.30.1'
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'
@@ -153,30 +153,26 @@ module Appium
153
153
  execute :status
154
154
  end
155
155
 
156
- # Perform touch actions for W3C module.
156
+ # Perform 'touch' actions for W3C module.
157
157
  # Generate +touch+ pointer action here and users can use this via +driver.action+
158
158
  # - https://seleniumhq.github.io/selenium/docs/api/rb/Selenium/WebDriver/W3CActionBuilder.html
159
159
  # - https://seleniumhq.github.io/selenium/docs/api/rb/Selenium/WebDriver/PointerActions.html
160
160
  # - https://seleniumhq.github.io/selenium/docs/api/rb/Selenium/WebDriver/KeyActions.html
161
161
  #
162
- # The pointer type is 'touch' by default in the Appium Ruby client. (The selenium one is 'mouse')
162
+ # The pointer type is 'touch' by default in the Appium Ruby client.
163
163
  #
164
164
  # @example
165
165
  #
166
166
  # element = @driver.find_element(:id, "some id")
167
167
  # @driver.action.click(element).perform # The 'click' is a part of 'PointerActions'
168
168
  #
169
- def action(async = false)
170
- action_builder = ::Selenium::WebDriver::ActionBuilder.new(
169
+ def action(_deprecated_async = nil, async: false, devices: nil)
170
+ ::Selenium::WebDriver::ActionBuilder.new(
171
171
  self,
172
- ::Selenium::WebDriver::Interactions.pointer(:touch, name: 'touch'),
173
- ::Selenium::WebDriver::Interactions.key('keyboard'),
174
- async
172
+ devices: devices || [::Selenium::WebDriver::Interactions.pointer(:touch, name: 'touch')],
173
+ async: async,
174
+ duration: 50 # milliseconds
175
175
  )
176
- # Used for default duration of each touch actions.
177
- # Override from 250 milliseconds to 50 milliseconds in PointerActions included by ::Selenium::WebDriver::ActionBuilder
178
- action_builder.default_move_duration = 0.05
179
- action_builder
180
176
  end
181
177
 
182
178
  # Port from MJSONWP
@@ -181,6 +181,31 @@ module Appium
181
181
 
182
182
  ### Methods for Appium
183
183
 
184
+ # Perform 'key' actions for W3C module.
185
+ # Generate +key+ pointer action here and users can use this via +driver.key_action+
186
+ # - https://seleniumhq.github.io/selenium/docs/api/rb/Selenium/WebDriver/W3CActionBuilder.html
187
+ # - https://seleniumhq.github.io/selenium/docs/api/rb/Selenium/WebDriver/KeyActions.html
188
+ #
189
+ # The pointer type is 'key' by default in the Appium Ruby client.
190
+ # +driver.action+ in Appium Ruby client has 'pointer' action by default.
191
+ # This method is a shortcut to set 'key' type.
192
+ # Hense this method is equal to +driver.action(devices: [::Selenium::WebDriver::Interactions.key('keyboard')])+
193
+ # as below example.
194
+ #
195
+ # @example
196
+ #
197
+ # element = @driver.find_element(:id, "some id")
198
+ # @driver.key_action.send_key('hiあ').perform # The 'send_key' is a part of 'KeyActions'
199
+ # # is equal to:
200
+ # # @driver.action(devices: [::Selenium::WebDriver::Interactions.key('keyboard')]).send_keys('hiあ').perform
201
+ #
202
+ def key_action(async: false)
203
+ @bridge.action(
204
+ async: async,
205
+ devices: [::Selenium::WebDriver::Interactions.key('keyboard')]
206
+ )
207
+ end
208
+
184
209
  # Lock the device
185
210
  # @return [String]
186
211
  #
@@ -76,6 +76,13 @@ module Appium
76
76
  path: 'directConnectPath'
77
77
  }.freeze
78
78
 
79
+ W3C_KEYS = {
80
+ protocol: 'appium:directConnectProtocol',
81
+ host: 'appium:directConnectHost',
82
+ port: 'appium:directConnectPort',
83
+ path: 'appium:directConnectPath'
84
+ }.freeze
85
+
79
86
  # @return [string] Returns a protocol such as http/https
80
87
  attr_reader :protocol
81
88
 
@@ -89,10 +96,10 @@ module Appium
89
96
  attr_reader :path
90
97
 
91
98
  def initialize(capabilities)
92
- @protocol = capabilities[KEYS[:protocol]]
93
- @host = capabilities[KEYS[:host]]
94
- @port = capabilities[KEYS[:port]]
95
- @path = capabilities[KEYS[:path]]
99
+ @protocol = capabilities[W3C_KEYS[:protocol]] || capabilities[KEYS[:protocol]]
100
+ @host = capabilities[W3C_KEYS[:host]] || capabilities[KEYS[:host]]
101
+ @port = capabilities[W3C_KEYS[:port]] || capabilities[KEYS[:port]]
102
+ @path = capabilities[W3C_KEYS[:path]] || capabilities[KEYS[:path]]
96
103
  end
97
104
  end
98
105
 
@@ -175,7 +182,8 @@ module Appium
175
182
  # - <code>directConnectPort</code>
176
183
  # - <code>directConnectPath</code>
177
184
  #
178
- # Ignore them if this parameter is <code>false</code>. Defaults to true.
185
+ # ignore them if this parameter is <code>false</code>. Defaults to true.
186
+ # These keys can have <code>appium:</code> prefix.
179
187
  #
180
188
  # @return [Bool]
181
189
  attr_reader :direct_connect
@@ -14,7 +14,7 @@
14
14
 
15
15
  module Appium
16
16
  module Core
17
- VERSION = '5.1.1' unless defined? ::Appium::Core::VERSION
18
- DATE = '2022-04-18' unless defined? ::Appium::Core::DATE
17
+ VERSION = '5.2.1' unless defined? ::Appium::Core::VERSION
18
+ DATE = '2022-06-24' 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.1.1
4
+ version: 5.2.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: 2022-04-19 00:00:00.000000000 Z
11
+ date: 2022-06-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: selenium-webdriver
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '4.0'
19
+ version: 4.2.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '4.0'
26
+ version: 4.2.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: faye-websocket
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -114,14 +114,14 @@ dependencies:
114
114
  requirements:
115
115
  - - '='
116
116
  - !ruby/object:Gem::Version
117
- version: 1.27.0
117
+ version: 1.30.1
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.27.0
124
+ version: 1.30.1
125
125
  - !ruby/object:Gem::Dependency
126
126
  name: appium_thor
127
127
  requirement: !ruby/object:Gem::Requirement
@@ -274,7 +274,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
274
274
  requirements:
275
275
  - - ">="
276
276
  - !ruby/object:Gem::Version
277
- version: '2.6'
277
+ version: '2.7'
278
278
  required_rubygems_version: !ruby/object:Gem::Requirement
279
279
  requirements:
280
280
  - - ">="