Codeception简单来说, 分为以下几种测试
- Acceptance Tests 验收测试
- Functional Tests 功能测试
- Unit Tests 单元测试
Acceptance 测试过程记录
- quick start, 参考
- 安装webDriver (phantomjs) , 参考
1wget https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-2.1.1-linux-x86_64.tar.bz2<br>tar -jxvf phantomjs-2.1.1-linux-x86_64.tar.bz2 <br><br># 运行<br>./phantomjs-2.1.1-linux-x86_64/bin/phantomjs --webdriver=4444<br> - 编写测试用例
1php codecept.phar generate:cest acceptance First<br> vim tests/acceptance.suite.yml <br> # 配置webDriver<br> - WebDriver:<br> #url: http://localhost/myapp<br> url: http://192.168.0.178:9504/<br> browser: phantomjs<br> <br> # 测试<br> vim tests/acceptance/FirstCest.php<br> public function frontpageWorks(AcceptanceTester $I)<br> {<br> $I->OnPage('/');<br> $I->seeElement('.container');<br> $I->see('backend');<br> $I->see('Watch log');<br> $I->see('welcome');<br> }<br>