php codecept.phar run
2.运行某一个suite里面的testcase
php codecept.phar run acceptance 或者 <span style="font-family: Arial, Helvetica, sans-serif;">php codecept.phar run functional</span>
3.运行某一个testclass
php codecept.phar run acceptance SigninCept.php 或者 php codecept.phar run tests/acceptance/SigninCept.php
4.运行某个class里面的某条case
php codecept.phar run tests/acceptance/SignInCest.php:anonymousLogin
5.运行某个文件夹下所有的testcase,“backend”是一个文件夹的名称
php codecept.phar run tests/acceptance/backend
php codecept.phar run acceptance SigninCept.php --steps
7. 如果某些testcase既不在一个文件夹下面也不属于同一个suite,可以用group的方式来运行
8.debug方式运行
php codecept.phar run acceptance WelcomelianqinwCept.php --debug
运行结果如下
Codeception PHP Testing Framework v2.0.7
Powered by PHPUnit 4.3.4 by Sebastian Bergmann.
Acceptance Tests (1) --------------------------------------------------------------------------------------------------------------------
Modules: PhpBrowser
-----------------------------------------------------------------------------------------------------------------------------------------
Trying to perform actions and see result (WelcomelianqinwCept)
Scenario:
* I am on page "/"
[Response] 200
[Page] http://forms.vagrant.foxitcloud.com/
[Cookies] []
[Headers] {"Date":["Thu, 04 Dec 2014 03:40:28 GMT"],"Server":["Apache/2.2.15 (CentOS)"],"X-Powered-By":["PHP/5.4.34"],"Set-Cookie":["PHPSESSID=c57ngnb08r26p4psb1mumc9e22; path=/; HttpOnly","_csrf=7835d9b9577e3a7e8c87df029c9f3ed8c6ecf0a9284da048abec51e8af243337s%3A32%3A%220_0eMUTwzW7TVaB5me9GngOxOop1bLw5%22%3B; path=/; httponly"],"Expires":["Thu, 19 Nov 1981 08:52:00 GMT"],"Cache-Control":["no-store, no-cache, must-revalidate, post-check=0, pre-check=0"],"Pragma":["no-cache"],"Connection":["close"],"Transfer-Encoding":["chunked"],"Content-Type":["text/html; charset=UTF-8"]}
* I click "Sign In"
[Response] 200
[Page] http://forms.vagrant.foxitcloud.com/site/signin
[Cookies] {"PHPSESSID":"c57ngnb08r26p4psb1mumc9e22","_csrf":"7835d9b9577e3a7e8c87df029c9f3ed8c6ecf0a9284da048abec51e8af243337s:32:"0_0eMUTwzW7TVaB5me9GngOxOop1bLw5";"}
[Headers] {"Date":["Thu, 04 Dec 2014 03:40:29 GMT"],"Server":["Apache/2.2.15 (CentOS)"],"X-Powered-By":["PHP/5.4.34"],"Expires":["Thu, 19 Nov 1981 08:52:00 GMT"],"Cache-Control":["no-store, no-cache, must-revalidate, post-check=0, pre-check=0"],"Pragma":["no-cache"],"Connection":["close"],"Transfer-Encoding":["chunked"],"Content-Type":["text/html; charset=UTF-8"]}
* I see "Home"
PASSED
-----------------------------------------------------------------------------------------------------------------------------------------
Time: 3.85 seconds, Memory: 12.50Mb
OK (1 test, 1 assertion)