代码感知:仅显示评论消息


Codeception: only show comment message

通过以下命令运行测试项目后php codecept.phar run api LoginCest.php --steps我得到以下输出:

* am trying  to login.........
* I have http header "Content-Type","application/x-www-form-urlencoded"
* I send post "?",{"operation":"login","username":"xyz@abc.com","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();

使用选项 -d 在调试模式下运行 codeception

php codecept.phar run -d