File tree Expand file tree Collapse file tree 1 file changed +18
-2
lines changed
Expand file tree Collapse file tree 1 file changed +18
-2
lines changed Original file line number Diff line number Diff line change @@ -30,7 +30,15 @@ module Appium::Common
3030 # @param interval [Float] the time in seconds to wait after calling the block
3131 # @param block [Block] the block to call
3232 # @return [Object] the result of block.call
33- def wait max_wait = 30 , interval = 0.5 , &block
33+ def wait max_wait = -1 , interval = 0.5 , &block
34+ if max_wait == -1
35+ max_wait = begin
36+ $driver. default_wait
37+ rescue
38+ end
39+ max_wait ||= 30
40+ end
41+
3442 # Rescue Timeout::Error: execution expired
3543 result = nil
3644 timeout max_wait do
@@ -52,7 +60,15 @@ def ignore &block
5260 # @param interval [Float] the time in seconds to wait after calling the block
5361 # @param block [Block] the block to call
5462 # @return [Object] the result of block.call
55- def wait_true max_wait = 30 , interval = 0.5 , &block
63+ def wait_true max_wait = -1 , interval = 0.5 , &block
64+ if max_wait == -1
65+ max_wait = begin
66+ $driver. default_wait
67+ rescue
68+ end
69+ max_wait ||= 30
70+ end
71+
5672 # Rescue Timeout::Error: execution expired
5773 result = nil
5874 timeout max_wait do
You can’t perform that action at this time.
0 commit comments