File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -20,12 +20,14 @@ module Appium::Common
2020
2121 # Check every 0.5 seconds to see if block.call is true.
2222 # Give up after 30 seconds.
23+ # @param max_wait [Integer] the maximum time in seconds to wait for
24+ # @param interval [Float] the time in seconds to wait after calling the block
2325 # @param block [Block] the block to call
2426 # @return [Object] the result of block.call
25- def wait &block
27+ def wait max_wait = 30 , interval = 0.5 , &block
2628 # Rescue Timeout::Error: execution expired
2729 result = nil
28- timeout ( 30 ) { until ( result = begin ; block . call ; rescue ; end ) do ; sleep 0.5 end }
30+ timeout ( max_wait ) { until ( result = begin ; block . call ; rescue ; end ) do ; sleep interval end }
2931 result
3032 end
3133
@@ -158,4 +160,4 @@ def find_name name
158160 def find_names name
159161 find_elements :name , name
160162 end
161- end # module Appium::Common
163+ end # module Appium::Common
You can’t perform that action at this time.
0 commit comments