Skip to content

Commit 2d2704a

Browse files
Store default wait in var
1 parent 8a2bc8a commit 2d2704a

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

lib/appium_lib/console.rb

+5-2
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,9 @@
6565
# combine secure & textfield on iOS to match Android behavior.
6666
$os == :ios ? require('ios/textfield') :
6767
require('android/textfield')
68+
69+
# implicit_wait default_wait
70+
$default_wait = 30
6871

6972
# WebDriver capabilities. Must be valid for Sauce to work.
7073
# https://github.com/jlipps/appium/blob/master/app/android.js
@@ -147,7 +150,7 @@ def start_driver
147150
$driver.execute_script 'mobile: setCommandTimeout', timeout: 9999
148151

149152
# Set implicit wait by default unless we're using Pry.
150-
$driver.manage.timeouts.implicit_wait = 30 unless defined?(Pry)
153+
$driver.manage.timeouts.implicit_wait = $default_wait unless defined?(Pry)
151154

152155
$driver
153156
end
@@ -160,7 +163,7 @@ def no_wait
160163
# Set implicit wait to timeout, defaults to 30.
161164
# @param timeout [Integer] the timeout in seconds
162165
# @return [void]
163-
def set_wait timeout=30
166+
def set_wait timeout=$default_wait
164167
$driver.manage.timeouts.implicit_wait = timeout
165168
end
166169

0 commit comments

Comments
 (0)