appium_lib_core 5.0.0.rc3 → 5.0.0.rc4
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 +7 -4
- data/appium_lib_core.gemspec +1 -1
- data/docs/mobile_command.md +1 -2
- data/lib/appium_lib_core/common/base/bridge.rb +2 -4
- data/lib/appium_lib_core/common/base/driver.rb +1 -18
- data/lib/appium_lib_core/common/base/screenshot.rb +2 -3
- data/lib/appium_lib_core/common/touch_action/touch_actions.rb +1 -4
- data/lib/appium_lib_core/driver.rb +0 -15
- data/lib/appium_lib_core/element.rb +9 -0
- data/lib/appium_lib_core/version.rb +2 -2
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a9d42fc1cfc7efb703d6e7167fc465618d4991491d19f1e8c2d9f3c929206efc
|
4
|
+
data.tar.gz: eeec123ea6356e9a3446ac1c17dd18e234b8ea2a8c5bb0a7d40b31685e7e28b9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2c9f68c96d74c47ee00c86bfd858ffdc7460b33534405a4033c33bb8166ecaa3f380093b436bf0a49de2b7f2b3cf1ef1d18ef393898f294e7cea694cdc6b3580
|
7
|
+
data.tar.gz: ba381f9b52b595e6e25569300803dbb55de0ce076132ca0db5903321554dd8ca2c6bb4ad9caf8a89e7b1e936aa3e34b7174f80f0315ddfa1f4732a84932c0502
|
data/CHANGELOG.md
CHANGED
@@ -11,14 +11,17 @@ Read `release_notes.md` for commit level details.
|
|
11
11
|
|
12
12
|
### Deprecations
|
13
13
|
|
14
|
-
## [5.0.0
|
14
|
+
## [5.0.0]
|
15
15
|
|
16
|
-
- Update base selenium webdriver version to `4.0.0
|
16
|
+
- Update base selenium webdriver version to `4.0.0`
|
17
17
|
- Support only W3C spec
|
18
18
|
- Support Ruby 2.5+
|
19
19
|
- Raises `::Appium::Core::Error::ArgumentError` instead of `ArgumentError` for this library specific argument errors
|
20
|
-
- Removed `desired_capabilities` from capabilities. Please use `capabilities` instead.
|
21
|
-
- `element.
|
20
|
+
- Removed `desired_capabilities` from capabilities. Please use `capabilities` key name instead.
|
21
|
+
- `element.id` returns the element id instead of `element.ref`
|
22
|
+
- Removed `driver#screenshot`. Please use `driver#save_screenshot` instead.
|
23
|
+
- Remove `driver#send_keys` to send keys to an active element. Please use `driver.action.send_keys('happy testing').perform` instead.
|
24
|
+
- No longer set default `timeouts` as `0`. ruby_lib_core calls `/timeouts` endpoint only when `appium_lib: { wait: 5 }` is provided explicitly.
|
22
25
|
|
23
26
|
## [4.7.0] - 2021-07-17
|
24
27
|
|
data/appium_lib_core.gemspec
CHANGED
@@ -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.0
|
25
|
+
spec.add_runtime_dependency 'selenium-webdriver', '~> 4.0.0'
|
26
26
|
spec.add_runtime_dependency 'faye-websocket', '~> 0.11.0'
|
27
27
|
|
28
28
|
spec.add_development_dependency 'bundler', '>= 1.14'
|
data/docs/mobile_command.md
CHANGED
@@ -28,8 +28,7 @@ To handle it, we would recommend you to handle the error based on the error mess
|
|
28
28
|
|
29
29
|
```ruby
|
30
30
|
error = assert_raises ::Selenium::WebDriver::Error::UnknownError do
|
31
|
-
|
32
|
-
@driver.execute_script 'mobile: scrollToPage', { element: element_id, scrollToPage: -100 }
|
31
|
+
@driver.execute_script 'mobile: scrollToPage', { element: el.id, scrollToPage: -100 }
|
33
32
|
end
|
34
33
|
assert error.message.include? 'be a non-negative integer'
|
35
34
|
```
|
@@ -207,8 +207,7 @@ module Appium
|
|
207
207
|
# For W3C
|
208
208
|
# https://github.com/SeleniumHQ/selenium/commit/b618499adcc3a9f667590652c5757c0caa703289
|
209
209
|
# execute_atom :isDisplayed, element
|
210
|
-
|
211
|
-
execute :is_element_displayed, id: element_id
|
210
|
+
execute :is_element_displayed, id: element.id
|
212
211
|
end
|
213
212
|
|
214
213
|
# For Appium
|
@@ -216,8 +215,7 @@ module Appium
|
|
216
215
|
def element_attribute(element, name)
|
217
216
|
# For W3C in Selenium Client
|
218
217
|
# execute_atom :getAttribute, element, name
|
219
|
-
|
220
|
-
execute :get_element_attribute, id: element_id, name: name
|
218
|
+
execute :get_element_attribute, id: element.id, name: name
|
221
219
|
end
|
222
220
|
|
223
221
|
# For Appium
|
@@ -159,8 +159,7 @@ module Appium
|
|
159
159
|
# # ':session_id' in the given url is replaced with current 'session id'.
|
160
160
|
# # ':id' in the given url is replaced with the given 'element_id'.
|
161
161
|
# e = @driver.find_element :accessibility_id, 'an element'
|
162
|
-
#
|
163
|
-
# @driver.test_action_command(element_id, 'action')
|
162
|
+
# @driver.test_action_command(e.id, 'action')
|
164
163
|
#
|
165
164
|
def add_command(method:, url:, name:, &block)
|
166
165
|
unless AVAILABLE_METHODS.include? method
|
@@ -239,22 +238,6 @@ module Appium
|
|
239
238
|
end
|
240
239
|
alias is_keyboard_shown keyboard_shown?
|
241
240
|
|
242
|
-
# [DEPRECATION]
|
243
|
-
# Send keys for a current active element
|
244
|
-
# @param [String] key Input text
|
245
|
-
#
|
246
|
-
# @example
|
247
|
-
#
|
248
|
-
# @driver.send_keys 'happy testing!'
|
249
|
-
#
|
250
|
-
def send_keys(*key)
|
251
|
-
::Appium::Logger.warn(
|
252
|
-
'[DEPRECATION] Driver#send_keys is deprecated in W3C spec. Use driver.action.<command>.perform instead'
|
253
|
-
)
|
254
|
-
@bridge.send_keys_to_active_element(key)
|
255
|
-
end
|
256
|
-
alias type send_keys
|
257
|
-
|
258
241
|
# Returns an instance of DriverSettings to call get/update.
|
259
242
|
#
|
260
243
|
# @example
|
@@ -82,12 +82,11 @@ module Appium
|
|
82
82
|
# @@driver.element_screenshot_as element, :base64 #=> "iVBORw0KGgoAAAANSUhEUgAABDgAAAB+CAIAAABOPDa6AAAAAX"
|
83
83
|
#
|
84
84
|
def element_screenshot_as(element, format)
|
85
|
-
_, element_id = element.ref
|
86
85
|
case format
|
87
86
|
when :base64
|
88
|
-
bridge.element_screenshot
|
87
|
+
bridge.element_screenshot element.id
|
89
88
|
when :png
|
90
|
-
bridge.element_screenshot(
|
89
|
+
bridge.element_screenshot(element.id).unpack('m')[0]
|
91
90
|
else
|
92
91
|
raise Core::Error::UnsupportedOperationError, "unsupported format: #{format.inspect}"
|
93
92
|
end
|
@@ -195,10 +195,7 @@ module Appium
|
|
195
195
|
end
|
196
196
|
|
197
197
|
def args_with_ele_ref(args)
|
198
|
-
if args.key? :element
|
199
|
-
_, element_id = args[:element].ref
|
200
|
-
args[:element] = element_id
|
201
|
-
end
|
198
|
+
args[:element] = args[:element].id if args.key? :element
|
202
199
|
args
|
203
200
|
end
|
204
201
|
end # class TouchAction
|
@@ -476,21 +476,6 @@ module Appium
|
|
476
476
|
p_version.split('.').map(&:to_i)
|
477
477
|
end
|
478
478
|
|
479
|
-
# Takes a png screenshot and saves to the target path.
|
480
|
-
#
|
481
|
-
# @param png_save_path [String] the full path to save the png
|
482
|
-
# @return [File]
|
483
|
-
#
|
484
|
-
# @example
|
485
|
-
#
|
486
|
-
# @core.screenshot '/tmp/hi.png' #=> nil
|
487
|
-
# # same as '@driver.save_screenshot png_save_path'
|
488
|
-
#
|
489
|
-
def screenshot(png_save_path)
|
490
|
-
::Appium::Logger.warn '[DEPRECATION] screenshot will be removed. Please use driver.save_screenshot instead.'
|
491
|
-
@driver.save_screenshot png_save_path
|
492
|
-
end
|
493
|
-
|
494
479
|
private
|
495
480
|
|
496
481
|
# @private
|
@@ -20,6 +20,15 @@ module Appium
|
|
20
20
|
include ::Appium::Core::Base::SearchContext
|
21
21
|
include ::Appium::Core::Base::TakesScreenshot
|
22
22
|
|
23
|
+
# Retuns the element id.
|
24
|
+
#
|
25
|
+
# @return [String]
|
26
|
+
# @example
|
27
|
+
# e = @driver.find_element :accessibility_id, 'something'
|
28
|
+
# e.id
|
29
|
+
#
|
30
|
+
attr_reader :id
|
31
|
+
|
23
32
|
# Returns the value of attributes like below. Read each platform to know more details.
|
24
33
|
#
|
25
34
|
# uiautomator2: https://github.com/appium/appium-uiautomator2-server/blob/203cc7e57ce477f3cff5d95b135d1b3450a6033a/app/src/main/java/io/appium/uiautomator2/utils/Attribute.java#L19
|
@@ -14,7 +14,7 @@
|
|
14
14
|
|
15
15
|
module Appium
|
16
16
|
module Core
|
17
|
-
VERSION = '5.0.0.
|
18
|
-
DATE = '2021-10-
|
17
|
+
VERSION = '5.0.0.rc4' unless defined? ::Appium::Core::VERSION
|
18
|
+
DATE = '2021-10-14' unless defined? ::Appium::Core::DATE
|
19
19
|
end
|
20
20
|
end
|
metadata
CHANGED
@@ -1,29 +1,29 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: appium_lib_core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 5.0.0.
|
4
|
+
version: 5.0.0.rc4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kazuaki MATSUO
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-10-
|
11
|
+
date: 2021-10-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: selenium-webdriver
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 4.0.0
|
19
|
+
version: 4.0.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.0
|
26
|
+
version: 4.0.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: faye-websocket
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|