Skip to content

Commit 3b24fcd

Browse files
Add optional $driver.global_webdriver_http_sleep
Example: $driver.global_webdriver_http_sleep = 10 That will sleep for 10 seconds before every webdriver http call. This is useful for presenting automation scripts.
1 parent dae3508 commit 3b24fcd

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

lib/appium_lib/common/patch.rb

+2
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,8 @@ def raw_execute(command, opts = {}, command_hash = nil)
143143
ap print_command
144144
end
145145
end
146+
delay = $driver.global_webdriver_http_sleep
147+
sleep delay if !delay.nil? && delay > 0
146148
# puts "verb: #{verb}, path #{path}, command_hash #{command_hash.to_json}"
147149
http.call verb, path, command_hash
148150
end # def

lib/appium_lib/driver.rb

+3
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,9 @@ class Driver
176176
attr_reader :default_wait, :app_path, :app_name, :device,
177177
:app_package, :app_activity, :app_wait_activity,
178178
:sauce_username, :sauce_access_key, :port, :debug
179+
180+
# The amount to sleep in seconds before every webdriver http call.
181+
attr_accessor :global_webdriver_http_sleep
179182
# Creates a new driver.
180183
# :device is :android, :ios, or :selendroid
181184
#

0 commit comments

Comments
 (0)