Created
July 28, 2016 06:46
-
-
Save ainoya/e3c61027d2f1f74e2a2387742304b195 to your computer and use it in GitHub Desktop.
start appium server in parallel
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'selenium-webdriver' | |
require 'logger' | |
class AppiumServer | |
def initialize(opts = {}) | |
@port = Selenium::WebDriver::PortProber.above(3000) | |
@log = ::Logger.new(STDOUT) | |
end | |
def start | |
@pid = fork do | |
exec "appium -p #{@port}" | |
end | |
@log.info("appium server is running! port: #{@port}") | |
end | |
def kill | |
Process.kill "TERM", @pid | |
end | |
end | |
a = AppiumServer.new | |
a.start | |
sleep 3 | |
a.kill |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment