appium_lib_core 11.1.1 → 11.2.1
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 -1
- data/Gemfile +3 -3
- data/README.md +4 -4
- data/Rakefile +1 -5
- data/appium_lib_core.gemspec +0 -1
- data/lib/appium_lib_core/android/device/emulator.rb +4 -12
- data/lib/appium_lib_core/android/device/screen.rb +1 -3
- data/lib/appium_lib_core/android/device.rb +0 -4
- data/lib/appium_lib_core/common/base/bidi_bridge.rb +4 -0
- data/lib/appium_lib_core/common/base/bridge.rb +8 -2
- data/lib/appium_lib_core/common/base/driver.rb +10 -4
- data/lib/appium_lib_core/common/base/has_location.rb +1 -3
- data/lib/appium_lib_core/common/base/rotable.rb +1 -3
- data/lib/appium_lib_core/common/base/search_context.rb +0 -2
- data/lib/appium_lib_core/common/device/image_comparison.rb +3 -12
- data/lib/appium_lib_core/common/wait.rb +4 -0
- data/lib/appium_lib_core/common.rb +0 -1
- data/lib/appium_lib_core/driver.rb +21 -12
- data/lib/appium_lib_core/element.rb +8 -3
- data/lib/appium_lib_core/ios/xcuitest/device.rb +0 -5
- data/lib/appium_lib_core/mac2/device.rb +0 -5
- data/lib/appium_lib_core/version.rb +2 -2
- data/lib/appium_lib_core/windows/device.rb +0 -5
- data/lib/appium_lib_core.rb +2 -2
- data/rbs_collection.lock.yaml +63 -31
- data/sig/gems/forwardable.rbs +17 -0
- data/sig/gems/selenium/atoms.rbs +0 -1
- data/sig/gems/selenium/bidi/browsing_context.rbs +1 -1
- data/sig/gems/selenium/bridge.rbs +3 -0
- data/sig/gems/selenium/chromium/features.rbs +1 -1
- data/sig/gems/selenium/common/element.rbs +2 -0
- data/sig/gems/selenium/driver.rbs +10 -0
- data/sig/gems/selenium/fedcm.rbs +12 -0
- data/sig/gems/selenium/firefox/profile.rbs +0 -2
- data/sig/gems/selenium/log_entry.rbs +12 -0
- data/sig/gems/selenium/remote/capabilities.rbs +6 -0
- data/sig/interfaces/bridge.rbs +4 -0
- data/sig/lib/appium_lib_core/android/device/auth_finger_print.rbs +1 -1
- data/sig/lib/appium_lib_core/android/device/clipboard.rbs +1 -1
- data/sig/lib/appium_lib_core/android/device/emulator.rbs +2 -2
- data/sig/lib/appium_lib_core/android/device/performance.rbs +1 -1
- data/sig/lib/appium_lib_core/android/device/screen.rbs +2 -0
- data/sig/lib/appium_lib_core/android/device.rbs +20 -2
- data/sig/lib/appium_lib_core/android/uiautomator2/device/battery.rbs +2 -0
- data/sig/lib/appium_lib_core/android/uiautomator2/device.rbs +15 -0
- data/sig/lib/appium_lib_core/android.rbs +4 -0
- data/sig/lib/appium_lib_core/android_espresso.rbs +4 -0
- data/sig/lib/appium_lib_core/android_uiautomator2.rbs +4 -0
- data/sig/lib/appium_lib_core/common/base/bidi_bridge.rbs +4 -0
- data/sig/lib/appium_lib_core/common/base/bridge.rbs +3 -1
- data/sig/lib/appium_lib_core/common/base/capabilities.rbs +3 -0
- data/sig/lib/appium_lib_core/common/base/rotable.rbs +3 -0
- data/sig/lib/appium_lib_core/common/base/search_context.rbs +1 -1
- data/sig/lib/appium_lib_core/common/base.rbs +4 -0
- data/sig/lib/appium_lib_core/common/device/app_state.rbs +2 -2
- data/sig/lib/appium_lib_core/common/device/device.rbs +1 -1
- data/sig/lib/appium_lib_core/common/device/device_lock.rbs +2 -2
- data/sig/lib/appium_lib_core/common/device/keyboard.rbs +2 -2
- data/sig/lib/appium_lib_core/common/device/keyevent.rbs +1 -1
- data/sig/lib/appium_lib_core/common/device/screen_record.rbs +7 -3
- data/sig/lib/appium_lib_core/common.rbs +4 -0
- data/sig/lib/appium_lib_core/driver.rbs +19 -10
- data/sig/lib/appium_lib_core/element.rbs +5 -2
- data/sig/lib/appium_lib_core/ios/{clipboard.rbs → device/clipboard.rbs} +0 -4
- data/sig/lib/appium_lib_core/ios/xcuitest/device/battery.rbs +3 -1
- data/sig/lib/appium_lib_core/ios/xcuitest/device/performance.rbs +2 -0
- data/sig/lib/appium_lib_core/ios_xcuitest.rbs +4 -0
- data/sig/lib/appium_lib_core/mac2.rbs +4 -0
- data/sig/lib/appium_lib_core/windows.rbs +4 -0
- data/sig/lib/appium_lib_core.rbs +1 -1
- metadata +16 -31
- data/lib/appium_lib_core/common/ws/websocket.rb +0 -165
- data/sig/gems/faye.rbs +0 -10
- data/sig/lib/appium_lib_core/android/device/network.rbs +0 -13
- data/sig/lib/appium_lib_core/common/ws/websocket.rbs +0 -103
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: dce85252dcaa27d5effbf733193d1206e63265c611f6fe88920589cd0718a613
|
|
4
|
+
data.tar.gz: 01afebb29009ba9e6f15fd559dab589e13ab6f53db5a880e0fda4a3581d8c66a
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: eaf2ea02349b8b3e1eed0209ca62ed7dd52942b2f0c2a6556871d92898727651cfa42f8027aeb96f8ec8a91fe6e9d935f7843bef0e1eef2ff0d1a96e171000e3
|
|
7
|
+
data.tar.gz: 41ee1e4e51ffdee1e5b4677c510dfb8391173c6eda8e20bcf55a1849880d9a34931266c51d5127ace2939b12f3f3710d6bc557a23b70a3adea282f67ea3ed318
|
data/CHANGELOG.md
CHANGED
|
@@ -2,10 +2,16 @@
|
|
|
2
2
|
All notable changes to this project will be documented in this file.
|
|
3
3
|
Read `release_notes.md` for commit level details.
|
|
4
4
|
|
|
5
|
+
## [11.12.1] - 2025-12-25
|
|
6
|
+
- update RBS files
|
|
7
|
+
|
|
8
|
+
## [11.12.0] - 2025-11-16
|
|
9
|
+
- Add more RBS files
|
|
10
|
+
|
|
5
11
|
## [11.1.0,11.1.1] - 2025-08-08
|
|
6
12
|
- Add WebDriver BiDi support. Please set `webSocketUrl` in the capabilities to enable it.
|
|
7
13
|
- `test/functional/android/webdriver/bidi_test.rb` can be an example usage.
|
|
8
|
-
- Older versions of the Selenium Ruby bindings may raise exceptions due to missing dependencies.
|
|
14
|
+
- Older versions of the Selenium Ruby bindings may raise exceptions due to missing module dependencies.
|
|
9
15
|
|
|
10
16
|
## [11.0.2] - 2025-04-27
|
|
11
17
|
- Add more sig definitions [#571](https://github.com/appium/ruby_lib_core/pull/571)
|
data/Gemfile
CHANGED
|
@@ -8,8 +8,8 @@ gem 'minitest', '~> 5.0'
|
|
|
8
8
|
gem 'minitest-reporters', '~> 1.1'
|
|
9
9
|
gem 'parallel_tests'
|
|
10
10
|
gem 'rake', '~> 13.0'
|
|
11
|
-
gem 'rubocop', '1.
|
|
11
|
+
gem 'rubocop', '1.82.0'
|
|
12
12
|
gem 'simplecov'
|
|
13
|
-
gem 'steep', '~> 1.
|
|
14
|
-
gem 'webmock', '~> 3.
|
|
13
|
+
gem 'steep', '~> 1.10.0'
|
|
14
|
+
gem 'webmock', '~> 3.26.0'
|
|
15
15
|
gem 'yard', '~> 0.9.11'
|
data/README.md
CHANGED
|
@@ -31,14 +31,14 @@ Run unit tests which check each method and command, URL, using the webmock.
|
|
|
31
31
|
|
|
32
32
|
```bash
|
|
33
33
|
$ bundle install
|
|
34
|
-
$ bundle exec parallel_test test/unit/
|
|
34
|
+
$ UNIT_TEST=1 bundle exec parallel_test test/unit/
|
|
35
35
|
```
|
|
36
36
|
|
|
37
37
|
or
|
|
38
38
|
|
|
39
39
|
```bash
|
|
40
40
|
$ bundle install
|
|
41
|
-
$ bundle exec rake test:unit
|
|
41
|
+
$ UNIT_TEST=1 bundle exec rake test:unit
|
|
42
42
|
```
|
|
43
43
|
|
|
44
44
|
### Functional Tests
|
|
@@ -114,8 +114,8 @@ $ IGNORE_VERSION_SKIP=true CI=true bundle exec rake test:func:android
|
|
|
114
114
|
opts = {
|
|
115
115
|
capabilities: { # Append capabilities
|
|
116
116
|
platformName: 'ios',
|
|
117
|
-
platformVersion: '
|
|
118
|
-
deviceName: 'iPhone
|
|
117
|
+
platformVersion: '26.0',
|
|
118
|
+
deviceName: 'iPhone 17',
|
|
119
119
|
# app: '/path/to/MyiOS.app', # Without 'app' capability, an appium session starts with the home screen
|
|
120
120
|
automationName: 'XCUITest'
|
|
121
121
|
},
|
data/Rakefile
CHANGED
|
@@ -38,7 +38,6 @@ namespace :test do
|
|
|
38
38
|
namespace :unit do
|
|
39
39
|
desc('Run all iOS related unit tests in test directory')
|
|
40
40
|
Rake::TestTask.new(:ios) do |t|
|
|
41
|
-
ENV['UNIT_TEST'] = '1'
|
|
42
41
|
t.libs << 'test'
|
|
43
42
|
t.libs << 'lib'
|
|
44
43
|
t.test_files = FileList['test/unit/ios/**/*_test.rb']
|
|
@@ -46,7 +45,6 @@ namespace :test do
|
|
|
46
45
|
|
|
47
46
|
desc('Run all Android related unit tests in test directory')
|
|
48
47
|
Rake::TestTask.new(:android) do |t|
|
|
49
|
-
ENV['UNIT_TEST'] = '1'
|
|
50
48
|
t.libs << 'test'
|
|
51
49
|
t.libs << 'lib'
|
|
52
50
|
t.test_files = FileList['test/unit/android/**/*_test.rb']
|
|
@@ -54,7 +52,6 @@ namespace :test do
|
|
|
54
52
|
|
|
55
53
|
desc('Run all common related unit tests in test directory')
|
|
56
54
|
Rake::TestTask.new(:common) do |t|
|
|
57
|
-
ENV['UNIT_TEST'] = '1'
|
|
58
55
|
t.libs << 'test'
|
|
59
56
|
t.libs << 'lib'
|
|
60
57
|
t.test_files = FileList['test/unit/common/**/*_test.rb']
|
|
@@ -62,7 +59,6 @@ namespace :test do
|
|
|
62
59
|
|
|
63
60
|
desc('Run all Windows related unit tests in test directory')
|
|
64
61
|
Rake::TestTask.new(:windows) do |t|
|
|
65
|
-
ENV['UNIT_TEST'] = '1'
|
|
66
62
|
t.libs << 'test'
|
|
67
63
|
t.libs << 'lib'
|
|
68
64
|
t.test_files = FileList['test/unit/windows/**/*_test.rb']
|
|
@@ -120,5 +116,5 @@ end
|
|
|
120
116
|
|
|
121
117
|
desc('Run Steep type check')
|
|
122
118
|
task :steep do
|
|
123
|
-
system
|
|
119
|
+
system 'steep check --severity-level=error'
|
|
124
120
|
end
|
data/appium_lib_core.gemspec
CHANGED
|
@@ -21,7 +21,6 @@ Gem::Specification.new do |spec|
|
|
|
21
21
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
|
22
22
|
spec.require_paths = ['lib']
|
|
23
23
|
|
|
24
|
-
spec.add_dependency 'faye-websocket', '>= 0.11', '< 0.13'
|
|
25
24
|
spec.add_dependency 'selenium-webdriver', '~> 4.21'
|
|
26
25
|
|
|
27
26
|
spec.metadata['rubygems_mfa_required'] = 'true'
|
|
@@ -121,9 +121,7 @@ module Appium
|
|
|
121
121
|
|
|
122
122
|
::Appium::Core::Device.add_endpoint_method(:gsm_call) do
|
|
123
123
|
def gsm_call(phone_number:, action:)
|
|
124
|
-
unless GSM_CALL_ACTIONS.member? action.to_sym
|
|
125
|
-
raise ::Appium::Core::Error::ArgumentError, "action: should be member of #{GSM_CALL_ACTIONS}. Not #{action}."
|
|
126
|
-
end
|
|
124
|
+
raise ::Appium::Core::Error::ArgumentError, "action: should be member of #{GSM_CALL_ACTIONS}. Not #{action}." unless GSM_CALL_ACTIONS.member? action.to_sym
|
|
127
125
|
|
|
128
126
|
execute_script 'mobile:gsmCall', { phoneNumber: phone_number, action: action }
|
|
129
127
|
end
|
|
@@ -142,9 +140,7 @@ module Appium
|
|
|
142
140
|
|
|
143
141
|
::Appium::Core::Device.add_endpoint_method(:gsm_voice) do
|
|
144
142
|
def gsm_voice(state)
|
|
145
|
-
unless GSM_VOICE_STATES.member? state.to_sym
|
|
146
|
-
raise ::Appium::Core::Error::ArgumentError, "The state should be member of #{GSM_VOICE_STATES}. Not #{state}."
|
|
147
|
-
end
|
|
143
|
+
raise ::Appium::Core::Error::ArgumentError, "The state should be member of #{GSM_VOICE_STATES}. Not #{state}." unless GSM_VOICE_STATES.member? state.to_sym
|
|
148
144
|
|
|
149
145
|
execute_script 'mobile:gsmVoice', { state: state }
|
|
150
146
|
end
|
|
@@ -163,9 +159,7 @@ module Appium
|
|
|
163
159
|
|
|
164
160
|
::Appium::Core::Device.add_endpoint_method(:set_power_capacity) do
|
|
165
161
|
def set_power_capacity(percent)
|
|
166
|
-
unless (0..100).member? percent
|
|
167
|
-
::Appium::Logger.warn "The percent should be between 0 and 100. Not #{percent}."
|
|
168
|
-
end
|
|
162
|
+
::Appium::Logger.warn "The percent should be between 0 and 100. Not #{percent}." unless (0..100).member? percent
|
|
169
163
|
|
|
170
164
|
execute_script 'mobile:powerCapacity', { percent: percent }
|
|
171
165
|
end
|
|
@@ -173,9 +167,7 @@ module Appium
|
|
|
173
167
|
|
|
174
168
|
::Appium::Core::Device.add_endpoint_method(:set_power_ac) do
|
|
175
169
|
def set_power_ac(state)
|
|
176
|
-
unless POWER_AC_STATE.member? state.to_sym
|
|
177
|
-
raise ::Appium::Core::Error::ArgumentError, "The state should be member of #{POWER_AC_STATE}. Not #{state}."
|
|
178
|
-
end
|
|
170
|
+
raise ::Appium::Core::Error::ArgumentError, "The state should be member of #{POWER_AC_STATE}. Not #{state}." unless POWER_AC_STATE.member? state.to_sym
|
|
179
171
|
|
|
180
172
|
execute_script 'mobile:powerAc', { state: state }
|
|
181
173
|
end
|
|
@@ -39,9 +39,7 @@ module Appium
|
|
|
39
39
|
option[:bitRate] = bit_rate unless bit_rate.nil?
|
|
40
40
|
|
|
41
41
|
unless bug_report.nil?
|
|
42
|
-
unless [true, false].member?(bug_report)
|
|
43
|
-
raise ::Appium::Core::Error::ArgumentError, 'bug_report should be true or false'
|
|
44
|
-
end
|
|
42
|
+
raise ::Appium::Core::Error::ArgumentError, 'bug_report should be true or false' unless [true, false].member?(bug_report)
|
|
45
43
|
|
|
46
44
|
option[:bugReport] = bug_report
|
|
47
45
|
end
|
|
@@ -24,8 +24,6 @@ module Appium
|
|
|
24
24
|
module Device
|
|
25
25
|
extend Forwardable
|
|
26
26
|
|
|
27
|
-
# rubocop:disable Layout/LineLength
|
|
28
|
-
|
|
29
27
|
# @!method open_notifications
|
|
30
28
|
# Open Android notifications
|
|
31
29
|
#
|
|
@@ -244,8 +242,6 @@ module Appium
|
|
|
244
242
|
## class << self
|
|
245
243
|
####
|
|
246
244
|
|
|
247
|
-
# rubocop:enable Layout/LineLength
|
|
248
|
-
|
|
249
245
|
class << self
|
|
250
246
|
def extended(_mod)
|
|
251
247
|
::Appium::Core::Device.extend_webdriver_with_forwardable
|
|
@@ -18,6 +18,8 @@ module Appium
|
|
|
18
18
|
module Core
|
|
19
19
|
class Base
|
|
20
20
|
class BiDiBridge < ::Appium::Core::Base::Bridge
|
|
21
|
+
# steep:ignore:start
|
|
22
|
+
|
|
21
23
|
attr_reader :bidi
|
|
22
24
|
|
|
23
25
|
# Override
|
|
@@ -85,6 +87,8 @@ module Appium
|
|
|
85
87
|
execute(:close_window).tap { |handles| bidi.close if handles.empty? }
|
|
86
88
|
end
|
|
87
89
|
|
|
90
|
+
# steep:ignore:end
|
|
91
|
+
|
|
88
92
|
private
|
|
89
93
|
|
|
90
94
|
def browsing_context
|
|
@@ -37,7 +37,9 @@ module Appium
|
|
|
37
37
|
include Device::ExecuteDriver
|
|
38
38
|
include Device::Orientation
|
|
39
39
|
|
|
40
|
+
# steep:ignore:start
|
|
40
41
|
Bridge.locator_converter = LocatorConverter.new
|
|
42
|
+
# steep:ignore:end
|
|
41
43
|
|
|
42
44
|
# Prefix for extra capability defined by W3C
|
|
43
45
|
APPIUM_PREFIX = 'appium:'
|
|
@@ -94,7 +96,7 @@ module Appium
|
|
|
94
96
|
# caps: {
|
|
95
97
|
# platformName: :ios,
|
|
96
98
|
# automationName: 'XCUITest',
|
|
97
|
-
# app: 'test/functional/app/
|
|
99
|
+
# app: 'test/functional/app/UIKitCatalog-iphonesimulator.zip',
|
|
98
100
|
# platformVersion: '11.4',
|
|
99
101
|
# deviceName: 'iPhone Simulator',
|
|
100
102
|
# useNewWDA: true,
|
|
@@ -141,7 +143,7 @@ module Appium
|
|
|
141
143
|
private
|
|
142
144
|
|
|
143
145
|
def camel_case(str_or_sym)
|
|
144
|
-
str_or_sym.to_s.gsub(/_([a-z])/) { Regexp.last_match(1)
|
|
146
|
+
str_or_sym.to_s.gsub(/_([a-z])/) { Regexp.last_match(1)&.upcase }
|
|
145
147
|
end
|
|
146
148
|
|
|
147
149
|
def extension_prefix?(capability_name)
|
|
@@ -204,12 +206,14 @@ module Appium
|
|
|
204
206
|
# @driver.action.click(element).perform # The 'click' is a part of 'PointerActions'
|
|
205
207
|
#
|
|
206
208
|
def action(_deprecated_async = nil, async: false, devices: nil)
|
|
209
|
+
# steep:ignore:start
|
|
207
210
|
::Selenium::WebDriver::ActionBuilder.new(
|
|
208
211
|
self,
|
|
209
212
|
devices: devices || [::Selenium::WebDriver::Interactions.pointer(:touch, name: 'touch')],
|
|
210
213
|
async: async,
|
|
211
214
|
duration: 50 # milliseconds
|
|
212
215
|
)
|
|
216
|
+
# steep:ignore:end
|
|
213
217
|
end
|
|
214
218
|
|
|
215
219
|
# Port from MJSONWP
|
|
@@ -278,7 +282,9 @@ module Appium
|
|
|
278
282
|
data = execute :get_log, {}, { type: type.to_s }
|
|
279
283
|
|
|
280
284
|
Array(data).map do |l|
|
|
285
|
+
# steep:ignore:start
|
|
281
286
|
::Selenium::WebDriver::LogEntry.new l.fetch('level', 'UNKNOWN'), l.fetch('timestamp'), l.fetch('message')
|
|
287
|
+
# steep:ignore:end
|
|
282
288
|
rescue KeyError
|
|
283
289
|
next
|
|
284
290
|
end
|
|
@@ -36,7 +36,9 @@ module Appium
|
|
|
36
36
|
|
|
37
37
|
include ::Appium::Core::Waitable
|
|
38
38
|
|
|
39
|
+
# steep:ignore:start
|
|
39
40
|
::Selenium::WebDriver::SearchContext.extra_finders = ::Appium::Core::Base::SearchContext::APPIUM_EXTRA_FINDERS
|
|
41
|
+
# steep:ignore:end
|
|
40
42
|
|
|
41
43
|
# Private API.
|
|
42
44
|
# Do not use this for general use. Used by flutter driver to get bridge for creating a new element
|
|
@@ -57,7 +59,9 @@ module Appium
|
|
|
57
59
|
# internal use
|
|
58
60
|
@has_bidi = false
|
|
59
61
|
|
|
62
|
+
# steep:ignore:start
|
|
60
63
|
::Selenium::WebDriver::Remote::Bridge.element_class = ::Appium::Core::Element
|
|
64
|
+
# steep:ignore:end
|
|
61
65
|
bridge ||= create_bridge(**opts)
|
|
62
66
|
add_extensions(bridge.browser)
|
|
63
67
|
@bridge = listener ? ::Appium::Support::EventFiringBridge.new(bridge, listener, **original_opts) : bridge
|
|
@@ -83,7 +87,9 @@ module Appium
|
|
|
83
87
|
|
|
84
88
|
@has_bidi = capabilities && capabilities['webSocketUrl'] ? true : false
|
|
85
89
|
bridge_clzz = @has_bidi ? ::Appium::Core::Base::BiDiBridge : ::Appium::Core::Base::Bridge
|
|
90
|
+
# steep:ignore:start
|
|
86
91
|
bridge = bridge_clzz.new(**bridge_opts)
|
|
92
|
+
# steep:ignore:end
|
|
87
93
|
|
|
88
94
|
if session_id.nil?
|
|
89
95
|
bridge.create_session(capabilities)
|
|
@@ -190,9 +196,7 @@ module Appium
|
|
|
190
196
|
# @driver.test_action_command(e.id, 'action')
|
|
191
197
|
#
|
|
192
198
|
def add_command(method:, url:, name:, &block)
|
|
193
|
-
unless AVAILABLE_METHODS.include? method
|
|
194
|
-
raise ::Appium::Core::Error::ArgumentError, "Available method is either #{AVAILABLE_METHODS}"
|
|
195
|
-
end
|
|
199
|
+
raise ::Appium::Core::Error::ArgumentError, "Available method is either #{AVAILABLE_METHODS}" unless AVAILABLE_METHODS.include? method
|
|
196
200
|
|
|
197
201
|
@bridge.add_command method: method, url: url, name: name, &block
|
|
198
202
|
end
|
|
@@ -220,7 +224,9 @@ module Appium
|
|
|
220
224
|
def key_action(async: false)
|
|
221
225
|
@bridge.action(
|
|
222
226
|
async: async,
|
|
227
|
+
# steep:ignore:start
|
|
223
228
|
devices: [::Selenium::WebDriver::Interactions.key('keyboard')]
|
|
229
|
+
# steep:ignore:end
|
|
224
230
|
)
|
|
225
231
|
end
|
|
226
232
|
|
|
@@ -627,7 +633,7 @@ module Appium
|
|
|
627
633
|
#
|
|
628
634
|
def install_app(path, **options)
|
|
629
635
|
# TODO: use mobile command in the background?
|
|
630
|
-
options = options.transform_keys { |key| key.to_s.gsub(/_./) { |v| v[1]
|
|
636
|
+
options = options.transform_keys { |key| key.to_s.gsub(/_./) { |v| v[1]&.upcase } } unless options.nil?
|
|
631
637
|
@bridge.install_app(path, options)
|
|
632
638
|
end
|
|
633
639
|
|
|
@@ -40,9 +40,7 @@ module Appium
|
|
|
40
40
|
# driver.location = ::Appium::Location.new(10, 10, 10)
|
|
41
41
|
#
|
|
42
42
|
def location=(location)
|
|
43
|
-
unless location.is_a?(::Appium::Location)
|
|
44
|
-
raise TypeError, "expected #{::Appium::Location}, got #{location.inspect}:#{location.class}"
|
|
45
|
-
end
|
|
43
|
+
raise TypeError, "expected #{::Appium::Location}, got #{location.inspect}:#{location.class}" unless location.is_a?(::Appium::Location)
|
|
46
44
|
|
|
47
45
|
@bridge.set_location location.latitude, location.longitude, location.altitude
|
|
48
46
|
end
|
|
@@ -35,9 +35,7 @@ module Appium
|
|
|
35
35
|
#
|
|
36
36
|
#
|
|
37
37
|
def rotation=(orientation)
|
|
38
|
-
unless ORIENTATIONS.include?(orientation)
|
|
39
|
-
raise ::Appium::Core::Error::ArgumentError, "expected #{ORIENTATIONS.inspect}, got #{orientation.inspect}"
|
|
40
|
-
end
|
|
38
|
+
raise ::Appium::Core::Error::ArgumentError, "expected #{ORIENTATIONS.inspect}, got #{orientation.inspect}" unless ORIENTATIONS.include?(orientation)
|
|
41
39
|
|
|
42
40
|
bridge.screen_orientation = orientation.to_s.upcase
|
|
43
41
|
end
|
|
@@ -16,7 +16,6 @@ module Appium
|
|
|
16
16
|
module Core
|
|
17
17
|
class Base
|
|
18
18
|
module SearchContext
|
|
19
|
-
# rubocop:disable Layout/LineLength
|
|
20
19
|
#
|
|
21
20
|
# Find the first element matching the given arguments
|
|
22
21
|
#
|
|
@@ -89,7 +88,6 @@ module Appium
|
|
|
89
88
|
# e = find_element :class_chain, "**/XCUIElementTypeStaticText[$name == 'Buttons'$]"
|
|
90
89
|
# e.tag_name #=> "XCUIElementTypeStaticText"
|
|
91
90
|
#
|
|
92
|
-
# rubocop:enable Layout/LineLength
|
|
93
91
|
APPIUM_EXTRA_FINDERS = {
|
|
94
92
|
accessibility_id: 'accessibility id',
|
|
95
93
|
image: '-image',
|
|
@@ -64,18 +64,9 @@ module Appium
|
|
|
64
64
|
match_func: 'BruteForce',
|
|
65
65
|
good_matches_factor: nil,
|
|
66
66
|
visualize: false)
|
|
67
|
-
unless MATCH_FEATURES[:detector_name].member?(detector_name.to_s)
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
unless MATCH_FEATURES[:match_func].member?(match_func.to_s)
|
|
72
|
-
raise ::Appium::Core::Error::ArgumentError, "match_func should be #{MATCH_FEATURES[:match_func]}"
|
|
73
|
-
end
|
|
74
|
-
|
|
75
|
-
unless MATCH_FEATURES[:visualize].member?(visualize)
|
|
76
|
-
raise ::Appium::Core::Error::ArgumentError,
|
|
77
|
-
"visualize should be #{MATCH_FEATURES[:visualize]}"
|
|
78
|
-
end
|
|
67
|
+
raise ::Appium::Core::Error::ArgumentError, "detector_name should be #{MATCH_FEATURES[:detector_name]}" unless MATCH_FEATURES[:detector_name].member?(detector_name.to_s)
|
|
68
|
+
raise ::Appium::Core::Error::ArgumentError, "match_func should be #{MATCH_FEATURES[:match_func]}" unless MATCH_FEATURES[:match_func].member?(match_func.to_s)
|
|
69
|
+
raise ::Appium::Core::Error::ArgumentError, "visualize should be #{MATCH_FEATURES[:visualize]}" unless MATCH_FEATURES[:visualize].member?(visualize)
|
|
79
70
|
|
|
80
71
|
options = {}
|
|
81
72
|
options[:detectorName] = detector_name.to_s.upcase
|
|
@@ -62,7 +62,9 @@ module Appium
|
|
|
62
62
|
end
|
|
63
63
|
|
|
64
64
|
msg = message_for timeout, message
|
|
65
|
+
# steep:ignore:start
|
|
65
66
|
msg += " (#{last_error.message})" if last_error
|
|
67
|
+
# steep:ignore:end
|
|
66
68
|
|
|
67
69
|
raise TimeoutError, msg
|
|
68
70
|
end
|
|
@@ -109,7 +111,9 @@ module Appium
|
|
|
109
111
|
end
|
|
110
112
|
|
|
111
113
|
msg = message_for timeout, message
|
|
114
|
+
# steep:ignore:start
|
|
112
115
|
msg += " (#{last_error.message})" if last_error
|
|
116
|
+
# steep:ignore:end
|
|
113
117
|
|
|
114
118
|
raise TimeoutError, msg
|
|
115
119
|
end
|
|
@@ -484,9 +484,7 @@ module Appium
|
|
|
484
484
|
|
|
485
485
|
@driver.manage.timeouts.implicit_wait = wait
|
|
486
486
|
rescue ::Selenium::WebDriver::Error::UnknownError => e
|
|
487
|
-
unless e.message.include?('The operation requested is not yet implemented')
|
|
488
|
-
raise ::Appium::Core::Error::ServerError, e.message
|
|
489
|
-
end
|
|
487
|
+
raise ::Appium::Core::Error::ServerError, e.message unless e.message.include?('The operation requested is not yet implemented')
|
|
490
488
|
|
|
491
489
|
::Appium::Logger.debug(e.message)
|
|
492
490
|
{}
|
|
@@ -602,12 +600,19 @@ module Appium
|
|
|
602
600
|
|
|
603
601
|
# @private
|
|
604
602
|
def get_caps(opts)
|
|
605
|
-
|
|
603
|
+
o = opts || {}
|
|
604
|
+
|
|
605
|
+
raw_caps = o[:caps] || o[:capabilities]
|
|
606
|
+
caps_hash = raw_caps.is_a?(Hash) ? raw_caps : {}
|
|
607
|
+
|
|
608
|
+
Core::Base::Capabilities.new(caps_hash)
|
|
606
609
|
end
|
|
607
610
|
|
|
608
|
-
# @private
|
|
609
611
|
def get_appium_lib_opts(opts)
|
|
610
|
-
opts
|
|
612
|
+
o = opts || {}
|
|
613
|
+
|
|
614
|
+
val = o[:appium_lib]
|
|
615
|
+
val.is_a?(Hash) ? val : {}
|
|
611
616
|
end
|
|
612
617
|
|
|
613
618
|
# @private
|
|
@@ -621,17 +626,21 @@ module Appium
|
|
|
621
626
|
# Use @caps[:app] without modifications if the path isn't HTTP/S or local path.
|
|
622
627
|
def set_app_path
|
|
623
628
|
# FIXME: maybe `:app` should check `app` as well.
|
|
624
|
-
return unless @caps
|
|
629
|
+
return unless @caps
|
|
630
|
+
|
|
631
|
+
app = get_app # for steep reason
|
|
632
|
+
return unless app && app.empty?
|
|
625
633
|
|
|
626
634
|
uri_regex = defined?(URI::RFC2396_PARSER) ? URI::RFC2396_PARSER : URI::DEFAULT_PARSER
|
|
627
|
-
return if
|
|
635
|
+
return if app =~ uri_regex.make_regexp
|
|
628
636
|
|
|
629
|
-
|
|
637
|
+
# steep:ignore
|
|
638
|
+
app_path = File.expand_path(app)
|
|
630
639
|
@caps['app'] = if File.exist? app_path
|
|
631
640
|
app_path
|
|
632
641
|
else
|
|
633
|
-
::Appium::Logger.warn("Use #{
|
|
634
|
-
|
|
642
|
+
::Appium::Logger.warn("Use #{app} directly since #{app_path} does not exist.")
|
|
643
|
+
app
|
|
635
644
|
end
|
|
636
645
|
end
|
|
637
646
|
|
|
@@ -659,7 +668,7 @@ module Appium
|
|
|
659
668
|
def set_appium_device
|
|
660
669
|
# https://code.google.com/p/selenium/source/browse/spec-draft.md?repo=mobile
|
|
661
670
|
@device = get_cap 'platformName'
|
|
662
|
-
return
|
|
671
|
+
return unless @device
|
|
663
672
|
|
|
664
673
|
@device = convert_to_symbol(convert_downcase(@device))
|
|
665
674
|
end
|
|
@@ -19,7 +19,9 @@ module Appium
|
|
|
19
19
|
class Element < ::Selenium::WebDriver::Element
|
|
20
20
|
include ::Appium::Core::Base::TakesScreenshot
|
|
21
21
|
|
|
22
|
+
# steep:ignore:start
|
|
22
23
|
::Selenium::WebDriver::SearchContext.extra_finders = ::Appium::Core::Base::SearchContext::APPIUM_EXTRA_FINDERS
|
|
24
|
+
# steep:ignore:end
|
|
23
25
|
|
|
24
26
|
# Retuns the element id.
|
|
25
27
|
#
|
|
@@ -58,16 +60,18 @@ module Appium
|
|
|
58
60
|
respond_to?(method_name) ? attribute(method_name.to_s.tr('_', '-')) : super
|
|
59
61
|
end
|
|
60
62
|
|
|
61
|
-
def respond_to_missing?(
|
|
63
|
+
def respond_to_missing?(_method_name, _include_private = false)
|
|
62
64
|
true
|
|
63
65
|
end
|
|
64
66
|
|
|
65
67
|
# Alias for type
|
|
66
68
|
alias type send_keys
|
|
67
69
|
|
|
70
|
+
# @deprecated Please use `Element#rect` instead to get location information.
|
|
71
|
+
#
|
|
68
72
|
# For use with location_rel.
|
|
69
73
|
#
|
|
70
|
-
# @return [
|
|
74
|
+
# @return [Struct(:x, :y)] the relative x, y in a struct in string.
|
|
71
75
|
#
|
|
72
76
|
# @example
|
|
73
77
|
#
|
|
@@ -86,7 +90,8 @@ module Appium
|
|
|
86
90
|
center_y = location_y + (size_height / 2.0)
|
|
87
91
|
|
|
88
92
|
w = driver.window_size
|
|
89
|
-
|
|
93
|
+
point = Struct.new(:x, :y)
|
|
94
|
+
point.new("#{center_x} / #{w.width.to_f}", "#{center_y} / #{w.height.to_f}")
|
|
90
95
|
end
|
|
91
96
|
|
|
92
97
|
# Return an element screenshot as base64
|
|
@@ -22,9 +22,6 @@ module Appium
|
|
|
22
22
|
module Xcuitest
|
|
23
23
|
module Device
|
|
24
24
|
extend Forwardable
|
|
25
|
-
|
|
26
|
-
# rubocop:disable Layout/LineLength
|
|
27
|
-
|
|
28
25
|
# @!method hide_keyboard(close_key = nil)
|
|
29
26
|
# Hide the onscreen keyboard
|
|
30
27
|
# @param [String] close_key The name of the key which closes the keyboard.
|
|
@@ -168,8 +165,6 @@ module Appium
|
|
|
168
165
|
# @driver.battery_info #=> { state: :full, level: 0.7 }
|
|
169
166
|
#
|
|
170
167
|
|
|
171
|
-
# rubocop:enable Layout/LineLength
|
|
172
|
-
|
|
173
168
|
####
|
|
174
169
|
## class << self
|
|
175
170
|
####
|
|
@@ -19,9 +19,6 @@ module Appium
|
|
|
19
19
|
module Mac2
|
|
20
20
|
module Device
|
|
21
21
|
extend Forwardable
|
|
22
|
-
|
|
23
|
-
# rubocop:disable Layout/LineLength
|
|
24
|
-
|
|
25
22
|
# @since Appium 1.20.0
|
|
26
23
|
# @!method start_recording_screen(remote_path: nil, user: nil, pass: nil, method: 'PUT', file_field_name: nil, form_fields: nil, headers: nil, force_restart: nil, fps: nil, preset: nil, video_filter: nil, enable_capture_clicks: nil, enable_cursor_capture: nil, device_id: nil, time_limit: nil)
|
|
27
24
|
#
|
|
@@ -75,8 +72,6 @@ module Appium
|
|
|
75
72
|
# @driver.start_recording_screen fps: 30, enable_cursor_capture: true
|
|
76
73
|
#
|
|
77
74
|
|
|
78
|
-
# rubocop:enable Layout/LineLength
|
|
79
|
-
|
|
80
75
|
####
|
|
81
76
|
## class << self
|
|
82
77
|
####
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
|
|
15
15
|
module Appium
|
|
16
16
|
module Core
|
|
17
|
-
VERSION = '11.
|
|
18
|
-
DATE = '2025-
|
|
17
|
+
VERSION = '11.2.1' unless defined? ::Appium::Core::VERSION
|
|
18
|
+
DATE = '2025-12-25' unless defined? ::Appium::Core::DATE
|
|
19
19
|
end
|
|
20
20
|
end
|
|
@@ -19,9 +19,6 @@ module Appium
|
|
|
19
19
|
module Windows
|
|
20
20
|
module Device
|
|
21
21
|
extend Forwardable
|
|
22
|
-
|
|
23
|
-
# rubocop:disable Layout/LineLength
|
|
24
|
-
|
|
25
22
|
# @since Appium 1.18.0
|
|
26
23
|
# @!method start_recording_screen(remote_path: nil, user: nil, pass: nil, method: 'PUT', force_restart: nil, time_limit: nil, fps: nil, preset: nil, video_filter: nil, capture_clicks: nil, capture_cursor: nil, audio_input: nil)
|
|
27
24
|
#
|
|
@@ -69,8 +66,6 @@ module Appium
|
|
|
69
66
|
# @driver.start_recording_screen capture_cursor: true, capture_clicks: true, time_limit: '260'
|
|
70
67
|
#
|
|
71
68
|
|
|
72
|
-
# rubocop:enable Layout/LineLength
|
|
73
|
-
|
|
74
69
|
####
|
|
75
70
|
## class << self
|
|
76
71
|
####
|