Mac に Selenium をインストール
追記
インストールすると、自動 or 手動の選択肢の説明がでる。
You can enable selenium-server to automatically load on login with: mkdir -p ~/Library/LaunchAgents cp "/usr/local/Cellar/selenium-server-standalone/2.25.0/homebrew.mxcl.selenium-server-standalone.plist" ~/Library/LaunchAgents/ launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.selenium-server-standalone.plist If this is an upgrade and you already have the homebrew.mxcl.selenium-server-standalone.plist loaded: launchctl unload -w ~/Library/LaunchAgents/homebrew.mxcl.selenium-server-standalone.plist cp /usr/local/Cellar/selenium-server-standalone/2.25.0/homebrew.mxcl.selenium-server-standalone.plist ~/Library/LaunchAgents/ launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.selenium-server-standalone.plist Or start it manually with: java -jar /usr/local/Cellar/selenium-server-standalone/2.25.0/selenium-server-standalone-2.25.0.jar -p 4444
PHP でインテグレーションテストをするのに Selenium を使用するので、インストールした。
brew install selenium-server-standalone
これで入る。Homebrewすごい。
しかし、必要な時に起動させるコマンドが長い。
java -jar /usr/local/Cellar/selenium-server-standalone/2.25.0/selenium-server-standalone-2.25.0.jar
なのでエイリアスを張った。
alias selenium="java -jar "$(brew --prefix selenium-server-standalone)"/selenium-server-standalone-2.25.0.jar"
最後に
裏で勝手にブラウザが動いていろいろするのすごい。 自動化の響きに感動した一日だった。