UbuntuにProtractorをインストールする
インストール
必要なツールをグローバルにインストールします。
$ sudo npm install -g protractor
パーミッションを修正します。
$ sudo chown -R `whoami` ~/.npm/
Selenium Serverをインストールします。
$ sudo webdriver-manager update
テストの作成
/usr/lib/node_modules/protractor/exampleフォルダにEnd-to-Endテストのサンプルがありますので、プロジェクトのtest/protractorフォルダにコピーします。
テストの実行
Selenium Serverの起動
Selenium Serverを起動します。
$ webdriver-manager start
http://localhost:4444/wd/hub/static/resource/hub.htmlにブラウザでアクセスするとSelenium Serverの現状がわかります。
テストの実行
protractorコマンドでテストを起動します。
$ protractor test/protractor/conf.js
Using ChromeDriver directly...
[launcher] Running 1 instances of WebDriver
...
Finished in 14.943 seconds
3 tests, 5 assertions, 0 failures
[launcher] 0 instance(s) of WebDriver still running
[launcher] chrome #1 passed
Date: 2015/01/17



![徹底攻略PHP5技術者認定[上級]試験問題集 [PJ0-200]対応 徹底攻略PHP5技術者認定[上級]試験問題集 [PJ0-200]対応](http://tatsu-zine.com/images/books/164/cover_s.jpg)

