- 切換到MAMP 2.0的/bin/php/php5.3.6/bin檔案夾,用pear下載 phpunit/PHPUnit_Selenium :
cd /Applications/MAMP/bin/php/php5.3.6/bin sudo ./pear install phpunit/PHPUnit_Selenium Password:
- 輸入管理員密碼後,會自動安裝好 phpunit/PHPUnit_Selenium 套件:
downloading PHPUnit_Selenium-1.1.3.tgz ... Starting to download PHPUnit_Selenium-1.1.3.tgz (17,425 bytes) ......done: 17,425 bytes install ok: channel://pear.phpunit.de/PHPUnit_Selenium-1.1.3
- 從http://seleniumhq.org/download/網站下載Selenium RC Server。目前是2.15.0版。解壓縮後,會得到 selenium-server-standalone-2.15.0.jar ,將檔案移到任何目錄都可以,例如 ~/Applications
- 打開終端機(不要用Aptana的Terminal),切換到 ~/Applications ,然後用Java執行:
cd ~/Applications java -jar selenium-server-standalone-2.15.0.jar
- Selenium RC Server執行後,終端機會出現以下提示。
2011/12/25 ?W?? 09:17:17 org.openqa.grid.selenium.GridLauncher main ??T: Launching a standalone server 09:17:22.613 INFO - Java: Apple Inc. 20.4-b02-402 09:17:22.615 INFO - OS: Mac OS X 10.7.2 x86_64 09:17:22.626 INFO - v2.15.0, with Core v2.15.0. Built from revision 15105 09:17:22.827 INFO - RemoteWebDriver instances should connect to: http://127.0.0.1:4444/wd/hub 09:17:22.828 INFO - Version Jetty/5.1.x 09:17:22.828 INFO - Started HttpContext[/selenium-server/driver,/selenium-server/driver] 09:17:22.829 INFO - Started HttpContext[/selenium-server,/selenium-server] 09:17:22.829 INFO - Started HttpContext[/,/] 09:17:22.874 INFO - Started org.openqa.jetty.jetty.servlet.ServletHandler@13f6ba0f 09:17:22.875 INFO - Started HttpContext[/wd,/wd] 09:17:22.884 INFO - Started SocketListener on 0.0.0.0:4444 09:17:22.884 INFO - Started org.openqa.jetty.jetty.Server@4ee1d5ea
- 關閉終端機視窗就可以結束Selenium RC Server
2011年12月25日 星期日
PHPUnit 與 Selenium 整合
PHPUnit 與 selenium 整合,必須先用 pear 下載 phpunit/PHPUnit_Selenium 套件,否則無法連動。
2011年12月24日 星期六
2011年8月27日 星期六
Yii-1
- 前往MAMP網頁根目錄:
cd /Applications/MAMP/htdocs - 執行yiic腳本,產生 demo 網頁應用程式(不要用 sudo):
./yii//framework/yiic webapp demo
Password:
Create a Web application under '/Applications/MAMP/htdocs/demo'? [Yes|No] y - 測試 demo :
http://localhost/demo/index.php - 執行 yiic shell , 要指定 config 檔案路徑:
./protected/yiic shell ./protected/config/main.php - 產生 message 控制器與 helloWorld 函數:
>> controller message helloWorld - 測試 message 控制器與 helloWorld 函數:
http://localhost/demo/index.php?r=message
http://localhost/demo/index.php?r=message/helloWorld
訂閱:
文章 (Atom)