Webception icon indicating copy to clipboard operation
Webception copied to clipboard

How to print log on Webception

Open huytd83 opened this issue 10 years ago • 1 comments

Webception only shows 1 type of log file. It's not good idea why on console we can print with many type like html/xml/debug ... :( pls show to me how we can set it.

huytd83 avatar Nov 18 '14 08:11 huytd83

there's a way around this, might not be optimal but I've done it in the past like this: open webception/App/Lib/Codeception.php look for getCommandPath around line 333 and add options as you need. I always use the same options as I don't have a need to get them from a config file (might be a good thing to do/consider as there's already a config option in there), but for the sake of doing this try:

public function getCommandPath($type, $filename)
{
    // Build all the different parameters as part of the console command
    $params = array(
        $this->config['executable'],        // Codeception Executable
        "run",                              // Command to Codeception
        "--no-colors",                      // Forcing Codeception to not use colors, if enabled in codeception.yml
        "--verbose",                        // 
        "--debug",                          // 
        "--steps",                          // 
        "--html",                           // 
        "--json",                           // 
        "--xml",                            //
        "-n",                               //
        "--config=\"{$this->site->getConfig()}\"", // Full path & file of Codeception
        $type,                              // Test Type (Acceptance, Unit, Functional)
        $filename,                          // Filename of the Codeception test
        "2>&1"                              // Added to force output of running executable to be streamed out
    );

    // Build the command to be run.
    return implode(' ', $params);
}

elchesco avatar Feb 24 '15 17:02 elchesco