appium_lib 16.5.1 → 17.0.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 +39 -0
- data/appium_lib.gemspec +1 -1
- data/lib/appium_lib/common/wait.rb +21 -2
- data/lib/appium_lib/driver.rb +18 -9
- data/lib/appium_lib/version.rb +2 -2
- metadata +5 -5
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 98f193ad9f280e34adbf803b220caaec60be713503d6b764306866a60ff43d54
|
|
4
|
+
data.tar.gz: 71e9a52adf35a5ae80873e38ee088b905cc6adff33904000483140c27521b9dc
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 6f718257f93655180f485d1c977b27f21d7a828aac30730b770b946f1334839c54e4ad301943926879ee655df74c6b93e885f7f36db905f2821f08a9cdaeea6e
|
|
7
|
+
data.tar.gz: ad0b3369e54081ec7cec6cdc84883993599d25037e9967a14e621b8b3e8cd1709fced292e4fdb33f5ba4db2a4d67d648b3c510f1599a0654ad36ac01808e8ee8
|
data/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,45 @@ New entries are maintained by Release Please.
|
|
|
4
4
|
|
|
5
5
|
Release tags are https://github.com/appium/ruby_lib/releases .
|
|
6
6
|
|
|
7
|
+
### Upgrading to core 14 (unreleased)
|
|
8
|
+
|
|
9
|
+
This library requires `appium_lib_core >= 14.0.0, < 15.0`.
|
|
10
|
+
|
|
11
|
+
- `wait` and `wait_true` now retry only `Selenium::WebDriver::Error::NoSuchElementError`
|
|
12
|
+
by default. Other errors, including assertion failures and interruptions, propagate
|
|
13
|
+
immediately. Use `ignored: [SomeTransientError]` to choose retryable exceptions;
|
|
14
|
+
this replaces the default list. Use `ignored: []` to disable exception retries.
|
|
15
|
+
`wait` still accepts false or nil results, while `wait_true` requires a truthy result.
|
|
16
|
+
- `Appium::Driver` continues to support `appium_lib: { wait: seconds }`, `default_wait`,
|
|
17
|
+
`no_wait`, and `set_wait`. The wrapper applies a configured implicit wait after each
|
|
18
|
+
session starts. Without that option, it sends no implicit-timeout command.
|
|
19
|
+
Direct `Appium::Core` users must configure `driver.manage.timeouts.implicit_wait`
|
|
20
|
+
themselves. `wait_timeout` controls explicit waits, not implicit waits.
|
|
21
|
+
- `element_screenshot` and `take_element_screenshot` remain available on
|
|
22
|
+
`Appium::Driver`; they now use core's `save_element_screenshot`.
|
|
23
|
+
- Replace `element.location_rel(driver)` with `element.rect`. To calculate the
|
|
24
|
+
center relative to the window, use `(rect.x + rect.width / 2.0) / window.width`
|
|
25
|
+
and `(rect.y + rect.height / 2.0) / window.height`.
|
|
26
|
+
- `Appium.symbolize_keys` is removed. Use symbol keys for client options or Ruby's
|
|
27
|
+
`transform_keys(&:to_sym)` where appropriate. The wrapper accepts string client
|
|
28
|
+
option keys without converting capability keys or nested capability values.
|
|
29
|
+
- Custom server responses must use the W3C element key
|
|
30
|
+
`element-6066-11e4-a52e-4f735466cecf`; legacy `ELEMENT` references are no longer supported.
|
|
31
|
+
|
|
32
|
+
See the [core 14 migration notes](https://github.com/appium/ruby_lib_core/blob/v14.0.0/CHANGELOG.md)
|
|
33
|
+
for changes affecting direct core API usage.
|
|
34
|
+
|
|
35
|
+
## [17.0.0](https://github.com/appium/ruby_lib/compare/v16.5.1...v17.0.0) (2026-11-21)
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
### ⚠ BREAKING CHANGES
|
|
39
|
+
|
|
40
|
+
* upgrade appium_lib_core to 14 ([#1151](https://github.com/appium/ruby_lib/issues/1151))
|
|
41
|
+
|
|
42
|
+
### Features
|
|
43
|
+
|
|
44
|
+
* upgrade appium_lib_core to 14 ([#1151](https://github.com/appium/ruby_lib/issues/1151)) ([727f986](https://github.com/appium/ruby_lib/commit/727f986baa4e804310a82c77166324a22ee669b3))
|
|
45
|
+
|
|
7
46
|
## [16.5.1](https://github.com/appium/ruby_lib/compare/v16.5.0...v16.5.1) (2026-11-06)
|
|
8
47
|
|
|
9
48
|
|
data/appium_lib.gemspec
CHANGED
|
@@ -16,7 +16,7 @@ Gem::Specification.new do |s|
|
|
|
16
16
|
s.homepage = 'https://github.com/appium/ruby_lib' # published as appium_lib
|
|
17
17
|
s.require_paths = ['lib']
|
|
18
18
|
|
|
19
|
-
s.add_dependency 'appium_lib_core', '>=
|
|
19
|
+
s.add_dependency 'appium_lib_core', '>= 14.0.0', '< 15.0'
|
|
20
20
|
s.add_dependency 'nokogiri', '~> 1.8', '>= 1.8.1'
|
|
21
21
|
s.add_dependency 'ostruct', '~> 0.6'
|
|
22
22
|
s.add_dependency 'tomlrb', '>= 1.1', '< 4.0'
|
|
@@ -34,13 +34,22 @@ module Appium
|
|
|
34
34
|
# @option opts [Numeric] :timeout Seconds to wait before timing out. Set default by `appium_wait_timeout` (30).
|
|
35
35
|
# @option opts [Numeric] :interval Seconds to sleep between polls. Set default by `appium_wait_interval` (0.5).
|
|
36
36
|
# @option opts [String] :message Exception message if timed out.
|
|
37
|
-
# @option opts [Array
|
|
37
|
+
# @option opts [Array<Class>, Class] :ignored Exceptions to retry (default: Selenium::WebDriver::Error::NoSuchElementError)
|
|
38
38
|
#
|
|
39
39
|
# @example
|
|
40
40
|
#
|
|
41
41
|
# wait_true(timeout: 20, interval: 0.2, message: 'custom message') { button_exact('Back') }.click
|
|
42
42
|
# wait_true(20) { button_exact('Back') }.click
|
|
43
43
|
#
|
|
44
|
+
# @example Retrying Minitest assertions with core 14+
|
|
45
|
+
#
|
|
46
|
+
# # Assertion failures propagate immediately by default.
|
|
47
|
+
# # ignored replaces the default list; include NoSuchElementError to keep retrying missing elements.
|
|
48
|
+
# wait_true(ignored: [Minitest::Assertion, Selenium::WebDriver::Error::NoSuchElementError]) do
|
|
49
|
+
# assert_equal 'Ready', find_element(:accessibility_id, 'status').text
|
|
50
|
+
# true # wait_true requires a truthy result after the assertion succeeds.
|
|
51
|
+
# end
|
|
52
|
+
#
|
|
44
53
|
def wait_true(opts = {})
|
|
45
54
|
opts = { timeout: opts } if opts.is_a? Numeric
|
|
46
55
|
|
|
@@ -63,13 +72,23 @@ module Appium
|
|
|
63
72
|
# @option opts [Numeric] :timeout Seconds to wait before timing out. Set default by `appium_wait_timeout` (30).
|
|
64
73
|
# @option opts [Numeric] :interval Seconds to sleep between polls. Set default by `appium_wait_interval` (0.5).
|
|
65
74
|
# @option opts [String] :message Exception message if timed out.
|
|
66
|
-
# @option opts [Array
|
|
75
|
+
# @option opts [Array<Class>, Class] :ignored Exceptions to retry (default: Selenium::WebDriver::Error::NoSuchElementError)
|
|
67
76
|
#
|
|
68
77
|
# @example
|
|
69
78
|
#
|
|
70
79
|
# wait(timeout: 20, interval: 0.2, message: 'custom message') { button_exact('Back') }.click
|
|
71
80
|
# wait(20) { button_exact('Back') }.click
|
|
72
81
|
#
|
|
82
|
+
# @example Retrying Minitest assertions with core 14+
|
|
83
|
+
#
|
|
84
|
+
# # This fails immediately if the assertion fails; it no longer retries automatically.
|
|
85
|
+
# wait { assert_equal 'Ready', find_element(:accessibility_id, 'status').text }
|
|
86
|
+
#
|
|
87
|
+
# # ignored replaces the default list; include NoSuchElementError to keep retrying missing elements.
|
|
88
|
+
# wait(ignored: [Minitest::Assertion, Selenium::WebDriver::Error::NoSuchElementError]) do
|
|
89
|
+
# assert_equal 'Ready', find_element(:accessibility_id, 'status').text
|
|
90
|
+
# end
|
|
91
|
+
#
|
|
73
92
|
def wait(opts = {})
|
|
74
93
|
opts = { timeout: opts } if opts.is_a? Numeric
|
|
75
94
|
if opts.is_a? Hash
|
data/lib/appium_lib/driver.rb
CHANGED
|
@@ -48,7 +48,7 @@ module Appium
|
|
|
48
48
|
# `ruby_lib_core` (see appium/ruby_lib_core#97). Defining them here lets
|
|
49
49
|
# `ruby_lib_core` eventually drop that list.
|
|
50
50
|
CORE_BRIDGE_METHODS = %i[
|
|
51
|
-
|
|
51
|
+
save_element_screenshot save_viewport_screenshot
|
|
52
52
|
lock device_locked? unlock
|
|
53
53
|
hide_keyboard is_keyboard_shown
|
|
54
54
|
ime_activate ime_available_engines ime_active_engine ime_activated ime_deactivate
|
|
@@ -208,15 +208,17 @@ module Appium
|
|
|
208
208
|
|
|
209
209
|
$driver&.driver_quit if global_driver
|
|
210
210
|
|
|
211
|
+
opts = opts.transform_keys { |key| key.is_a?(String) ? key.to_sym : key }
|
|
212
|
+
appium_lib_opts = (opts[:appium_lib] || {}).transform_keys { |key| key.is_a?(String) ? key.to_sym : key }
|
|
213
|
+
opts[:appium_lib] = appium_lib_opts
|
|
211
214
|
@core = ::Appium::Core.for(opts)
|
|
212
215
|
extend ::Appium::Core::Device
|
|
213
216
|
|
|
214
|
-
opts = Appium.symbolize_keys opts
|
|
215
|
-
appium_lib_opts = opts[:appium_lib] || {}
|
|
216
|
-
|
|
217
217
|
@caps = @core.caps
|
|
218
218
|
@custom_url = @core.custom_url
|
|
219
|
-
|
|
219
|
+
# Core 14 no longer manages implicit waits; keep the wrapper's wait option.
|
|
220
|
+
@implicit_wait = appium_lib_opts[:wait]
|
|
221
|
+
@default_wait = @implicit_wait || 0
|
|
220
222
|
@appium_port = @core.port
|
|
221
223
|
@appium_wait_timeout = @core.wait_timeout
|
|
222
224
|
@appium_wait_interval = @core.wait_interval
|
|
@@ -490,10 +492,15 @@ module Appium
|
|
|
490
492
|
# @param [String] png_save_path the full path to save the png
|
|
491
493
|
# @return [File]
|
|
492
494
|
def element_screenshot(element, png_save_path)
|
|
493
|
-
@driver&.
|
|
495
|
+
@driver&.save_element_screenshot element, png_save_path
|
|
494
496
|
nil
|
|
495
497
|
end
|
|
496
498
|
|
|
499
|
+
# Compatibility name retained by appium_lib after its removal from core 14.
|
|
500
|
+
def take_element_screenshot(element, png_save_path)
|
|
501
|
+
save_element_screenshot(element, png_save_path)
|
|
502
|
+
end
|
|
503
|
+
|
|
497
504
|
# Quits the driver
|
|
498
505
|
# @return [void]
|
|
499
506
|
def driver_quit
|
|
@@ -590,6 +597,7 @@ module Appium
|
|
|
590
597
|
read_timeout: 999_999
|
|
591
598
|
})
|
|
592
599
|
@http_client = @core.http_client
|
|
600
|
+
set_implicit_wait(@implicit_wait) unless @implicit_wait.nil?
|
|
593
601
|
|
|
594
602
|
# if automation_name was nil before start_driver, then re-extend driver specific methods
|
|
595
603
|
# to be able to extend correctly.
|
|
@@ -600,14 +608,15 @@ module Appium
|
|
|
600
608
|
@driver
|
|
601
609
|
end
|
|
602
610
|
|
|
603
|
-
#
|
|
611
|
+
# Preserve core 13's handling of drivers without implicit-wait support.
|
|
604
612
|
def set_implicit_wait(wait)
|
|
605
613
|
@driver.manage.timeouts.implicit_wait = wait
|
|
606
614
|
rescue Selenium::WebDriver::Error::UnknownError => e
|
|
607
|
-
unless e.message.include?('The operation requested is not yet implemented
|
|
608
|
-
raise ::Appium::Core::Error::ServerError
|
|
615
|
+
unless e.message.include?('The operation requested is not yet implemented')
|
|
616
|
+
raise ::Appium::Core::Error::ServerError, e.message
|
|
609
617
|
end
|
|
610
618
|
|
|
619
|
+
::Appium::Logger.debug(e.message)
|
|
611
620
|
{}
|
|
612
621
|
end
|
|
613
622
|
|
data/lib/appium_lib/version.rb
CHANGED
|
@@ -14,6 +14,6 @@
|
|
|
14
14
|
|
|
15
15
|
module Appium
|
|
16
16
|
# Version and Date are defined on the 'Appium' module, not 'Appium::Common'
|
|
17
|
-
VERSION = '
|
|
18
|
-
DATE = '2026-11-
|
|
17
|
+
VERSION = '17.0.0' unless defined? ::Appium::VERSION
|
|
18
|
+
DATE = '2026-11-21' unless defined? ::Appium::DATE # x-release-please-date
|
|
19
19
|
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: appium_lib
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version:
|
|
4
|
+
version: 17.0.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- code@bootstraponline.com
|
|
@@ -16,20 +16,20 @@ dependencies:
|
|
|
16
16
|
requirements:
|
|
17
17
|
- - ">="
|
|
18
18
|
- !ruby/object:Gem::Version
|
|
19
|
-
version:
|
|
19
|
+
version: 14.0.0
|
|
20
20
|
- - "<"
|
|
21
21
|
- !ruby/object:Gem::Version
|
|
22
|
-
version: '
|
|
22
|
+
version: '15.0'
|
|
23
23
|
type: :runtime
|
|
24
24
|
prerelease: false
|
|
25
25
|
version_requirements: !ruby/object:Gem::Requirement
|
|
26
26
|
requirements:
|
|
27
27
|
- - ">="
|
|
28
28
|
- !ruby/object:Gem::Version
|
|
29
|
-
version:
|
|
29
|
+
version: 14.0.0
|
|
30
30
|
- - "<"
|
|
31
31
|
- !ruby/object:Gem::Version
|
|
32
|
-
version: '
|
|
32
|
+
version: '15.0'
|
|
33
33
|
- !ruby/object:Gem::Dependency
|
|
34
34
|
name: nokogiri
|
|
35
35
|
requirement: !ruby/object:Gem::Requirement
|