homebrew-core/Formula/chromedriver.rb
Alexander Bayandin 95605d510e chromedriver 2.25
Closes #6271.

Signed-off-by: Tomasz Pajor <tomek@polishgeeks.com>
2016-10-26 10:10:44 +02:00

50 lines
1.4 KiB
Ruby

class Chromedriver < Formula
desc "Tool for automated testing of webapps across many browsers"
homepage "https://sites.google.com/a/chromium.org/chromedriver/"
url "https://chromedriver.storage.googleapis.com/2.25/chromedriver_mac64.zip"
version "2.25"
sha256 "e95fb36ab85264e16c51d58dd9766624eca6b6339569da0460088f4c788c67ad"
bottle :unneeded
def install
bin.install "chromedriver"
end
plist_options :manual => "chromedriver"
def plist; <<-EOS.undent
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>homebrew.mxcl.chromedriver</string>
<key>RunAtLoad</key>
<true/>
<key>KeepAlive</key>
<false/>
<key>ProgramArguments</key>
<array>
<string>#{opt_bin}/chromedriver</string>
</array>
<key>ServiceDescription</key>
<string>Chrome Driver</string>
<key>StandardErrorPath</key>
<string>#{var}/log/chromedriver-error.log</string>
<key>StandardOutPath</key>
<string>#{var}/log/chromedriver-output.log</string>
</dict>
</plist>
EOS
end
test do
driver = fork do
exec bin/"chromedriver", "--port=9999", "--log-path=#{testpath}/cd.log"
end
sleep 5
Process.kill("TERM", driver)
File.exist? testpath/"cd.log"
end
end