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