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