Method: Apophis::AppiumRunner#launch_and_wait

Defined in:
lib/apophis/appium_runner.rb

#launch_and_wait(port = nil, timeout = 20) ⇒ Object



40
41
42
43
44
45
46
47
48
# File 'lib/apophis/appium_runner.rb', line 40

def launch_and_wait(port=nil, timeout=20)
  port = port || find_available_port(4500)

  #we'll use the env variable later to locate this process (`ps -p <PID> -wwwE`)
  Process.spawn("APOPHIS_TAG=#{port} appium -p #{port} -bp #{port+1} > /dev/null 2>&1")
  DottyTimeout.timeout(timeout){ available?(port) }

  { port: port }
end