appium_lib_core 13.2.1 → 14.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 +126 -0
- data/README.md +16 -4
- data/lib/appium_lib_core/common/base/bidi_bridge.rb +1 -1
- data/lib/appium_lib_core/common/base/bridge.rb +4 -4
- data/lib/appium_lib_core/common/base/capabilities.rb +3 -3
- data/lib/appium_lib_core/common/base/driver.rb +1 -1
- data/lib/appium_lib_core/common/base/screenshot.rb +0 -2
- data/lib/appium_lib_core/common/command.rb +1 -3
- data/lib/appium_lib_core/common/wait.rb +6 -6
- data/lib/appium_lib_core/driver.rb +1 -27
- data/lib/appium_lib_core/element.rb +4 -28
- data/lib/appium_lib_core/version.rb +2 -2
- data/lib/appium_lib_core.rb +0 -37
- data/sig/lib/appium_lib_core/common/base/bridge.rbs +3 -3
- data/sig/lib/appium_lib_core/common/base/screenshot.rbs +0 -2
- data/sig/lib/appium_lib_core/driver.rbs +0 -10
- data/sig/lib/appium_lib_core/element.rbs +0 -2
- data/sig/lib/appium_lib_core.rbs +0 -3
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: a4fab9d6ec5fede7ade4f20211116d10e70047d308563484b1e6e5699aa663a0
|
|
4
|
+
data.tar.gz: f48d10c740aa36f440958e8d7729a2dda9ce0a0454e24b1dc9d5865afd2f1575
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 97e51de9554257e5a2938755357a1a2cb2a8b210a81bbcab0fbbb1f4826d4bef96bb28d376c301b477029fd0fbf70af006f2befc7b5ebb8e916e055e55f98de8
|
|
7
|
+
data.tar.gz: b1095185d66fa0633132f6664cec30302453efbc7047250e093f2bea06b4f59f904da3489442b83c09b3afd72177870c7832f66a636caccaa831a8da28acfc5e
|
data/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,132 @@
|
|
|
2
2
|
All notable changes to this project will be documented in this file.
|
|
3
3
|
New entries are generated by Release Please. Historical commit-level details through 13.1.0 remain in `release_notes.md`.
|
|
4
4
|
|
|
5
|
+
### Migration from v13 to v14
|
|
6
|
+
|
|
7
|
+
These changes are unreleased and planned for version 14.0.0.
|
|
8
|
+
|
|
9
|
+
Version 14 removes `Appium.symbolize_keys`, the `appium_lib[:wait]` option,
|
|
10
|
+
`Appium::Core::Options#default_wait`, `Appium::Core::Driver#default_wait`, and
|
|
11
|
+
`Appium::Core::Driver#set_implicit_wait_by_default`.
|
|
12
|
+
|
|
13
|
+
#### Waiting for elements
|
|
14
|
+
|
|
15
|
+
`appium_lib: { wait: 30 }` no longer configures an implicit wait; the option is
|
|
16
|
+
ignored. Starting a driver no longer sends an implicit-timeout command. Set the
|
|
17
|
+
implicit wait through Selenium after session creation:
|
|
18
|
+
|
|
19
|
+
```ruby
|
|
20
|
+
core = Appium::Core.for(
|
|
21
|
+
capabilities: { platformName: 'Android', automationName: 'UiAutomator2' }
|
|
22
|
+
)
|
|
23
|
+
driver = core.start_driver
|
|
24
|
+
driver.manage.timeouts.implicit_wait = 30 # seconds
|
|
25
|
+
button = driver.find_element(:accessibility_id, 'Continue')
|
|
26
|
+
button.click
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
Element lookup now waits up to 30 seconds for the element to appear.
|
|
30
|
+
`wait_timeout` controls `core.wait` / `core.wait_true`; it does not configure
|
|
31
|
+
implicit waits for ordinary `find_element` calls.
|
|
32
|
+
|
|
33
|
+
Keep any application-specific default wait in your own configuration instead of
|
|
34
|
+
reading `core.default_wait`. Explicit Selenium timeout configuration remains supported.
|
|
35
|
+
|
|
36
|
+
#### Exceptions retried by wait helpers
|
|
37
|
+
|
|
38
|
+
`wait` / `wait_until` and `wait_true` / `wait_until_true` now retry only
|
|
39
|
+
`Selenium::WebDriver::Error::NoSuchElementError` by default. Previously they
|
|
40
|
+
caught `Exception`, including programming errors and process interruption.
|
|
41
|
+
Other exceptions, including `NoMethodError`, `Interrupt`, and `SystemExit`, now
|
|
42
|
+
propagate immediately by default. This also applies to `Appium::Core::Wait.until`
|
|
43
|
+
and `.until_true`.
|
|
44
|
+
|
|
45
|
+
If a condition needs to retry other transient errors, pass their classes through
|
|
46
|
+
`ignored:`. This option replaces the default list, so include `NoSuchElementError`
|
|
47
|
+
explicitly if it should still be retried. For example, use
|
|
48
|
+
`ignored: [Selenium::WebDriver::Error::NoSuchElementError, Selenium::WebDriver::Error::StaleElementReferenceError]`.
|
|
49
|
+
Use `ignored: []` to disable exception retries. Connection refusal still propagates
|
|
50
|
+
immediately, even when included in `ignored:`.
|
|
51
|
+
|
|
52
|
+
`wait` still succeeds when the block returns without raising, even for `false` or
|
|
53
|
+
`nil`; `wait_true` still waits for a truthy result. Implicit waits configured through
|
|
54
|
+
`driver.manage.timeouts.implicit_wait` are unaffected.
|
|
55
|
+
|
|
56
|
+
The default retry policy now matches
|
|
57
|
+
[`Selenium::WebDriver::Wait`](https://www.selenium.dev/selenium/docs/api/rb/Selenium/WebDriver/Wait.html)
|
|
58
|
+
(verified with Selenium Ruby 4.21.0 and 4.52.0). The existing Appium API retains
|
|
59
|
+
these differences:
|
|
60
|
+
|
|
61
|
+
| Behavior | Selenium Ruby | Appium Ruby core |
|
|
62
|
+
| --- | --- | --- |
|
|
63
|
+
| Exception option | `ignore:` | `ignored:` |
|
|
64
|
+
| Explicit exception list | Replaces the default list | Replaces the default list |
|
|
65
|
+
| Success condition | `until` requires a truthy result | `wait_true` requires a truthy result; `wait` accepts any result without an exception |
|
|
66
|
+
| Connection refusal (`Errno::ECONNREFUSED`) | Can be retried when explicitly included in `ignore:` | Always propagates immediately, even when included in `ignored:` |
|
|
67
|
+
|
|
68
|
+
This change aligns the default exception policy without renaming Appium's options
|
|
69
|
+
or changing its wait success conditions. The minimum Selenium version remains 4.21.0.
|
|
70
|
+
|
|
71
|
+
#### Hash keys
|
|
72
|
+
|
|
73
|
+
Callers using `Appium.symbolize_keys` must replace that call. Prefer defining
|
|
74
|
+
client option keys as symbols (`:capabilities`, `:appium_lib`, `:server_url`, etc.).
|
|
75
|
+
For a hash whose top-level keys are all strings or symbols, Ruby provides
|
|
76
|
+
`options.transform_keys(&:to_sym)`. This is a shallow conversion; normalize nested
|
|
77
|
+
client options separately if needed. Capability string/symbol names are still
|
|
78
|
+
preserved when serialized; this change does not introduce camelCase conversion.
|
|
79
|
+
|
|
80
|
+
#### Element location and screenshots
|
|
81
|
+
|
|
82
|
+
`Element#location_rel(driver)` has been removed. Use `element.rect` for the
|
|
83
|
+
position and size. If you need the element center relative to the window,
|
|
84
|
+
calculate numeric ratios explicitly:
|
|
85
|
+
|
|
86
|
+
```ruby
|
|
87
|
+
rect = element.rect
|
|
88
|
+
window = driver.window_size
|
|
89
|
+
relative_x = (rect.x + rect.width / 2.0) / window.width
|
|
90
|
+
relative_y = (rect.y + rect.height / 2.0) / window.height
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
The old method returned strings such as `"60.0 / 375.0"`, not numeric ratios.
|
|
94
|
+
|
|
95
|
+
Replace `driver.take_element_screenshot(element, path)` with
|
|
96
|
+
`driver.save_element_screenshot(element, path)`. Only the compatibility alias
|
|
97
|
+
has been removed; element screenshot support remains available.
|
|
98
|
+
|
|
99
|
+
#### W3C element responses and actions
|
|
100
|
+
|
|
101
|
+
For Appium 4, element responses must use the W3C
|
|
102
|
+
`element-6066-11e4-a52e-4f735466cecf` key. The legacy JSONWP/MJSONWP `ELEMENT`
|
|
103
|
+
key is no longer interpreted as an element reference, including in script results.
|
|
104
|
+
Update custom drivers, plugins, and test fixtures that still return legacy references.
|
|
105
|
+
W3C noncompact element responses still preserve cached attributes.
|
|
106
|
+
|
|
107
|
+
The bridge's unused positional argument to `action` has been removed. Use
|
|
108
|
+
`driver.action(async: true)` instead of passing a positional boolean.
|
|
109
|
+
|
|
110
|
+
#### Using appium_lib, appium_console, or appium_capybara
|
|
111
|
+
|
|
112
|
+
The current `appium_lib` dependency constraint excludes core 14, and its driver
|
|
113
|
+
still calls the removed `symbolize_keys` and `default_wait` APIs. Keep that upper
|
|
114
|
+
bound until a compatible `appium_lib` release adapts those call sites, its wait
|
|
115
|
+
helpers, and its use of the removed `take_element_screenshot` alias. Do not simply
|
|
116
|
+
relax the core version constraint. Applications using
|
|
117
|
+
`appium_console` or `appium_capybara` through `appium_lib` should upgrade with that
|
|
118
|
+
compatible release. Direct users of `appium_lib_core` can migrate as described above.
|
|
119
|
+
|
|
120
|
+
## [14.0.0](https://github.com/appium/ruby_lib_core/compare/v13.2.1...v14.0.0) (2026-11-16)
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
### ⚠ BREAKING CHANGES
|
|
124
|
+
|
|
125
|
+
* remove Appium.symbolize_keys and automatic implicit waits configured through appium_lib[:wait]. Use explicit waits and migrate downstream callers before upgrading to core 14.
|
|
126
|
+
|
|
127
|
+
### Features
|
|
128
|
+
|
|
129
|
+
* remove deprecated APIs and legacy element handling for core 14 ([#736](https://github.com/appium/ruby_lib_core/issues/736)) ([26a5ec3](https://github.com/appium/ruby_lib_core/commit/26a5ec361b4e5c12451c26e4e4263cc487cb1447))
|
|
130
|
+
|
|
5
131
|
## [13.2.1](https://github.com/appium/ruby_lib_core/compare/v13.2.0...v13.2.1) (2026-10-27)
|
|
6
132
|
|
|
7
133
|
|
data/README.md
CHANGED
|
@@ -17,6 +17,20 @@ This library wraps [selenium-webdriver](https://github.com/SeleniumHQ/selenium/w
|
|
|
17
17
|
- Appium 2.0
|
|
18
18
|
- https://appium.github.io/appium/docs/en/2.0/ (Not completed yet)
|
|
19
19
|
|
|
20
|
+
# Migration from v13 to v14
|
|
21
|
+
|
|
22
|
+
Version 14 removes automatic implicit-wait configuration, `Appium.symbolize_keys`,
|
|
23
|
+
`Element#location_rel`, the `take_element_screenshot` alias, the bridge's positional
|
|
24
|
+
`action` argument, and legacy JSONWP/MJSONWP element references. Configure implicit
|
|
25
|
+
waits through Selenium and use
|
|
26
|
+
`element.rect`, `save_element_screenshot`, keyword action arguments, and W3C references.
|
|
27
|
+
|
|
28
|
+
Wait helpers now retry only `NoSuchElementError` by default; other exceptions
|
|
29
|
+
propagate unless explicitly listed in `ignored:`.
|
|
30
|
+
|
|
31
|
+
See [Migration from v13 to v14](CHANGELOG.md#migration-from-v13-to-v14) in
|
|
32
|
+
[CHANGELOG](CHANGELOG.md) for replacement examples and downstream compatibility notes.
|
|
33
|
+
|
|
20
34
|
# Migration from v4 to v5
|
|
21
35
|
|
|
22
36
|
Please read [`[5.0.0]`](CHANGELOG.md#500---2021-11-05) section in [CHANGELOG](CHANGELOG.md)
|
|
@@ -118,16 +132,14 @@ $ IGNORE_VERSION_SKIP=true CI=true bundle exec rake test:func:android
|
|
|
118
132
|
deviceName: 'iPhone 17',
|
|
119
133
|
# app: '/path/to/MyiOS.app', # Without 'app' capability, an appium session starts with the home screen
|
|
120
134
|
automationName: 'XCUITest'
|
|
121
|
-
},
|
|
122
|
-
appium_lib: {
|
|
123
|
-
wait: 30
|
|
124
135
|
}
|
|
125
136
|
}
|
|
126
137
|
@core = Appium::Core.for(opts) # create a core driver with `opts`
|
|
127
138
|
@driver = @core.start_driver
|
|
139
|
+
@driver.manage.timeouts.implicit_wait = 30 # seconds
|
|
128
140
|
|
|
129
141
|
# Launch iPhone Simulator and `MyiOS.app`
|
|
130
|
-
@driver.find_element(:accessibility_id, 'some accessibility') #
|
|
142
|
+
@driver.find_element(:accessibility_id, 'some accessibility') # wait up to 30 seconds for an element
|
|
131
143
|
```
|
|
132
144
|
- Run the script
|
|
133
145
|
```bash
|
|
@@ -110,7 +110,7 @@ module Appium
|
|
|
110
110
|
# useNewWDA: true,
|
|
111
111
|
# },
|
|
112
112
|
# appium_lib: {
|
|
113
|
-
#
|
|
113
|
+
# wait_timeout: 30
|
|
114
114
|
# }
|
|
115
115
|
# }
|
|
116
116
|
# core = ::Appium::Core.for(caps)
|
|
@@ -152,7 +152,7 @@ module Appium
|
|
|
152
152
|
# Selenium calls this immediately before constructing an element. Keep nil for
|
|
153
153
|
# non-element hashes so ordinary script results and shadow roots stay intact.
|
|
154
154
|
def element_id_from(response)
|
|
155
|
-
response if
|
|
155
|
+
response if response[::Appium::Core::Element::ELEMENT_KEY]
|
|
156
156
|
end
|
|
157
157
|
|
|
158
158
|
def selenium_bridge_accepts_url?
|
|
@@ -211,7 +211,7 @@ module Appium
|
|
|
211
211
|
# element = @driver.find_element(:id, "some id")
|
|
212
212
|
# @driver.action.click(element).perform # The 'click' is a part of 'PointerActions'
|
|
213
213
|
#
|
|
214
|
-
def action(
|
|
214
|
+
def action(async: false, devices: nil)
|
|
215
215
|
# steep:ignore:start
|
|
216
216
|
::Selenium::WebDriver::ActionBuilder.new(
|
|
217
217
|
self,
|
|
@@ -222,7 +222,7 @@ module Appium
|
|
|
222
222
|
# steep:ignore:end
|
|
223
223
|
end
|
|
224
224
|
|
|
225
|
-
#
|
|
225
|
+
# W3C Get Timeouts
|
|
226
226
|
def get_timeouts
|
|
227
227
|
execute :get_timeouts
|
|
228
228
|
end
|
|
@@ -24,14 +24,14 @@ module Appium
|
|
|
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
26
|
|
|
27
|
-
#
|
|
28
|
-
#
|
|
27
|
+
# Override Selenium's convert_key to prevent camelCase conversion.
|
|
28
|
+
# Appium capability names should be preserved as-is (e.g., :some_capability stays "some_capability",
|
|
29
|
+
# not converted to "someCapability" as Selenium's default would do).
|
|
29
30
|
def convert_key(key)
|
|
30
31
|
case key
|
|
31
32
|
when String
|
|
32
33
|
key.to_s
|
|
33
34
|
when Symbol
|
|
34
|
-
# here do not convert to camel case
|
|
35
35
|
key.to_s
|
|
36
36
|
else
|
|
37
37
|
raise ::Appium::Core::Error::ArgumentError, "expected String or Symbol, got #{key.inspect}:#{key.class}"
|
|
@@ -1022,7 +1022,7 @@ module Appium
|
|
|
1022
1022
|
# @return [::Appium::Core::Element]
|
|
1023
1023
|
#
|
|
1024
1024
|
# @example
|
|
1025
|
-
# response = {"element-6066-11e4-a52e-4f735466cecf"=>"xxxx"
|
|
1025
|
+
# response = {"element-6066-11e4-a52e-4f735466cecf"=>"xxxx"}
|
|
1026
1026
|
# ele = @driver.convert_to_element(response) #=> ::Appium::Core::Element
|
|
1027
1027
|
# ele.rect #=> Can get the rect of the element
|
|
1028
1028
|
#
|
|
@@ -68,8 +68,6 @@ module Appium
|
|
|
68
68
|
end
|
|
69
69
|
File.open(png_path, 'wb') { |f| f << element_screenshot_as(element, :png) }
|
|
70
70
|
end
|
|
71
|
-
# backward compatibility
|
|
72
|
-
alias take_element_screenshot save_element_screenshot
|
|
73
71
|
|
|
74
72
|
#
|
|
75
73
|
# Return a PNG screenshot in the given format as a string
|
|
@@ -148,11 +148,9 @@ module Appium
|
|
|
148
148
|
upload_file: [:post, 'session/:session_id/se/file'],
|
|
149
149
|
|
|
150
150
|
###
|
|
151
|
-
#
|
|
151
|
+
# Additional WebDriver and Appium commands
|
|
152
152
|
###
|
|
153
153
|
|
|
154
|
-
# ::Appium::Core::Base::Commands::OSS has the following commands and Appium also use them.
|
|
155
|
-
# Delegated to ::Appium::Core::Base::Commands::OSS commands
|
|
156
154
|
is_element_displayed: [:get, 'session/:session_id/element/:id/displayed'], # hint: https://w3c.github.io/webdriver/#element-displayedness
|
|
157
155
|
|
|
158
156
|
get_timeouts: [:get, 'session/:session_id/timeouts'], # https://w3c.github.io/webdriver/#get-timeouts
|
|
@@ -31,7 +31,7 @@ module Appium
|
|
|
31
31
|
# @param [Integer] timeout Seconds to wait before timing out. Set default by +appium_wait_timeout+ (30).
|
|
32
32
|
# @param [Integer] interval Seconds to sleep between polls. Set default by +appium_wait_interval+ (0.5).
|
|
33
33
|
# @param [String] message Exception message if timed out.
|
|
34
|
-
# @param [Array
|
|
34
|
+
# @param [Array<Class>, Class] ignored Exception classes to retry (default: Selenium::WebDriver::Error::NoSuchElementError)
|
|
35
35
|
# @param [Object, NilClass] object Object to evaluate block against
|
|
36
36
|
#
|
|
37
37
|
# @example
|
|
@@ -45,7 +45,7 @@ module Appium
|
|
|
45
45
|
# }
|
|
46
46
|
#
|
|
47
47
|
def until(timeout: DEFAULT_TIMEOUT, interval: DEFAULT_INTERVAL, message: nil, ignored: nil, object: nil)
|
|
48
|
-
ignored = Array(ignored || ::
|
|
48
|
+
ignored = Array(ignored || ::Selenium::WebDriver::Error::NoSuchElementError)
|
|
49
49
|
|
|
50
50
|
last_error = nil
|
|
51
51
|
timer = Wait::Timer.new(timeout)
|
|
@@ -79,7 +79,7 @@ module Appium
|
|
|
79
79
|
# @param [Integer] timeout Seconds to wait before timing out. Set default by +appium_wait_timeout+ (30).
|
|
80
80
|
# @param [Integer] interval Seconds to sleep between polls. Set default by +appium_wait_interval+ (0.5).
|
|
81
81
|
# @param [String] message Exception message if timed out.
|
|
82
|
-
# @param [Array
|
|
82
|
+
# @param [Array<Class>, Class] ignored Exception classes to retry (default: Selenium::WebDriver::Error::NoSuchElementError)
|
|
83
83
|
# @param [Object, NilClass] object Object to evaluate block against
|
|
84
84
|
#
|
|
85
85
|
# @example
|
|
@@ -93,7 +93,7 @@ module Appium
|
|
|
93
93
|
# }
|
|
94
94
|
#
|
|
95
95
|
def until_true(timeout: DEFAULT_TIMEOUT, interval: DEFAULT_INTERVAL, message: nil, ignored: nil, object: nil)
|
|
96
|
-
ignored = Array(ignored || ::
|
|
96
|
+
ignored = Array(ignored || ::Selenium::WebDriver::Error::NoSuchElementError)
|
|
97
97
|
|
|
98
98
|
last_error = nil
|
|
99
99
|
timer = Wait::Timer.new(timeout)
|
|
@@ -139,7 +139,7 @@ module Appium
|
|
|
139
139
|
# @param [Integer] timeout Seconds to wait before timing out. Set default by +appium_wait_timeout+ (30).
|
|
140
140
|
# @param [Integer] interval Seconds to sleep between polls. Set default by +appium_wait_interval+ (0.5).
|
|
141
141
|
# @param [String] message Exception message if timed out.
|
|
142
|
-
# @param [Array
|
|
142
|
+
# @param [Array<Class>, Class] ignored Exception classes to retry (default: Selenium::WebDriver::Error::NoSuchElementError)
|
|
143
143
|
#
|
|
144
144
|
# @example With core instance
|
|
145
145
|
#
|
|
@@ -175,7 +175,7 @@ module Appium
|
|
|
175
175
|
# @param [Integer] timeout Seconds to wait before timing out. Set default by +appium_wait_timeout+ (30).
|
|
176
176
|
# @param [Integer] interval Seconds to sleep between polls. Set default by +appium_wait_interval+ (0.5).
|
|
177
177
|
# @param [String] message Exception message if timed out.
|
|
178
|
-
# @param [Array
|
|
178
|
+
# @param [Array<Class>, Class] ignored Exception classes to retry (default: Selenium::WebDriver::Error::NoSuchElementError)
|
|
179
179
|
#
|
|
180
180
|
# @example With core instance
|
|
181
181
|
#
|
|
@@ -39,13 +39,12 @@ module Appium
|
|
|
39
39
|
# This options affects only client side as <code>:appium_lib</code> key.<br>
|
|
40
40
|
# Read {::Appium::Core::Driver} about each attribute
|
|
41
41
|
class Options
|
|
42
|
-
attr_reader :custom_url,
|
|
42
|
+
attr_reader :custom_url,
|
|
43
43
|
:port, :wait_timeout, :wait_interval, :listener,
|
|
44
44
|
:direct_connect, :enable_idempotency_header
|
|
45
45
|
|
|
46
46
|
def initialize(appium_lib_opts)
|
|
47
47
|
@custom_url = appium_lib_opts.fetch :server_url, nil
|
|
48
|
-
@default_wait = appium_lib_opts.fetch :wait, nil
|
|
49
48
|
@enable_idempotency_header = appium_lib_opts.fetch :enable_idempotency_header, true
|
|
50
49
|
|
|
51
50
|
@direct_connect = appium_lib_opts.fetch :direct_connect, true
|
|
@@ -193,11 +192,6 @@ module Appium
|
|
|
193
192
|
# @return [String]
|
|
194
193
|
attr_reader :custom_url
|
|
195
194
|
|
|
196
|
-
# Default wait time for elements to appear in Appium server side.
|
|
197
|
-
# Provide <code>{ appium_lib: { wait: 30 } }</code> to {::Appium::Core.for}
|
|
198
|
-
# @return [Integer]
|
|
199
|
-
attr_reader :default_wait
|
|
200
|
-
|
|
201
195
|
# Appium's server port. 4723 is by default. Defaults to {::Appium::Core::Driver::DEFAULT_APPIUM_PORT}.<br>
|
|
202
196
|
# Provide <code>{ appium_lib: { port: 8080 } }</code> to {::Appium::Core.for}.
|
|
203
197
|
# <code>:custom_url</code> is prior than <code>:port</code> if <code>:custom_url</code> is set.
|
|
@@ -278,7 +272,6 @@ module Appium
|
|
|
278
272
|
# },
|
|
279
273
|
# appium_lib: {
|
|
280
274
|
# port: 8080,
|
|
281
|
-
# wait: 0,
|
|
282
275
|
# wait_timeout: 20,
|
|
283
276
|
# wait_interval: 0.3,
|
|
284
277
|
# listener: nil,
|
|
@@ -299,7 +292,6 @@ module Appium
|
|
|
299
292
|
# },
|
|
300
293
|
# appium_lib: {
|
|
301
294
|
# server_url: 'http://custom-host:8080/wd/hub',
|
|
302
|
-
# wait: 0,
|
|
303
295
|
# wait_timeout: 20,
|
|
304
296
|
# wait_interval: 0.3,
|
|
305
297
|
# listener: nil,
|
|
@@ -319,7 +311,6 @@ module Appium
|
|
|
319
311
|
# app: '/path/to/MyiOS.app'
|
|
320
312
|
# },
|
|
321
313
|
# appium_lib: {
|
|
322
|
-
# wait: 0,
|
|
323
314
|
# wait_timeout: 20,
|
|
324
315
|
# wait_interval: 0.3,
|
|
325
316
|
# listener: nil,
|
|
@@ -442,7 +433,6 @@ module Appium
|
|
|
442
433
|
# app: '/path/to/MyiOS.app'
|
|
443
434
|
# },
|
|
444
435
|
# appium_lib: {
|
|
445
|
-
# wait: 20,
|
|
446
436
|
# wait_timeout: 20,
|
|
447
437
|
# wait_interval: 0.3,
|
|
448
438
|
# }
|
|
@@ -504,8 +494,6 @@ module Appium
|
|
|
504
494
|
@http_client.delete_additional_header Appium::Core::Base::Http::RequestHeaders::KEYS[:idempotency]
|
|
505
495
|
end
|
|
506
496
|
|
|
507
|
-
set_implicit_wait_by_default(@default_wait)
|
|
508
|
-
|
|
509
497
|
@driver
|
|
510
498
|
end
|
|
511
499
|
|
|
@@ -553,18 +541,6 @@ module Appium
|
|
|
553
541
|
http_client || Appium::Core::Base::Http::Default.new(open_timeout: open_timeout, read_timeout: read_timeout)
|
|
554
542
|
end
|
|
555
543
|
|
|
556
|
-
# Ignore setting default wait if the target driver has no implementation
|
|
557
|
-
def set_implicit_wait_by_default(wait)
|
|
558
|
-
return if @default_wait.nil?
|
|
559
|
-
|
|
560
|
-
@driver.manage.timeouts.implicit_wait = wait
|
|
561
|
-
rescue ::Selenium::WebDriver::Error::UnknownError => e
|
|
562
|
-
raise ::Appium::Core::Error::ServerError, e.message unless e.message.include?('The operation requested is not yet implemented')
|
|
563
|
-
|
|
564
|
-
::Appium::Logger.debug(e.message)
|
|
565
|
-
{}
|
|
566
|
-
end
|
|
567
|
-
|
|
568
544
|
# Returns the server's version info. This method calls +driver.remote_status+ internally
|
|
569
545
|
#
|
|
570
546
|
# @return [Hash]
|
|
@@ -727,8 +703,6 @@ module Appium
|
|
|
727
703
|
@custom_url ||= opts.custom_url # Keep existence capability if it's already provided
|
|
728
704
|
@enable_idempotency_header = opts.enable_idempotency_header
|
|
729
705
|
|
|
730
|
-
@default_wait = opts.default_wait
|
|
731
|
-
|
|
732
706
|
@port = opts.port
|
|
733
707
|
|
|
734
708
|
@wait_timeout = opts.wait_timeout
|
|
@@ -115,9 +115,12 @@ module Appium
|
|
|
115
115
|
def initialize(bridge, id, cached = nil)
|
|
116
116
|
if id.is_a?(Hash)
|
|
117
117
|
# Preserve any extra attributes included in the element response.
|
|
118
|
+
# Legacy IDs can accompany a W3C ID, but are not cached attributes.
|
|
118
119
|
cached = Cache.new(id.except('ELEMENT', ELEMENT_KEY))
|
|
119
|
-
id = id[
|
|
120
|
+
id = id[ELEMENT_KEY]
|
|
120
121
|
end
|
|
122
|
+
raise ::Selenium::WebDriver::Error::WebDriverError, 'Missing W3C element ID in response' if id.nil?
|
|
123
|
+
|
|
121
124
|
super(bridge, id)
|
|
122
125
|
@cached = cached
|
|
123
126
|
end
|
|
@@ -165,33 +168,6 @@ module Appium
|
|
|
165
168
|
# Alias for type
|
|
166
169
|
alias type send_keys
|
|
167
170
|
|
|
168
|
-
# @deprecated Please use `Element#rect` instead to get location information.
|
|
169
|
-
#
|
|
170
|
-
# For use with location_rel.
|
|
171
|
-
#
|
|
172
|
-
# @return [Struct(:x, :y)] the relative x, y in a struct in string.
|
|
173
|
-
#
|
|
174
|
-
# @example
|
|
175
|
-
#
|
|
176
|
-
# e = @driver.find_element :accessibility_id, 'something'
|
|
177
|
-
# e.location_rel @driver
|
|
178
|
-
#
|
|
179
|
-
def location_rel(driver)
|
|
180
|
-
rect = self.rect
|
|
181
|
-
location_x = rect.x.to_f
|
|
182
|
-
location_y = rect.y.to_f
|
|
183
|
-
|
|
184
|
-
size_width = rect.width.to_f
|
|
185
|
-
size_height = rect.height.to_f
|
|
186
|
-
|
|
187
|
-
center_x = location_x + (size_width / 2.0)
|
|
188
|
-
center_y = location_y + (size_height / 2.0)
|
|
189
|
-
|
|
190
|
-
w = driver.window_size
|
|
191
|
-
point = Struct.new(:x, :y)
|
|
192
|
-
point.new("#{center_x} / #{w.width.to_f}", "#{center_y} / #{w.height.to_f}")
|
|
193
|
-
end
|
|
194
|
-
|
|
195
171
|
# Return an element screenshot as base64
|
|
196
172
|
#
|
|
197
173
|
# @return String Base 64 encoded string
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
|
|
15
15
|
module Appium
|
|
16
16
|
module Core
|
|
17
|
-
VERSION = '
|
|
18
|
-
DATE = '2026-
|
|
17
|
+
VERSION = '14.0.0' unless defined? ::Appium::Core::VERSION
|
|
18
|
+
DATE = '2026-11-16' unless defined? ::Appium::Core::DATE # x-release-please-date
|
|
19
19
|
end
|
|
20
20
|
end
|
data/lib/appium_lib_core.rb
CHANGED
|
@@ -22,43 +22,6 @@ require_relative 'appium_lib_core/element'
|
|
|
22
22
|
require_relative 'appium_lib_core/support/event_firing_bridge'
|
|
23
23
|
|
|
24
24
|
module Appium
|
|
25
|
-
# convert the top level keys to symbols.
|
|
26
|
-
#
|
|
27
|
-
# @param [Hash] hash Hash value to make symbolise
|
|
28
|
-
#
|
|
29
|
-
# @example
|
|
30
|
-
#
|
|
31
|
-
# opts = Appium.symbolize_keys(opts)
|
|
32
|
-
#
|
|
33
|
-
def self.symbolize_keys(hash, nested: false, enable_deprecation_msg: true)
|
|
34
|
-
# FIXME: As https://github.com/appium/ruby_lib/issues/945, we must remove this implicit string to symbol.
|
|
35
|
-
# But appium_lib_core's some capability handling expect to be symbol, so we should test to remove
|
|
36
|
-
# the methods which expect the symbol first.
|
|
37
|
-
raise ::Appium::Core::Error::ArgumentError, 'symbolize_keys requires a hash' unless hash.is_a? Hash
|
|
38
|
-
|
|
39
|
-
hash.each_with_object({}) do |pair, acc| # steep:ignore
|
|
40
|
-
key = begin
|
|
41
|
-
if enable_deprecation_msg && !(pair[0].is_a? Symbol)
|
|
42
|
-
::Appium::Logger.warn("[Deprecation] The key '#{pair[0]}' must be a symbol while currently it " \
|
|
43
|
-
"is #{pair[0].class.name}. Please define the key as a Symbol. " \
|
|
44
|
-
'Converting it to Symbol for now.')
|
|
45
|
-
end
|
|
46
|
-
|
|
47
|
-
pair[0].to_sym
|
|
48
|
-
rescue StandardError => e
|
|
49
|
-
::Appium::Logger.warn(e.message)
|
|
50
|
-
pair[0]
|
|
51
|
-
end
|
|
52
|
-
|
|
53
|
-
value = pair[1]
|
|
54
|
-
acc[key] = if nested
|
|
55
|
-
value.is_a?(Hash) ? symbolize_keys(value, nested: false, enable_deprecation_msg: false) : value
|
|
56
|
-
else
|
|
57
|
-
value
|
|
58
|
-
end
|
|
59
|
-
end
|
|
60
|
-
end
|
|
61
|
-
|
|
62
25
|
module Core
|
|
63
26
|
# @see Appium::Core::Driver.for
|
|
64
27
|
def self.for(opts = {})
|
|
@@ -88,7 +88,7 @@ module Appium
|
|
|
88
88
|
# useNewWDA: true,
|
|
89
89
|
# },
|
|
90
90
|
# appium_lib: {
|
|
91
|
-
#
|
|
91
|
+
# wait_timeout: 30
|
|
92
92
|
# }
|
|
93
93
|
# }
|
|
94
94
|
# core = ::Appium::Core.for(caps)
|
|
@@ -139,9 +139,9 @@ module Appium
|
|
|
139
139
|
# element = @driver.find_element(:id, "some id")
|
|
140
140
|
# @driver.action.click(element).perform # The 'click' is a part of 'PointerActions'
|
|
141
141
|
#
|
|
142
|
-
def action: (?
|
|
142
|
+
def action: (?async: bool, ?devices: untyped?) -> untyped
|
|
143
143
|
|
|
144
|
-
#
|
|
144
|
+
# W3C Get Timeouts
|
|
145
145
|
def get_timeouts: () -> untyped
|
|
146
146
|
|
|
147
147
|
# For Appium
|
|
@@ -10,8 +10,6 @@ module Appium
|
|
|
10
10
|
|
|
11
11
|
def save_element_screenshot: (untyped element, untyped png_path) -> untyped
|
|
12
12
|
|
|
13
|
-
alias take_element_screenshot save_element_screenshot
|
|
14
|
-
|
|
15
13
|
def element_screenshot_as: (untyped element, untyped format) -> untyped
|
|
16
14
|
|
|
17
15
|
def save_viewport_screenshot: (untyped png_path) -> untyped
|
|
@@ -20,8 +20,6 @@ module Appium
|
|
|
20
20
|
class Options
|
|
21
21
|
@custom_url: String
|
|
22
22
|
|
|
23
|
-
@default_wait: Integer
|
|
24
|
-
|
|
25
23
|
@enable_idempotency_header: bool
|
|
26
24
|
|
|
27
25
|
@direct_connect: bool
|
|
@@ -36,8 +34,6 @@ module Appium
|
|
|
36
34
|
|
|
37
35
|
attr_reader custom_url: String
|
|
38
36
|
|
|
39
|
-
attr_reader default_wait: Integer
|
|
40
|
-
|
|
41
37
|
attr_reader port: Integer
|
|
42
38
|
|
|
43
39
|
attr_reader wait_timeout: Integer
|
|
@@ -121,8 +117,6 @@ module Appium
|
|
|
121
117
|
|
|
122
118
|
@enable_idempotency_header: bool
|
|
123
119
|
|
|
124
|
-
@default_wait: Integer
|
|
125
|
-
|
|
126
120
|
@port: Integer
|
|
127
121
|
|
|
128
122
|
@wait_timeout: Integer
|
|
@@ -147,8 +141,6 @@ module Appium
|
|
|
147
141
|
|
|
148
142
|
attr_reader custom_url: String
|
|
149
143
|
|
|
150
|
-
attr_reader default_wait: Integer
|
|
151
|
-
|
|
152
144
|
attr_reader port: Integer
|
|
153
145
|
|
|
154
146
|
DEFAULT_APPIUM_PORT: Integer
|
|
@@ -190,8 +182,6 @@ module Appium
|
|
|
190
182
|
|
|
191
183
|
def get_http_client: (?http_client: untyped?, ?open_timeout: untyped?, ?read_timeout: untyped?) -> untyped
|
|
192
184
|
|
|
193
|
-
def set_implicit_wait_by_default: (untyped wait) -> untyped
|
|
194
|
-
|
|
195
185
|
def appium_server_version: () -> Hash[String, String]
|
|
196
186
|
|
|
197
187
|
private
|
data/sig/lib/appium_lib_core.rbs
CHANGED