appium_lib 11.2.0 → 12.0.0.rc1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/dependabot.yml +8 -0
- data/.github/workflows/rubocop.yml +1 -1
- data/.rubocop.yml +89 -1
- data/CHANGELOG.md +1 -1
- data/appium_lib.gemspec +4 -4
- data/lib/appium_lib/android/common/helper.rb +2 -2
- data/lib/appium_lib/android/element/button.rb +2 -2
- data/lib/appium_lib/android/element/generic.rb +8 -12
- data/lib/appium_lib/android/espresso/element/generic.rb +20 -24
- data/lib/appium_lib/android/uiautomator2/element/button.rb +2 -2
- data/lib/appium_lib/appium.rb +22 -26
- data/lib/appium_lib/common/wait.rb +2 -3
- data/lib/appium_lib/driver.rb +3 -36
- data/lib/appium_lib/ios/xcuitest/command/gestures.rb +9 -9
- data/lib/appium_lib/version.rb +2 -2
- data/readme.md +2 -9
- metadata +24 -17
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 704f166f6740717dab8ff78e7aafeffc6c7044e32b867e2add3cc62e10908abe
|
4
|
+
data.tar.gz: d0eba4bc4e7024a764fe7eefe2dc364e4727f8cc39fd4258a23a8a06428ca16b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c63bb7969a85ffd14cd8d3afc70af45f5ea922328fb936dfbaea75e9690be8f365afaf4e71b18f99929c05150843c5b281652094d39757758209f5aad0df0765
|
7
|
+
data.tar.gz: beda668ca13cdc3b11b58f711458d2b85c8ce62c98402acaadf763e480a7b3edea60b553eac65865ae4f7dc3ddedc838fab64876a25937d612451670ed9e252e
|
data/.rubocop.yml
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
AllCops:
|
2
|
-
TargetRubyVersion: 2.
|
2
|
+
TargetRubyVersion: 2.6
|
3
3
|
Metrics/LineLength:
|
4
4
|
Max: 128
|
5
5
|
Metrics/MethodLength:
|
@@ -51,3 +51,91 @@ Style/StringConcatenation:
|
|
51
51
|
Enabled: false
|
52
52
|
Lint/NonDeterministicRequireOrder:
|
53
53
|
Enabled: false
|
54
|
+
Gemspec/DateAssignment:
|
55
|
+
Enabled: true
|
56
|
+
Layout/LineEndStringConcatenationIndentation:
|
57
|
+
Enabled: true
|
58
|
+
Layout/SpaceBeforeBrackets:
|
59
|
+
Enabled: true
|
60
|
+
Lint/AmbiguousAssignment:
|
61
|
+
Enabled: true
|
62
|
+
Lint/AmbiguousOperatorPrecedence:
|
63
|
+
Enabled: false
|
64
|
+
Lint/AmbiguousRange:
|
65
|
+
Enabled: true
|
66
|
+
Lint/DeprecatedConstants:
|
67
|
+
Enabled: true
|
68
|
+
Lint/DuplicateBranch:
|
69
|
+
Enabled: true
|
70
|
+
Lint/DuplicateRegexpCharacterClassElement:
|
71
|
+
Enabled: true
|
72
|
+
Lint/EmptyBlock:
|
73
|
+
Enabled: true
|
74
|
+
Lint/EmptyClass:
|
75
|
+
Enabled: false
|
76
|
+
Lint/EmptyInPattern:
|
77
|
+
Enabled: true
|
78
|
+
Lint/IncompatibleIoSelectWithFiberScheduler:
|
79
|
+
Enabled: true
|
80
|
+
Lint/LambdaWithoutLiteralBlock:
|
81
|
+
Enabled: true
|
82
|
+
Lint/NoReturnInBeginEndBlocks:
|
83
|
+
Enabled: true
|
84
|
+
Lint/NumberedParameterAssignment:
|
85
|
+
Enabled: true
|
86
|
+
Lint/OrAssignmentToConstant:
|
87
|
+
Enabled: true
|
88
|
+
Lint/RedundantDirGlobSort:
|
89
|
+
Enabled: true
|
90
|
+
Lint/RequireRelativeSelfPath:
|
91
|
+
Enabled: true
|
92
|
+
Lint/SymbolConversion:
|
93
|
+
Enabled: true
|
94
|
+
Lint/ToEnumArguments:
|
95
|
+
Enabled: true
|
96
|
+
Lint/TripleQuotes:
|
97
|
+
Enabled: true
|
98
|
+
Lint/UnexpectedBlockArity:
|
99
|
+
Enabled: true
|
100
|
+
Lint/UnmodifiedReduceAccumulator:
|
101
|
+
Enabled: true
|
102
|
+
Security/IoMethods:
|
103
|
+
Enabled: true
|
104
|
+
Style/ArgumentsForwarding:
|
105
|
+
Enabled: true
|
106
|
+
Style/CollectionCompact:
|
107
|
+
Enabled: true
|
108
|
+
Style/DocumentDynamicEvalDefinition:
|
109
|
+
Enabled: true
|
110
|
+
Style/EndlessMethod:
|
111
|
+
Enabled: true
|
112
|
+
Style/HashConversion:
|
113
|
+
Enabled: false
|
114
|
+
Style/HashExcept:
|
115
|
+
Enabled: true
|
116
|
+
Style/IfWithBooleanLiteralBranches:
|
117
|
+
Enabled: true
|
118
|
+
Style/InPatternThen:
|
119
|
+
Enabled: true
|
120
|
+
Style/MultilineInPatternThen:
|
121
|
+
Enabled: true
|
122
|
+
Style/NegatedIfElseCondition:
|
123
|
+
Enabled: true
|
124
|
+
Style/NilLambda:
|
125
|
+
Enabled: true
|
126
|
+
Style/NumberedParameters:
|
127
|
+
Enabled: true
|
128
|
+
Style/NumberedParametersLimit:
|
129
|
+
Enabled: true
|
130
|
+
Style/QuotedSymbols:
|
131
|
+
Enabled: true
|
132
|
+
Style/RedundantArgument:
|
133
|
+
Enabled: true
|
134
|
+
Style/RedundantSelfAssignmentBranch:
|
135
|
+
Enabled: true
|
136
|
+
Style/SelectByRegexp:
|
137
|
+
Enabled: true
|
138
|
+
Style/StringChars:
|
139
|
+
Enabled: true
|
140
|
+
Style/SwapValues:
|
141
|
+
Enabled: true
|
data/CHANGELOG.md
CHANGED
data/appium_lib.gemspec
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
require_relative 'lib/appium_lib/version'
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
|
-
s.required_ruby_version = '>= 2.
|
4
|
+
s.required_ruby_version = '>= 2.6'
|
5
5
|
|
6
6
|
s.name = 'appium_lib'
|
7
7
|
s.version = Appium::VERSION
|
@@ -14,9 +14,9 @@ Gem::Specification.new do |s|
|
|
14
14
|
s.homepage = 'https://github.com/appium/ruby_lib' # published as appium_lib
|
15
15
|
s.require_paths = ['lib']
|
16
16
|
|
17
|
-
s.add_runtime_dependency 'appium_lib_core', '
|
17
|
+
s.add_runtime_dependency 'appium_lib_core', '5.0.0.rc5'
|
18
18
|
s.add_runtime_dependency 'nokogiri', '~> 1.8', '>= 1.8.1'
|
19
|
-
s.add_runtime_dependency 'tomlrb', '
|
19
|
+
s.add_runtime_dependency 'tomlrb', '>= 1.1', '< 3.0'
|
20
20
|
|
21
21
|
s.add_development_dependency 'appium_thor', '~> 1.1', '>= 1.1.4'
|
22
22
|
s.add_development_dependency 'fakefs', '~> 1.3.0'
|
@@ -24,7 +24,7 @@ Gem::Specification.new do |s|
|
|
24
24
|
s.add_development_dependency 'posix-spawn', '~> 0.3'
|
25
25
|
s.add_development_dependency 'pry'
|
26
26
|
s.add_development_dependency 'rake', '~> 13.0'
|
27
|
-
s.add_development_dependency 'rubocop', '1.
|
27
|
+
s.add_development_dependency 'rubocop', '1.22.1'
|
28
28
|
s.add_development_dependency 'spec', '~> 5.3', '>= 5.3.4'
|
29
29
|
s.add_development_dependency 'yard', '~> 0.9.11'
|
30
30
|
|
@@ -234,11 +234,11 @@ module Appium
|
|
234
234
|
|
235
235
|
if class_name == '*'
|
236
236
|
return "//*[contains(translate(@text,'#{value.upcase}', '#{value}'), '#{value}')" \
|
237
|
-
|
237
|
+
" or contains(translate(@content-desc,'#{value.upcase}', '#{value}'), '#{value}')" + r_id + ']'
|
238
238
|
end
|
239
239
|
|
240
240
|
"//#{class_name}[contains(translate(@text,'#{value.upcase}', '#{value}'), '#{value}')" \
|
241
|
-
|
241
|
+
" or contains(translate(@content-desc,'#{value.upcase}', '#{value}'), '#{value}')" + r_id + ']'
|
242
242
|
end
|
243
243
|
|
244
244
|
# Returns a string that matches the first element that contains value
|
@@ -98,10 +98,10 @@ module Appium
|
|
98
98
|
|
99
99
|
if button_index && image_button_index
|
100
100
|
"new UiSelector().className(#{BUTTON}).instance(#{button_index});" \
|
101
|
-
|
101
|
+
"new UiSelector().className(#{IMAGE_BUTTON}).instance(#{image_button_index});"
|
102
102
|
else
|
103
103
|
"new UiSelector().className(#{BUTTON});" \
|
104
|
-
|
104
|
+
"new UiSelector().className(#{IMAGE_BUTTON});"
|
105
105
|
end
|
106
106
|
end
|
107
107
|
|
@@ -56,12 +56,10 @@ module Appium
|
|
56
56
|
rid = resource_id(text, "new UiSelector().resourceId(#{text})")
|
57
57
|
args = rid.empty? ? ["new UiSelector().textContains(#{text})", "new UiSelector().descriptionContains(#{text})"] : [rid]
|
58
58
|
args.each_with_index do |arg, index|
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
raise e if index == args.size - 1
|
64
|
-
end
|
59
|
+
elem = find_element :uiautomator, scroll_uiselector(arg, scrollable_index)
|
60
|
+
return elem
|
61
|
+
rescue StandardError => e
|
62
|
+
raise e if index == args.size - 1
|
65
63
|
end
|
66
64
|
end
|
67
65
|
|
@@ -74,12 +72,10 @@ module Appium
|
|
74
72
|
rid = resource_id(text, "new UiSelector().resourceId(#{text})")
|
75
73
|
args = rid.empty? ? ["new UiSelector().text(#{text})", "new UiSelector().description(#{text})"] : [rid]
|
76
74
|
args.each_with_index do |arg, index|
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
raise e if index == args.size - 1
|
82
|
-
end
|
75
|
+
elem = find_element :uiautomator, scroll_uiselector(arg, scrollable_index)
|
76
|
+
return elem
|
77
|
+
rescue StandardError => e
|
78
|
+
raise e if index == args.size - 1
|
83
79
|
end
|
84
80
|
end
|
85
81
|
end # module Android
|
@@ -25,19 +25,17 @@ module Appium
|
|
25
25
|
w_s = window_rect
|
26
26
|
|
27
27
|
(1..30).each do |_count|
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
sleep 1 # we must wait finish scrolling
|
28
|
+
action
|
29
|
+
.move_to_location(w_s.width / 2, (w_s.height * 2) / 5) # pointer based magic number
|
30
|
+
.pointer_down(:left)
|
31
|
+
.move_to_location(0, w_s.height / 5)
|
32
|
+
.release
|
33
|
+
.perform
|
34
|
+
sleep 1 # we must wait finish scrolling
|
36
35
|
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
end
|
36
|
+
return text(text)
|
37
|
+
rescue StandardError => e
|
38
|
+
err = e
|
41
39
|
end
|
42
40
|
|
43
41
|
raise err
|
@@ -52,19 +50,17 @@ module Appium
|
|
52
50
|
w_s = window_rect
|
53
51
|
|
54
52
|
(1..30).each do |_count|
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
sleep 1 # we must wait finish scrolling
|
53
|
+
action
|
54
|
+
.move_to_location(w_s.width / 2, (w_s.height * 2) / 5) # pointer based magic number
|
55
|
+
.pointer_down(:left)
|
56
|
+
.move_to_location(0, w_s.height / 5)
|
57
|
+
.release
|
58
|
+
.perform
|
59
|
+
sleep 1 # we must wait finish scrolling
|
63
60
|
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
end
|
61
|
+
return text_exact(text)
|
62
|
+
rescue StandardError => e
|
63
|
+
err = e
|
68
64
|
end
|
69
65
|
|
70
66
|
raise err
|
@@ -101,10 +101,10 @@ module Appium
|
|
101
101
|
|
102
102
|
if button_index && image_button_index
|
103
103
|
"new UiSelector().className(#{::Appium::Android::Button}).instance(#{button_index});" \
|
104
|
-
|
104
|
+
"new UiSelector().className(#{::Appium::Android::ImageButton}).instance(#{image_button_index});"
|
105
105
|
else
|
106
106
|
"new UiSelector().className(#{::Appium::Android::Button});" \
|
107
|
-
|
107
|
+
"new UiSelector().className(#{::Appium::Android::ImageButton});"
|
108
108
|
end
|
109
109
|
end
|
110
110
|
|
data/lib/appium_lib/appium.rb
CHANGED
@@ -156,18 +156,16 @@ module Appium
|
|
156
156
|
|
157
157
|
target_modules.each do |const|
|
158
158
|
# noinspection RubyResolve
|
159
|
-
# rubocop:disable Style/MultilineIfModifier
|
160
159
|
driver.public_methods(false).each do |m|
|
160
|
+
# override unless there's an existing method with matching arity
|
161
|
+
next if const.respond_to?(m) && const.method(m).arity == driver.method(m).arity
|
162
|
+
|
161
163
|
const.send(:define_singleton_method, m) do |*args, &block|
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
end
|
167
|
-
# override unless there's an existing method with matching arity
|
168
|
-
end unless const.respond_to?(m) && const.method(m).arity == driver.method(m).arity
|
164
|
+
super(*args, &block) # promote.rb
|
165
|
+
rescue NoMethodError, ArgumentError
|
166
|
+
driver.send m, *args, &block if driver.respond_to?(m)
|
167
|
+
end
|
169
168
|
end
|
170
|
-
# rubocop:enable Style/MultilineIfModifier
|
171
169
|
end
|
172
170
|
end
|
173
171
|
|
@@ -210,23 +208,21 @@ module Appium
|
|
210
208
|
end
|
211
209
|
|
212
210
|
define_method method do |*args, &block|
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
driver.send method, *args, &block if driver.respond_to?(method)
|
229
|
-
end
|
211
|
+
# Prefer existing method.
|
212
|
+
# super will invoke method missing on driver
|
213
|
+
super(*args, &block)
|
214
|
+
|
215
|
+
# minitest also defines a name method,
|
216
|
+
# so rescue argument error
|
217
|
+
# and call the name method on $driver
|
218
|
+
rescue NoMethodError, ArgumentError
|
219
|
+
if args.size == 1 && args.first.is_a?(Hash)
|
220
|
+
# To prevent warnings by keyword arguments (for Ruby 2.7 and 3)
|
221
|
+
driver.send method, **args.first, &block if driver.respond_to?(method)
|
222
|
+
else
|
223
|
+
::Appium::Logger.warn "Should fix this '#{args}' for Ruby 2.7 (and 3)" if args.first.is_a?(Hash)
|
224
|
+
|
225
|
+
driver.send method, *args, &block if driver.respond_to?(method)
|
230
226
|
end
|
231
227
|
end
|
232
228
|
end
|
@@ -42,7 +42,7 @@ module Appium
|
|
42
42
|
# wait_true(20) { button_exact('Back') }.click
|
43
43
|
#
|
44
44
|
def wait_true(opts = {})
|
45
|
-
opts =
|
45
|
+
opts = { timeout: opts } if opts.is_a? Numeric
|
46
46
|
|
47
47
|
if opts.is_a? Hash
|
48
48
|
opts.empty? ? @core.wait_true { yield } : @core.wait_true(**opts) { yield }
|
@@ -71,8 +71,7 @@ module Appium
|
|
71
71
|
# wait(20) { button_exact('Back') }.click
|
72
72
|
#
|
73
73
|
def wait(opts = {})
|
74
|
-
opts =
|
75
|
-
|
74
|
+
opts = { timeout: opts } if opts.is_a? Numeric
|
76
75
|
if opts.is_a? Hash
|
77
76
|
opts.empty? ? @core.wait { yield } : @core.wait(**opts) { yield }
|
78
77
|
else
|
data/lib/appium_lib/driver.rb
CHANGED
@@ -151,18 +151,10 @@ module Appium
|
|
151
151
|
# @param opts [Object] A hash containing various options.
|
152
152
|
# @param global_driver [Bool] A bool require global driver before initialize.
|
153
153
|
# @return [Driver]
|
154
|
-
def initialize(opts = {}, global_driver =
|
155
|
-
# TODO: set `global_driver = false` by default in the future.
|
154
|
+
def initialize(opts = {}, global_driver = false)
|
156
155
|
# Capybara can't put `global_driver` as the 2nd argument.
|
157
156
|
global_driver = opts.delete :global_driver if global_driver.nil?
|
158
157
|
|
159
|
-
if global_driver.nil?
|
160
|
-
warn '[DEPRECATION] Appium::Driver.new(opts) will not generate global driver by default.' \
|
161
|
-
'If you would like to generate the global driver dy default, ' \
|
162
|
-
'please initialise driver with Appium::Driver.new(opts, true)'
|
163
|
-
global_driver = true # if global_driver is nil, then global_driver must be default value.
|
164
|
-
end
|
165
|
-
|
166
158
|
$driver&.driver_quit if global_driver
|
167
159
|
|
168
160
|
raise 'opts must be a hash' unless opts.is_a? Hash
|
@@ -325,27 +317,7 @@ module Appium
|
|
325
317
|
!@core.automation_name.nil? && @core.automation_name == :xcuitest
|
326
318
|
end
|
327
319
|
|
328
|
-
#
|
329
|
-
#
|
330
|
-
# @return [:oss | :w3c]
|
331
|
-
#
|
332
|
-
# @example
|
333
|
-
#
|
334
|
-
# if dialect == :w3c
|
335
|
-
# driver.action
|
336
|
-
# .move_to_location(500, 500).pointer_down(:left)
|
337
|
-
# .move_to_location(0, 700)
|
338
|
-
# .release.perform
|
339
|
-
# else
|
340
|
-
# action = TouchAction.new(driver).press(x: 500, y: 500).move_to(500, 700).release
|
341
|
-
# action.perform
|
342
|
-
# end
|
343
|
-
#
|
344
|
-
def dialect
|
345
|
-
@driver.dialect
|
346
|
-
end
|
347
|
-
|
348
|
-
# An entry point to chain W3C actions. Returns `TouchAction.new` if it works as MJSONWP instead of W3C action.
|
320
|
+
# An entry point to chain W3C actions
|
349
321
|
# Read https://www.rubydoc.info/github/appium/ruby_lib_core/Appium/Core/Base/Bridge/W3C#action-instance_method
|
350
322
|
#
|
351
323
|
# @return [TouchAction|Selenium::WebDriver::PointerActions]
|
@@ -356,12 +328,7 @@ module Appium
|
|
356
328
|
# action.click(element).perform # The `click` is a part of `PointerActions`
|
357
329
|
#
|
358
330
|
def action
|
359
|
-
|
360
|
-
::Appium::Logger.info('Calls TouchAction instead of W3C actions for MJSONWP module')
|
361
|
-
TouchAction.new($driver || @driver)
|
362
|
-
else
|
363
|
-
@driver.action
|
364
|
-
end
|
331
|
+
@driver.action
|
365
332
|
end
|
366
333
|
|
367
334
|
# Returns the server's version info
|
@@ -24,7 +24,7 @@ module Appium
|
|
24
24
|
# ```
|
25
25
|
def swipe(direction:, element: nil)
|
26
26
|
args = { direction: direction }
|
27
|
-
args[:element] = element.
|
27
|
+
args[:element] = element.id if element
|
28
28
|
|
29
29
|
@driver.execute_script 'mobile: swipe', args
|
30
30
|
end
|
@@ -47,7 +47,7 @@ module Appium
|
|
47
47
|
return 'Set "up", "down", "left" or "right" for :direction' unless %w(up down left right).include?(direction)
|
48
48
|
|
49
49
|
args = { direction: direction }
|
50
|
-
args[:element] = element.
|
50
|
+
args[:element] = element.id if element
|
51
51
|
args[:distance] = distance if distance
|
52
52
|
args[:name] = name if name
|
53
53
|
args[:toVisible] = to_visible if to_visible
|
@@ -66,7 +66,7 @@ module Appium
|
|
66
66
|
# ```
|
67
67
|
def pinch(scale:, velocity: 1.0, element: nil)
|
68
68
|
args = { scale: scale, velocity: velocity }
|
69
|
-
args[:element] = element.
|
69
|
+
args[:element] = element.id if element
|
70
70
|
|
71
71
|
@driver.execute_script 'mobile: pinch', args
|
72
72
|
end
|
@@ -82,7 +82,7 @@ module Appium
|
|
82
82
|
def double_tap(x: nil, y: nil, element: nil)
|
83
83
|
return 'Set x, y or element' if (x.nil? || y.nil?) && element.nil?
|
84
84
|
|
85
|
-
args = element.nil? ? { x: x, y: y } : { element: element.
|
85
|
+
args = element.nil? ? { x: x, y: y } : { element: element.id }
|
86
86
|
@driver.execute_script 'mobile: doubleTap', args
|
87
87
|
end
|
88
88
|
|
@@ -99,7 +99,7 @@ module Appium
|
|
99
99
|
def touch_and_hold(x: nil, y: nil, element: nil, duration: 1.0)
|
100
100
|
return 'Set x, y or element' if (x.nil? || y.nil?) && element.nil?
|
101
101
|
|
102
|
-
args = element.nil? ? { x: x, y: y } : { element: element.
|
102
|
+
args = element.nil? ? { x: x, y: y } : { element: element.id }
|
103
103
|
args[:duration] = duration
|
104
104
|
@driver.execute_script 'mobile: touchAndHold', args
|
105
105
|
end
|
@@ -110,7 +110,7 @@ module Appium
|
|
110
110
|
# two_finger_tap element: find_element(:accessibility_id, "some item")
|
111
111
|
# ```
|
112
112
|
def two_finger_tap(element:)
|
113
|
-
args = { element: element.
|
113
|
+
args = { element: element.id }
|
114
114
|
@driver.execute_script 'mobile: twoFingerTap', args
|
115
115
|
end
|
116
116
|
|
@@ -126,7 +126,7 @@ module Appium
|
|
126
126
|
# ```
|
127
127
|
def one_finger_tap(x:, y:, element: nil)
|
128
128
|
args = { x: x, y: y }
|
129
|
-
args[:element] = element.
|
129
|
+
args[:element] = element.id if element
|
130
130
|
@driver.execute_script 'mobile: tap', args
|
131
131
|
end
|
132
132
|
|
@@ -146,7 +146,7 @@ module Appium
|
|
146
146
|
# ```
|
147
147
|
def drag_from_to_for_duration(from_x:, from_y:, to_x:, to_y:, duration: 1.0, element: nil)
|
148
148
|
args = { fromX: from_x, fromY: from_y, toX: to_x, toY: to_y, duration: duration }
|
149
|
-
args[:element] = element.
|
149
|
+
args[:element] = element.id if element
|
150
150
|
@driver.execute_script 'mobile: dragFromToForDuration', args
|
151
151
|
end
|
152
152
|
# rubocop:enable Metrics/ParameterLists
|
@@ -164,7 +164,7 @@ module Appium
|
|
164
164
|
def select_picker_wheel(element:, order:, offset: nil)
|
165
165
|
return 'Set "next" or "previous" for :order' unless %w(next previous).include?(order)
|
166
166
|
|
167
|
-
args = { element: element.
|
167
|
+
args = { element: element.id, order: order }
|
168
168
|
args[:offset] = offset if offset
|
169
169
|
@driver.execute_script 'mobile: selectPickerWheelValue', args
|
170
170
|
end
|
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 = '2021-
|
17
|
+
VERSION = '12.0.0.rc1' unless defined? ::Appium::VERSION
|
18
|
+
DATE = '2021-10-15' unless defined? ::Appium::DATE
|
19
19
|
end
|
data/readme.md
CHANGED
@@ -21,7 +21,7 @@ We can avoid the class driver with current `ruby_lib`, but if you'd like to impl
|
|
21
21
|
# Setup
|
22
22
|
## Requirement
|
23
23
|
- [Appium](https://github.com/appium/appium#requirements)
|
24
|
-
- Ruby: 2.
|
24
|
+
- Ruby: 2.5+
|
25
25
|
|
26
26
|
### Ruby Lib and Appium
|
27
27
|
- Ruby library version over `9.8.0` requires Appium over `1.8`
|
@@ -35,16 +35,9 @@ $ appium
|
|
35
35
|
```
|
36
36
|
|
37
37
|
## Install / Upgrade
|
38
|
-
- Update rubygems and bundler
|
39
|
-
```bash
|
40
|
-
$ gem update --system
|
41
|
-
$ gem update bundler
|
42
|
-
```
|
43
38
|
|
44
|
-
- Install the latest gem release
|
45
39
|
```bash
|
46
|
-
gem
|
47
|
-
gem install --no-rdoc --no-ri appium_lib
|
40
|
+
gem install appium_lib
|
48
41
|
```
|
49
42
|
|
50
43
|
## [Sauce Labs env vars](https://github.com/appium/ruby_lib/blob/master/lib/appium_lib/sauce_labs.rb)
|
metadata
CHANGED
@@ -1,30 +1,30 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: appium_lib
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 12.0.0.rc1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- code@bootstraponline.com
|
8
8
|
- Kazuaki Matsuo
|
9
|
-
autorequire:
|
9
|
+
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2021-
|
12
|
+
date: 2021-10-15 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: appium_lib_core
|
16
16
|
requirement: !ruby/object:Gem::Requirement
|
17
17
|
requirements:
|
18
|
-
- -
|
18
|
+
- - '='
|
19
19
|
- !ruby/object:Gem::Version
|
20
|
-
version:
|
20
|
+
version: 5.0.0.rc5
|
21
21
|
type: :runtime
|
22
22
|
prerelease: false
|
23
23
|
version_requirements: !ruby/object:Gem::Requirement
|
24
24
|
requirements:
|
25
|
-
- -
|
25
|
+
- - '='
|
26
26
|
- !ruby/object:Gem::Version
|
27
|
-
version:
|
27
|
+
version: 5.0.0.rc5
|
28
28
|
- !ruby/object:Gem::Dependency
|
29
29
|
name: nokogiri
|
30
30
|
requirement: !ruby/object:Gem::Requirement
|
@@ -49,16 +49,22 @@ dependencies:
|
|
49
49
|
name: tomlrb
|
50
50
|
requirement: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- - "
|
52
|
+
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '1.1'
|
55
|
+
- - "<"
|
56
|
+
- !ruby/object:Gem::Version
|
57
|
+
version: '3.0'
|
55
58
|
type: :runtime
|
56
59
|
prerelease: false
|
57
60
|
version_requirements: !ruby/object:Gem::Requirement
|
58
61
|
requirements:
|
59
|
-
- - "
|
62
|
+
- - ">="
|
60
63
|
- !ruby/object:Gem::Version
|
61
64
|
version: '1.1'
|
65
|
+
- - "<"
|
66
|
+
- !ruby/object:Gem::Version
|
67
|
+
version: '3.0'
|
62
68
|
- !ruby/object:Gem::Dependency
|
63
69
|
name: appium_thor
|
64
70
|
requirement: !ruby/object:Gem::Requirement
|
@@ -155,14 +161,14 @@ dependencies:
|
|
155
161
|
requirements:
|
156
162
|
- - '='
|
157
163
|
- !ruby/object:Gem::Version
|
158
|
-
version: 1.
|
164
|
+
version: 1.22.1
|
159
165
|
type: :development
|
160
166
|
prerelease: false
|
161
167
|
version_requirements: !ruby/object:Gem::Requirement
|
162
168
|
requirements:
|
163
169
|
- - '='
|
164
170
|
- !ruby/object:Gem::Version
|
165
|
-
version: 1.
|
171
|
+
version: 1.22.1
|
166
172
|
- !ruby/object:Gem::Dependency
|
167
173
|
name: spec
|
168
174
|
requirement: !ruby/object:Gem::Requirement
|
@@ -208,6 +214,7 @@ files:
|
|
208
214
|
- ".azure-pipelines.yml"
|
209
215
|
- ".github/ISSUE_TEMPLATE.md"
|
210
216
|
- ".github/PULL_REQUEST_TEMPLATE.md"
|
217
|
+
- ".github/dependabot.yml"
|
211
218
|
- ".github/workflows/rubocop.yml"
|
212
219
|
- ".gitignore"
|
213
220
|
- ".rubocop.yml"
|
@@ -290,7 +297,7 @@ homepage: https://github.com/appium/ruby_lib
|
|
290
297
|
licenses:
|
291
298
|
- Apache-2.0
|
292
299
|
metadata: {}
|
293
|
-
post_install_message:
|
300
|
+
post_install_message:
|
294
301
|
rdoc_options: []
|
295
302
|
require_paths:
|
296
303
|
- lib
|
@@ -298,15 +305,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
298
305
|
requirements:
|
299
306
|
- - ">="
|
300
307
|
- !ruby/object:Gem::Version
|
301
|
-
version: '2.
|
308
|
+
version: '2.6'
|
302
309
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
303
310
|
requirements:
|
304
|
-
- - "
|
311
|
+
- - ">"
|
305
312
|
- !ruby/object:Gem::Version
|
306
|
-
version:
|
313
|
+
version: 1.3.1
|
307
314
|
requirements: []
|
308
|
-
rubygems_version: 3.
|
309
|
-
signing_key:
|
315
|
+
rubygems_version: 3.2.15
|
316
|
+
signing_key:
|
310
317
|
specification_version: 4
|
311
318
|
summary: Ruby library for Appium
|
312
319
|
test_files: []
|