2015-01-05 110 views
0

此命令运行测试项目后php codecept.phar run api LoginCest.php --steps我得到以下输出:Codeception:只显示评论消息

* am trying to login......... 
* I have http header "Content-Type","application/x-www-form-urlencoded" 
* I send post "?",{"operation":"login","username":"[email protected]","accessKey":"xyz"} 
* I grab data from json response 
* see test status:Passed. 

但我只得到这样的输出:

* am trying to login......... 
* see test status:Passed. 

这里是我的代码:

$I->comment(" am trying to login........."); 
    $postData = array(
     'operation' => 'login', 
     'username' => $username, 
     'accessKey' => $password 
    ); 
    $url = "?"; 
    $I->haveHttpHeader('Content-Type', 'application/x-www-form-urlencoded'); 
    $I->sendPOST($url, $postData); 
    $outputData = $I->grabDataFromJsonResponse(); 

    if ($outputData['success'] == true) { 
     $I->comment("see test status:Passed."); 
    } else { 
     $I->comment("see test status:Failed."); 
    } 

只得到这种方法输出:

$I->comment(); 

回答

0

与选项调试模式下运行codeception -d

php codecept.phar run -d 
+0

感谢。但它不工作。它显示所有消息,但我只获得$ I-> comment();信息。 – sandipon