testa_appium_driver 0.1.30 → 0.1.32

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3521033bcda4e9b61fd523c8aa716c6bcfd99dc9e2ff820bf823adea8f4582c0
4
- data.tar.gz: 2443236705abef799f76de8a03db745b972f3ff9092b9b19a689a20aba329c21
3
+ metadata.gz: add83f6c9df4e695d9c8869c37d15611e0b87a065c6f844828264784e6d333a5
4
+ data.tar.gz: fa96bc1504a4863534aa9557041ce611594e6267c75f8b6a2d300a42605652d3
5
5
  SHA512:
6
- metadata.gz: 6648e41a86d22e367bfef3b77d9db4ae5381b2bd5d787a875d2f77d8c842c7bcc4b65a450d608bbe7a0b006af47ab0fe21ccb120cb26b9c8e1f2f441c7f22d02
7
- data.tar.gz: edd62bab2c971aa7334bf2521a9a5c91447a8892e94a1834a74c7e09fb69368c5c3b91b9d2bea20c14c9f5b36a751dc85932896b4c4b917db0cb44a4f34f570c
6
+ metadata.gz: b2fac94a46daef9a2782cc854f959434cc811ea3d853021c626c2b3eb12f9b80b8ce98e666472e916f0f2968524828c6635b9f52f5b0473a9a2f5ab92b230aef
7
+ data.tar.gz: 23f90e32e4c4bb11893a5140202b11a6c7d81681833cd3525539ae470144bce5f92611e57b6c0ac75c90cf6f357183e7c38791d123991d21728d2bdc86a0b4b3
data/Gemfile CHANGED
@@ -9,5 +9,5 @@ gem "rake", "~> 13.0"
9
9
 
10
10
  gem "rspec", "~> 3.0"
11
11
 
12
- gem "rubocop", "~> 1.26.0", require: false
12
+ gem "rubocop", require: false
13
13
  gem "rubocop-performance", require: false
@@ -187,7 +187,8 @@ module ::TestaAppiumDriver
187
187
  begin
188
188
  r = execute(skip_cache: true, ignore_implicit_wait: true)
189
189
  return r.count.positive? if r.is_a?(Array)
190
- return r.displayed? if @driver.ios?
190
+ # ios17 has phantom child elements that overlap parent so this returns false positive
191
+ # return r.displayed? if @driver.ios?
191
192
  rescue StandardError
192
193
  found = false
193
194
  end
@@ -332,56 +333,51 @@ module ::TestaAppiumDriver
332
333
  # if both x or y, or both are not given, will click in the center of the element
333
334
  # @param x If positive integer, will offset the click from the left side, if negative integer, will offset the click from the right. If float value is given, it will threat it as percentage offset, giving it 0.5 will click in the middle
334
335
  # @param y If positive integer, will offset the click from the bottom side, if negative integer, will offset the click from the top. If float value is given, it will threat it as percentage offset, giving it 0.5 will click in the middle
335
- def click(x = nil, y = nil, double: false, by_coords: false)
336
- if !x.nil? && !y.nil? || double || by_coords
337
-
338
- x = 0.5 if x.nil?
339
- y = 0.5 if y.nil?
340
-
341
- b = self.bounds
342
- if x.is_a?(Integer)
343
- if x >= 0
344
- x = b.top_left.x + x
345
- else
346
- x = b.bottom_right.x + x
347
- end
348
- elsif x.is_a?(Float) && x <= 1.0 && x >= 0
349
- x = b.top_left.x + b.width * x
336
+ def click(x = nil, y = nil, double: false)
337
+ x = 0.5 if x.nil?
338
+ y = 0.5 if y.nil?
339
+
340
+ b = self.bounds
341
+ if x.is_a?(Integer)
342
+ if x >= 0
343
+ x = b.top_left.x + x
350
344
  else
351
- raise "x value #{x} not supported. Use integer as pixel or float (0..1) as percentage of element width"
345
+ x = b.bottom_right.x + x
352
346
  end
347
+ elsif x.is_a?(Float) && x <= 1.0 && x >= 0
348
+ x = b.top_left.x + b.width * x
349
+ else
350
+ raise "x value #{x} not supported. Use integer as pixel or float (0..1) as percentage of element width"
351
+ end
353
352
 
354
- if y.is_a?(Integer)
355
- if y >= 0
356
- y = b.top_left.y + y
357
- else
358
- y = b.bottom_right + y
359
- end
360
- elsif y.is_a?(Float) && y <= 1.0 && y >= 0
361
- y = b.top_left.y + b.height * y
353
+ if y.is_a?(Integer)
354
+ if y >= 0
355
+ y = b.top_left.y + y
362
356
  else
363
- raise "y value #{x} not supported. Use integer as pixel or float (0..1) as percentage of element height"
357
+ y = b.bottom_right + y
364
358
  end
359
+ elsif y.is_a?(Float) && y <= 1.0 && y >= 0
360
+ y = b.top_left.y + b.height * y
361
+ else
362
+ raise "y value #{x} not supported. Use integer as pixel or float (0..1) as percentage of element height"
363
+ end
365
364
 
366
- action_builder = @driver.action
367
- f1 = action_builder.add_pointer_input(:touch, "finger1")
368
- f1.create_pointer_move(duration: 0.1, x: x, y: y, origin: ::Selenium::WebDriver::Interactions::PointerMove::VIEWPORT)
365
+ action_builder = @driver.action
366
+ f1 = action_builder.add_pointer_input(:touch, "finger1")
367
+ f1.create_pointer_move(duration: 0.1, x: x, y: y, origin: ::Selenium::WebDriver::Interactions::PointerMove::VIEWPORT)
368
+ f1.create_pointer_down(:left)
369
+ f1.create_pointer_up(:left)
370
+ if double
371
+ if @driver.ios?
372
+ # NOTE: ios is stupid, we have to do another move
373
+ # NOTE: ios is stupid, works very wierd if duration is 0
374
+ f1.create_pointer_move(duration: 0.1, x: x, y: y, origin: ::Selenium::WebDriver::Interactions::PointerMove::VIEWPORT)
375
+ end
376
+ f1.create_pause(0.1)
369
377
  f1.create_pointer_down(:left)
370
378
  f1.create_pointer_up(:left)
371
- if double
372
- if @driver.ios?
373
- # NOTE: ios is stupid, we have to do another move
374
- # NOTE: ios is stupid, works very wierd if duration is 0
375
- f1.create_pointer_move(duration: 0.1, x: x, y: y, origin: ::Selenium::WebDriver::Interactions::PointerMove::VIEWPORT)
376
- end
377
- f1.create_pause(0.1)
378
- f1.create_pointer_down(:left)
379
- f1.create_pointer_up(:left)
380
- end
381
- @driver.perform_actions [f1]
382
- else
383
- perform_driver_method(:click)
384
379
  end
380
+ @driver.perform_actions [f1]
385
381
  end
386
382
 
387
383
  alias_method :tap, :click
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: testa_appium_driver
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.30
4
+ version: 0.1.32
5
5
  platform: ruby
6
6
  authors:
7
7
  - karlo.razumovic
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-05-06 00:00:00.000000000 Z
11
+ date: 2024-11-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: appium_lib_core