wait for the page to actually become available before claiming that we are ready

This commit is contained in:
Kohsuke Kawaguchi 2012-05-08 17:20:46 -07:00
parent 6073815bff
commit 7fa78d6101
1 changed files with 15 additions and 0 deletions

View File

@ -36,6 +36,21 @@ class LocalJenkinsController < JenkinsController
@log_watcher = LogWatcher.new(@pipe,@log)
@log_watcher.wait_for_ready
# at least in my environment, initial few tries always fail.
# so we need to be patient about loading the first page
Capybara.app_host = url
s = Capybara.current_session
for i in 1..10 do
begin
s.visit "/"
s.find "#search-box"
break # found it
rescue => e
puts e
sleep 0.5
end
end
end
def stop