testa_appium_driver 0.1.22 → 0.1.24

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: 2d4072a112f915874326c2dd4688ecd7680dd419e4d659cc262f4eb2150850e2
4
- data.tar.gz: b0a5d24eebc08ed72c2df8959a96163510736d4d4bd0c7eecd9399a218086a29
3
+ metadata.gz: b34762a1e6c7413f1aeffa1df4125bc06c17d5299560b4e3ce018672b3891ac9
4
+ data.tar.gz: 132bb3665d961f7e6848384d5578bd1f5cafccf0ecd6a02ce01c971a182d4102
5
5
  SHA512:
6
- metadata.gz: f3947b6ac11661d053db77491a1619af9f11509f47f9eeb09505d82387772e55183765da00c359f516f0a718d00c0fe70a51f5208a90f8dad281e9f03ac7d6e1
7
- data.tar.gz: 5f4960777da0242b0faa11ef8848864e1dfcc08ca08e74efb37f86b3948191ef8e47a0c57e31cfa2464894b62db8613e05b377a7aedb654dbd056a33a82de2be
6
+ metadata.gz: 27d9d7344062f9eb6ba08523130ea8b76a96d4250832b3cb37db91f49601c9d43249911590b5f67700715b91f805c016328dfa69accd2a297f4c76510dc68857
7
+ data.tar.gz: f9361dd73b87f8d807dc4a58fba6b86782fa161ccb98d927073720616875219a0bb01e6d7642e8f2787defb8b4c7c404e09eca0b7df2b6998fb86b864a82c6fe
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- testa_appium_driver (0.1.21)
4
+ testa_appium_driver (0.1.24)
5
5
  appium_lib_core
6
6
  json (~> 2.3)
7
7
 
@@ -26,6 +26,7 @@ module ::TestaAppiumDriver
26
26
  end
27
27
 
28
28
  if @driver.ios?
29
+ # if true
29
30
  w3c_scroll_each_ios(direction, align_with, &block)
30
31
  else
31
32
  w3c_scroll_each_android(direction, align_with, &block)
@@ -182,10 +183,18 @@ module ::TestaAppiumDriver
182
183
  max_attempts = 3 if max_attempts.nil? || max_attempts <= 0
183
184
  # $ctx.puts("Is aligned: #{is_aligned?(with, element)}")
184
185
  timeout = 0
185
- until is_aligned?(with, element) || timeout == max_attempts
186
- # $ctx.puts("align roudn: #{timeout}")
187
- w3c_attempt_align(with, speed_coef)
188
- timeout += 1
186
+ stale_retries = 0
187
+ begin
188
+ until is_aligned?(with, element) || timeout == max_attempts
189
+ # $ctx.puts("align roudn: #{timeout}")
190
+ w3c_attempt_align(with, speed_coef)
191
+ timeout += 1
192
+ end
193
+ rescue Selenium::WebDriver::Error::StaleElementReferenceError
194
+ # if boundElementsByIndex is enabled, we can get stale element reference while doing scroll each
195
+ stale_retries += 1
196
+ element = @locator.execute if @locator.instance_of?(TestaAppiumDriver::Locator)
197
+ retry if stale_retries < 2
189
198
  end
190
199
  # $ctx.puts("end align")
191
200
  end
@@ -196,11 +196,15 @@ module ::TestaAppiumDriver
196
196
  end
197
197
  end
198
198
 
199
- def drag_to(x0, y0, x1, y1)
200
- w3c_drag_to(x0, y0, x1, y1)
199
+ def drag_to(x, y)
200
+ b = @locator.bounds
201
+ coords = b.center
202
+ w3c_drag_to(coords.x, coords.y, x, y)
201
203
  end
202
204
 
203
205
 
206
+
207
+
204
208
  def is_aligned?(with, element)
205
209
  align_bounds = @locator.bounds(force_cache_element: element)
206
210
  case with
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |spec|
4
4
  spec.name = "testa_appium_driver"
5
- spec.version = "0.1.22"
5
+ spec.version = "0.1.24"
6
6
  spec.authors = ["karlo.razumovic"]
7
7
  spec.email = ["karlo.razumovic@gmail.com"]
8
8
 
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.22
4
+ version: 0.1.24
5
5
  platform: ruby
6
6
  authors:
7
7
  - karlo.razumovic
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-02-17 00:00:00.000000000 Z
11
+ date: 2023-03-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: appium_lib_core