testa_appium_driver 0.1.22 → 0.1.25

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: b29b2698137e80b650a08f6fc0069137d6244b65c65b5a44718c3e69c9457c04
4
+ data.tar.gz: 763f9c945a09df4cc1276752a2f93eec2b6130c46fd8ecda8b7010d58ea5cbd8
5
5
  SHA512:
6
- metadata.gz: f3947b6ac11661d053db77491a1619af9f11509f47f9eeb09505d82387772e55183765da00c359f516f0a718d00c0fe70a51f5208a90f8dad281e9f03ac7d6e1
7
- data.tar.gz: 5f4960777da0242b0faa11ef8848864e1dfcc08ca08e74efb37f86b3948191ef8e47a0c57e31cfa2464894b62db8613e05b377a7aedb654dbd056a33a82de2be
6
+ metadata.gz: 6aa78313a9b30df1b95e283b094dc36eab8336e48e8b10c30f4557388bae55e4c586c3f120de9507fc452dde783639a25b1200b08cf1d404b37c23f9804d3fb4
7
+ data.tar.gz: 92e1e7c85f897af2efa09c70c4a3575575468f34b8a583d71688814fbab8d218752b98257e64c64b1187675d64ec985a19562c4edbbe2e4799c85874df9dc9cc
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.25)
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
@@ -200,7 +200,6 @@ module ::TestaAppiumDriver
200
200
  w3c_drag_to(x0, y0, x1, y1)
201
201
  end
202
202
 
203
-
204
203
  def is_aligned?(with, element)
205
204
  align_bounds = @locator.bounds(force_cache_element: element)
206
205
  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.25"
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.25
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