appium_lib_core 11.2.0 → 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 +3 -0
- data/Gemfile +1 -1
- data/README.md +2 -2
- data/Rakefile +0 -4
- 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/bridge.rb +1 -1
- data/lib/appium_lib_core/common/base/driver.rb +1 -3
- 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.rb +0 -1
- data/lib/appium_lib_core/driver.rb +1 -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/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/bridge.rbs +1 -1
- data/sig/lib/appium_lib_core/common/base.rbs +4 -0
- data/sig/lib/appium_lib_core/common.rbs +4 -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
- metadata +12 -29
- data/lib/appium_lib_core/common/ws/websocket.rb +0 -169
- data/sig/gems/faye.rbs +0 -10
- 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
data/Gemfile
CHANGED
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
|
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']
|
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
|
|
@@ -96,7 +96,7 @@ module Appium
|
|
|
96
96
|
# caps: {
|
|
97
97
|
# platformName: :ios,
|
|
98
98
|
# automationName: 'XCUITest',
|
|
99
|
-
# app: 'test/functional/app/
|
|
99
|
+
# app: 'test/functional/app/UIKitCatalog-iphonesimulator.zip',
|
|
100
100
|
# platformVersion: '11.4',
|
|
101
101
|
# deviceName: 'iPhone Simulator',
|
|
102
102
|
# useNewWDA: true,
|
|
@@ -196,9 +196,7 @@ module Appium
|
|
|
196
196
|
# @driver.test_action_command(e.id, 'action')
|
|
197
197
|
#
|
|
198
198
|
def add_command(method:, url:, name:, &block)
|
|
199
|
-
unless AVAILABLE_METHODS.include? method
|
|
200
|
-
raise ::Appium::Core::Error::ArgumentError, "Available method is either #{AVAILABLE_METHODS}"
|
|
201
|
-
end
|
|
199
|
+
raise ::Appium::Core::Error::ArgumentError, "Available method is either #{AVAILABLE_METHODS}" unless AVAILABLE_METHODS.include? method
|
|
202
200
|
|
|
203
201
|
@bridge.add_command method: method, url: url, name: name, &block
|
|
204
202
|
end
|
|
@@ -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
|
|
@@ -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
|
{}
|
|
@@ -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.2.
|
|
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
|
####
|
|
@@ -84,7 +84,7 @@ module Appium
|
|
|
84
84
|
# caps: {
|
|
85
85
|
# platformName: :ios,
|
|
86
86
|
# automationName: 'XCUITest',
|
|
87
|
-
# app: 'test/functional/app/
|
|
87
|
+
# app: 'test/functional/app/UIKitCatalog-iphonesimulator.zip',
|
|
88
88
|
# platformVersion: '11.4',
|
|
89
89
|
# deviceName: 'iPhone Simulator',
|
|
90
90
|
# useNewWDA: true,
|
metadata
CHANGED
|
@@ -1,35 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: appium_lib_core
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 11.2.
|
|
4
|
+
version: 11.2.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Kazuaki MATSUO
|
|
8
|
-
autorequire:
|
|
9
8
|
bindir: exe
|
|
10
9
|
cert_chain: []
|
|
11
|
-
date:
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
12
11
|
dependencies:
|
|
13
|
-
- !ruby/object:Gem::Dependency
|
|
14
|
-
name: faye-websocket
|
|
15
|
-
requirement: !ruby/object:Gem::Requirement
|
|
16
|
-
requirements:
|
|
17
|
-
- - ">="
|
|
18
|
-
- !ruby/object:Gem::Version
|
|
19
|
-
version: '0.11'
|
|
20
|
-
- - "<"
|
|
21
|
-
- !ruby/object:Gem::Version
|
|
22
|
-
version: '0.13'
|
|
23
|
-
type: :runtime
|
|
24
|
-
prerelease: false
|
|
25
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
26
|
-
requirements:
|
|
27
|
-
- - ">="
|
|
28
|
-
- !ruby/object:Gem::Version
|
|
29
|
-
version: '0.11'
|
|
30
|
-
- - "<"
|
|
31
|
-
- !ruby/object:Gem::Version
|
|
32
|
-
version: '0.13'
|
|
33
12
|
- !ruby/object:Gem::Dependency
|
|
34
13
|
name: selenium-webdriver
|
|
35
14
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -113,7 +92,6 @@ files:
|
|
|
113
92
|
- lib/appium_lib_core/common/logger.rb
|
|
114
93
|
- lib/appium_lib_core/common/wait.rb
|
|
115
94
|
- lib/appium_lib_core/common/wait/timer.rb
|
|
116
|
-
- lib/appium_lib_core/common/ws/websocket.rb
|
|
117
95
|
- lib/appium_lib_core/device.rb
|
|
118
96
|
- lib/appium_lib_core/driver.rb
|
|
119
97
|
- lib/appium_lib_core/element.rb
|
|
@@ -138,7 +116,6 @@ files:
|
|
|
138
116
|
- rbs_collection.lock.yaml
|
|
139
117
|
- rbs_collection.yaml
|
|
140
118
|
- sig/gems/em.rbs
|
|
141
|
-
- sig/gems/faye.rbs
|
|
142
119
|
- sig/gems/forwardable.rbs
|
|
143
120
|
- sig/gems/selenium/abstract_event_listener.rbs
|
|
144
121
|
- sig/gems/selenium/atoms.rbs
|
|
@@ -186,6 +163,7 @@ files:
|
|
|
186
163
|
- sig/gems/selenium/uploads_files.rbs
|
|
187
164
|
- sig/interfaces/bridge.rbs
|
|
188
165
|
- sig/lib/appium_lib_core.rbs
|
|
166
|
+
- sig/lib/appium_lib_core/android.rbs
|
|
189
167
|
- sig/lib/appium_lib_core/android/device.rbs
|
|
190
168
|
- sig/lib/appium_lib_core/android/device/auth_finger_print.rbs
|
|
191
169
|
- sig/lib/appium_lib_core/android/device/clipboard.rbs
|
|
@@ -195,7 +173,12 @@ files:
|
|
|
195
173
|
- sig/lib/appium_lib_core/android/espresso/bridge.rbs
|
|
196
174
|
- sig/lib/appium_lib_core/android/uiautomator1/bridge.rbs
|
|
197
175
|
- sig/lib/appium_lib_core/android/uiautomator2/bridge.rbs
|
|
176
|
+
- sig/lib/appium_lib_core/android/uiautomator2/device.rbs
|
|
198
177
|
- sig/lib/appium_lib_core/android/uiautomator2/device/battery.rbs
|
|
178
|
+
- sig/lib/appium_lib_core/android_espresso.rbs
|
|
179
|
+
- sig/lib/appium_lib_core/android_uiautomator2.rbs
|
|
180
|
+
- sig/lib/appium_lib_core/common.rbs
|
|
181
|
+
- sig/lib/appium_lib_core/common/base.rbs
|
|
199
182
|
- sig/lib/appium_lib_core/common/base/bidi_bridge.rbs
|
|
200
183
|
- sig/lib/appium_lib_core/common/base/bridge.rbs
|
|
201
184
|
- sig/lib/appium_lib_core/common/base/capabilities.rbs
|
|
@@ -231,7 +214,6 @@ files:
|
|
|
231
214
|
- sig/lib/appium_lib_core/common/logger.rbs
|
|
232
215
|
- sig/lib/appium_lib_core/common/wait.rbs
|
|
233
216
|
- sig/lib/appium_lib_core/common/wait/timer.rbs
|
|
234
|
-
- sig/lib/appium_lib_core/common/ws/websocket.rbs
|
|
235
217
|
- sig/lib/appium_lib_core/device.rbs
|
|
236
218
|
- sig/lib/appium_lib_core/driver.rbs
|
|
237
219
|
- sig/lib/appium_lib_core/element.rbs
|
|
@@ -242,11 +224,14 @@ files:
|
|
|
242
224
|
- sig/lib/appium_lib_core/ios/xcuitest/device/battery.rbs
|
|
243
225
|
- sig/lib/appium_lib_core/ios/xcuitest/device/performance.rbs
|
|
244
226
|
- sig/lib/appium_lib_core/ios/xcuitest/device/screen.rbs
|
|
227
|
+
- sig/lib/appium_lib_core/ios_xcuitest.rbs
|
|
228
|
+
- sig/lib/appium_lib_core/mac2.rbs
|
|
245
229
|
- sig/lib/appium_lib_core/mac2/bridge.rbs
|
|
246
230
|
- sig/lib/appium_lib_core/mac2/device.rbs
|
|
247
231
|
- sig/lib/appium_lib_core/mac2/device/screen.rbs
|
|
248
232
|
- sig/lib/appium_lib_core/support/event_firing_bridge.rbs
|
|
249
233
|
- sig/lib/appium_lib_core/version.rbs
|
|
234
|
+
- sig/lib/appium_lib_core/windows.rbs
|
|
250
235
|
- sig/lib/appium_lib_core/windows/bridge.rbs
|
|
251
236
|
- sig/lib/appium_lib_core/windows/device.rbs
|
|
252
237
|
- sig/lib/appium_lib_core/windows/device/screen.rbs
|
|
@@ -255,7 +240,6 @@ licenses:
|
|
|
255
240
|
- Apache-2.0
|
|
256
241
|
metadata:
|
|
257
242
|
rubygems_mfa_required: 'true'
|
|
258
|
-
post_install_message:
|
|
259
243
|
rdoc_options: []
|
|
260
244
|
require_paths:
|
|
261
245
|
- lib
|
|
@@ -270,8 +254,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
270
254
|
- !ruby/object:Gem::Version
|
|
271
255
|
version: '0'
|
|
272
256
|
requirements: []
|
|
273
|
-
rubygems_version:
|
|
274
|
-
signing_key:
|
|
257
|
+
rubygems_version: 4.0.3
|
|
275
258
|
specification_version: 4
|
|
276
259
|
summary: Minimal Ruby library for Appium.
|
|
277
260
|
test_files: []
|
|
@@ -1,169 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
-
# you may not use this file except in compliance with the License.
|
|
5
|
-
# You may obtain a copy of the License at
|
|
6
|
-
#
|
|
7
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
-
#
|
|
9
|
-
# Unless required by applicable law or agreed to in writing, software
|
|
10
|
-
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
-
# See the License for the specific language governing permissions and
|
|
13
|
-
# limitations under the License.
|
|
14
|
-
|
|
15
|
-
require 'faye/websocket'
|
|
16
|
-
require 'eventmachine'
|
|
17
|
-
|
|
18
|
-
module Appium
|
|
19
|
-
module Core
|
|
20
|
-
class WebSocket
|
|
21
|
-
attr_reader :client, :endpoint
|
|
22
|
-
|
|
23
|
-
# A websocket client based on Faye::WebSocket::Client .
|
|
24
|
-
# Uses eventmachine to wait response from the peer. The eventmachine works on a thread. The thread will exit
|
|
25
|
-
# with close method.
|
|
26
|
-
#
|
|
27
|
-
# @param [String] url URL to establish web socket connection. If the URL has no port, the client use:
|
|
28
|
-
# +ws+: 80, +wss+: 443 ports.
|
|
29
|
-
# @param [Array] protocols An array of strings representing acceptable subprotocols for use over the socket.
|
|
30
|
-
# The driver will negotiate one of these to use via the Sec-WebSocket-Protocol header
|
|
31
|
-
# if supported by the other peer. Default is nil.
|
|
32
|
-
# The protocols is equal to https://github.com/faye/faye-websocket-ruby/ 's one for client.
|
|
33
|
-
# @param [Hash] options Initialize options for Faye client. Read https://github.com/faye/faye-websocket-ruby#initialization-options
|
|
34
|
-
# for more details. Default is +{}+.
|
|
35
|
-
#
|
|
36
|
-
# @example
|
|
37
|
-
# ws = WebSocket.new(url: "ws://#{host}:#{port}/ws/session/#{@session_id}/appium/device/logcat")
|
|
38
|
-
# ws.client #=> #<Faye::WebSocket::Client:.....> # An instance of Faye::WebSocket::Client
|
|
39
|
-
# ws.message 'some message' #=> nil. Send a message to the peer.
|
|
40
|
-
# ws.close #=> Kill the thread which run a eventmachine.
|
|
41
|
-
#
|
|
42
|
-
def initialize(url:, protocols: nil, options: {})
|
|
43
|
-
@endpoint = url
|
|
44
|
-
|
|
45
|
-
@ws_thread = Thread.new do
|
|
46
|
-
# steep:ignore:start
|
|
47
|
-
EM.run do
|
|
48
|
-
@client ||= ::Faye::WebSocket::Client.new(url, protocols, options)
|
|
49
|
-
|
|
50
|
-
@client.on :open do |_open|
|
|
51
|
-
handle_open
|
|
52
|
-
end
|
|
53
|
-
|
|
54
|
-
@client.on :message do |message|
|
|
55
|
-
handle_message_data(message.data)
|
|
56
|
-
end
|
|
57
|
-
|
|
58
|
-
@client.on :error do |_error|
|
|
59
|
-
handle_error
|
|
60
|
-
end
|
|
61
|
-
|
|
62
|
-
@client.on :close do |close|
|
|
63
|
-
handle_close(close.code, close.reason)
|
|
64
|
-
end
|
|
65
|
-
end
|
|
66
|
-
# steep:ignore:end
|
|
67
|
-
end
|
|
68
|
-
end
|
|
69
|
-
|
|
70
|
-
# Client
|
|
71
|
-
|
|
72
|
-
#
|
|
73
|
-
# Sends a ping frame with an optional message and fires the callback when a matching pong is received.
|
|
74
|
-
#
|
|
75
|
-
# @param [String] message A message to send ping.
|
|
76
|
-
# @param [Block] callback
|
|
77
|
-
#
|
|
78
|
-
# @example
|
|
79
|
-
# ws = WebSocket.new(url: "ws://#{host}:#{port}/ws/session/#{@session_id}/appium/device/logcat")
|
|
80
|
-
# ws.ping 'message'
|
|
81
|
-
#
|
|
82
|
-
def ping(message, &callback)
|
|
83
|
-
@client.ping message, &callback
|
|
84
|
-
end
|
|
85
|
-
|
|
86
|
-
# Accepts either a String or an Array of byte-sized integers and sends a text or binary message over the connection
|
|
87
|
-
# to the other peer; binary data must be encoded as an Array.
|
|
88
|
-
#
|
|
89
|
-
# @param [String, Array] message A message to send a text or binary message over the connection
|
|
90
|
-
#
|
|
91
|
-
# @example
|
|
92
|
-
# ws = WebSocket.new(url: "ws://#{host}:#{port}/ws/session/#{@session_id}/appium/device/logcat")
|
|
93
|
-
# ws.send 'happy testing'
|
|
94
|
-
#
|
|
95
|
-
def send(message)
|
|
96
|
-
@client.send message
|
|
97
|
-
end
|
|
98
|
-
|
|
99
|
-
# Closes the connection, sending the given status code and reason text, both of which are optional.
|
|
100
|
-
#
|
|
101
|
-
# @param [Integer] code A status code to send to the peer with close signal. Default is nil.
|
|
102
|
-
# @param [String] reason A reason to send to the peer with close signal. Default is 'close from ruby_lib_core'.
|
|
103
|
-
#
|
|
104
|
-
# @example
|
|
105
|
-
# ws = WebSocket.new(url: "ws://#{host}:#{port}/ws/session/#{@session_id}/appium/device/logcat")
|
|
106
|
-
# ws.close reason: 'a something special reason'
|
|
107
|
-
#
|
|
108
|
-
def close(code: nil, reason: 'close from ruby_lib_core')
|
|
109
|
-
if @client.nil?
|
|
110
|
-
::Appium::Logger.warn 'Websocket was closed'
|
|
111
|
-
else
|
|
112
|
-
@client.close code, reason
|
|
113
|
-
end
|
|
114
|
-
@ws_thread.exit
|
|
115
|
-
end
|
|
116
|
-
|
|
117
|
-
# Response from server
|
|
118
|
-
|
|
119
|
-
#
|
|
120
|
-
# Fires when the socket connection is established. Event has no attributes.
|
|
121
|
-
#
|
|
122
|
-
# Default is just put a debug message.
|
|
123
|
-
#
|
|
124
|
-
def handle_open
|
|
125
|
-
::Appium::Logger.debug("#{self.class} :open")
|
|
126
|
-
end
|
|
127
|
-
|
|
128
|
-
# Standard out by default
|
|
129
|
-
# In general, users should customise only message_data
|
|
130
|
-
|
|
131
|
-
#
|
|
132
|
-
# Fires when the socket receives a message. The message gas one +data+ attribute and this method can handle the data.
|
|
133
|
-
# The data is either a String (for text frames) or an Array of byte-sized integers (for binary frames).
|
|
134
|
-
#
|
|
135
|
-
# Default is just put a debug message and puts the result on standard out.
|
|
136
|
-
# In general, users should override this handler to handle messages from the peer.
|
|
137
|
-
#
|
|
138
|
-
def handle_message_data(data)
|
|
139
|
-
::Appium::Logger.debug("#{self.class} :message #{data}")
|
|
140
|
-
$stdout << "#{data}\n"
|
|
141
|
-
end
|
|
142
|
-
|
|
143
|
-
#
|
|
144
|
-
# Fires when there is a protocol error due to bad data sent by the other peer.
|
|
145
|
-
# This event is purely informational, you do not need to implement error recovery.
|
|
146
|
-
#
|
|
147
|
-
# Default is just put a error message.
|
|
148
|
-
#
|
|
149
|
-
def handle_error
|
|
150
|
-
::Appium::Logger.error("#{self.class} :error")
|
|
151
|
-
end
|
|
152
|
-
|
|
153
|
-
#
|
|
154
|
-
# Fires when either the client or the server closes the connection. The method gets +code+ and +reason+ attributes.
|
|
155
|
-
# They expose the status code and message sent by the peer that closed the connection.
|
|
156
|
-
#
|
|
157
|
-
# Default is just put a error message.
|
|
158
|
-
# The methods also clear +client+ instance and stop the eventmachine which is called in initialising this class.
|
|
159
|
-
#
|
|
160
|
-
def handle_close(code, reason)
|
|
161
|
-
::Appium::Logger.debug("#{self.class} :close #{code} #{reason}")
|
|
162
|
-
@client = nil
|
|
163
|
-
# steep:ignore:start
|
|
164
|
-
EM.stop
|
|
165
|
-
# steep:ignore:end
|
|
166
|
-
end
|
|
167
|
-
end # module WebSocket
|
|
168
|
-
end # module Core
|
|
169
|
-
end # module Appium
|
data/sig/gems/faye.rbs
DELETED
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
module Appium
|
|
2
|
-
module Core
|
|
3
|
-
class WebSocket
|
|
4
|
-
@endpoint: untyped
|
|
5
|
-
|
|
6
|
-
@ws_thread: untyped
|
|
7
|
-
|
|
8
|
-
@client: untyped
|
|
9
|
-
|
|
10
|
-
attr_reader client: untyped
|
|
11
|
-
|
|
12
|
-
attr_reader endpoint: untyped
|
|
13
|
-
|
|
14
|
-
# A websocket client based on Faye::WebSocket::Client .
|
|
15
|
-
# Uses eventmachine to wait response from the peer. The eventmachine works on a thread. The thread will exit
|
|
16
|
-
# with close method.
|
|
17
|
-
#
|
|
18
|
-
# @param [String] url URL to establish web socket connection. If the URL has no port, the client use:
|
|
19
|
-
# +ws+: 80, +wss+: 443 ports.
|
|
20
|
-
# @param [Array] protocols An array of strings representing acceptable subprotocols for use over the socket.
|
|
21
|
-
# The driver will negotiate one of these to use via the Sec-WebSocket-Protocol header
|
|
22
|
-
# if supported by the other peer. Default is nil.
|
|
23
|
-
# The protocols is equal to https://github.com/faye/faye-websocket-ruby/ 's one for client.
|
|
24
|
-
# @param [Hash] options Initialize options for Faye client. Read https://github.com/faye/faye-websocket-ruby#initialization-options
|
|
25
|
-
# for more details. Default is +{}+.
|
|
26
|
-
#
|
|
27
|
-
# @example
|
|
28
|
-
# ws = WebSocket.new(url: "ws://#{host}:#{port}/ws/session/#{@session_id}/appium/device/logcat")
|
|
29
|
-
# ws.client #=> #<Faye::WebSocket::Client:.....> # An instance of Faye::WebSocket::Client
|
|
30
|
-
# ws.message 'some message' #=> nil. Send a message to the peer.
|
|
31
|
-
# ws.close #=> Kill the thread which run a eventmachine.
|
|
32
|
-
#
|
|
33
|
-
def initialize: (url: untyped, ?protocols: untyped?, ?options: ::Hash[untyped, untyped]) -> void
|
|
34
|
-
|
|
35
|
-
#
|
|
36
|
-
# Sends a ping frame with an optional message and fires the callback when a matching pong is received.
|
|
37
|
-
#
|
|
38
|
-
# @param [String] message A message to send ping.
|
|
39
|
-
# @param [Block] callback
|
|
40
|
-
#
|
|
41
|
-
# @example
|
|
42
|
-
# ws = WebSocket.new(url: "ws://#{host}:#{port}/ws/session/#{@session_id}/appium/device/logcat")
|
|
43
|
-
# ws.ping 'message'
|
|
44
|
-
#
|
|
45
|
-
def ping: (untyped message) { (?) -> untyped } -> untyped
|
|
46
|
-
|
|
47
|
-
# Accepts either a String or an Array of byte-sized integers and sends a text or binary message over the connection
|
|
48
|
-
# to the other peer; binary data must be encoded as an Array.
|
|
49
|
-
#
|
|
50
|
-
# @param [String|Array] message A message to send a text or binary message over the connection
|
|
51
|
-
#
|
|
52
|
-
# @example
|
|
53
|
-
# ws = WebSocket.new(url: "ws://#{host}:#{port}/ws/session/#{@session_id}/appium/device/logcat")
|
|
54
|
-
# ws.send 'happy testing'
|
|
55
|
-
#
|
|
56
|
-
def send: (untyped message) -> untyped
|
|
57
|
-
|
|
58
|
-
# Closes the connection, sending the given status code and reason text, both of which are optional.
|
|
59
|
-
#
|
|
60
|
-
# @param [Integer] code A status code to send to the peer with close signal. Default is nil.
|
|
61
|
-
# @param [String] reason A reason to send to the peer with close signal. Default is 'close from ruby_lib_core'.
|
|
62
|
-
#
|
|
63
|
-
# @example
|
|
64
|
-
# ws = WebSocket.new(url: "ws://#{host}:#{port}/ws/session/#{@session_id}/appium/device/logcat")
|
|
65
|
-
# ws.close reason: 'a something special reason'
|
|
66
|
-
#
|
|
67
|
-
def close: (?code: untyped?, ?reason: ::String) -> untyped
|
|
68
|
-
|
|
69
|
-
#
|
|
70
|
-
# Fires when the socket connection is established. Event has no attributes.
|
|
71
|
-
#
|
|
72
|
-
# Default is just put a debug message.
|
|
73
|
-
#
|
|
74
|
-
def handle_open: () -> untyped
|
|
75
|
-
|
|
76
|
-
#
|
|
77
|
-
# Fires when the socket receives a message. The message gas one +data+ attribute and this method can handle the data.
|
|
78
|
-
# The data is either a String (for text frames) or an Array of byte-sized integers (for binary frames).
|
|
79
|
-
#
|
|
80
|
-
# Default is just put a debug message and puts the result on standard out.
|
|
81
|
-
# In general, users should override this handler to handle messages from the peer.
|
|
82
|
-
#
|
|
83
|
-
def handle_message_data: (untyped data) -> untyped
|
|
84
|
-
|
|
85
|
-
#
|
|
86
|
-
# Fires when there is a protocol error due to bad data sent by the other peer.
|
|
87
|
-
# This event is purely informational, you do not need to implement error recovery.
|
|
88
|
-
#
|
|
89
|
-
# Default is just put a error message.
|
|
90
|
-
#
|
|
91
|
-
def handle_error: () -> untyped
|
|
92
|
-
|
|
93
|
-
#
|
|
94
|
-
# Fires when either the client or the server closes the connection. The method gets +code+ and +reason+ attributes.
|
|
95
|
-
# They expose the status code and message sent by the peer that closed the connection.
|
|
96
|
-
#
|
|
97
|
-
# Default is just put a error message.
|
|
98
|
-
# The methods also clear +client+ instance and stop the eventmachine which is called in initialising this class.
|
|
99
|
-
#
|
|
100
|
-
def handle_close: (untyped code, untyped reason) -> untyped
|
|
101
|
-
end
|
|
102
|
-
end
|
|
103
|
-
end
|