       chromedriver.stderr.on "close", ->
         resolve(errorCode)
 
-  waits(5000)
+  waitsFor("webdriver to start", pollChromeDriver, 5000)
 
   waitsFor("webdriver to finish", (done) ->
     finish = once ->

ChromedriverPath = path.resolve(__dirname, '..', '..', '..', 'atom-shell', 'chromedriver', 'chromedriver')
SocketPath = path.join(temp.mkdirSync("socket-dir"), "atom-#{process.env.USER}.sock")
ChromedriverPort = 9515

buildAtomClient = (args, env) ->
  client = webdriverio.remote(

path = require "path"
http = require "http"
temp = require("temp").track()
remote = require "remote"
async = require "async"
