Skip to content

Commit 01dd97c

Browse files
committed
Make wait and wait_true use the interval before it reexecutes
1 parent d85e292 commit 01dd97c

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lib/appium_lib/common/helper.rb

+3-2
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ def wait max_wait=30, interval=0.5, &block
4040
rescue Errno::ECONNREFUSED => e
4141
raise e
4242
rescue Exception
43-
end)
4443
sleep interval
44+
end)
4545
end
4646
end
4747
result
@@ -73,8 +73,9 @@ def wait_true max_wait=30, interval=0.5, &block
7373
rescue Errno::ECONNREFUSED => e
7474
raise e
7575
rescue Exception
76+
ensure
77+
sleep interval unless result
7678
end)
77-
sleep interval
7879
end
7980
end
8081
result

0 commit comments

Comments
 (0)