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