codeception 运行testcase 的方式

1. 运行所有suites里面的所有的有效的testcase
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


6. 输出testcase运行的step,在语句后面加 --steps

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)



评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值