protected function logJSErrors(ScenarioDriven $test, array $browserLogEntries)
    {
        foreach ($browserLogEntries as $logEntry) {
            if (true === isset($logEntry['level'])
                && true === isset($logEntry['message'])
                && $this->isJSError($logEntry['level'], $logEntry['message'])
            ) {
                // Timestamp is in milliseconds, but date() requires seconds.
                $time = date('H:i:s', $logEntry['timestamp'] / 1000) .
                    // Append the milliseconds to the end of the time string
                    '.' . ($logEntry['timestamp'] % 1000);
                $test->getScenario()->comment("{$time} {$logEntry['level']} - {$logEntry['message']}");
            }
        }
    }
protected function logJSErrors(ScenarioDriven $test, array $browserLogEntries)
    {
        foreach ($browserLogEntries as $logEntry) {
            if (true === isset($logEntry['level'])
                && true === isset($logEntry['message'])
                && $this->isJSError($logEntry['level'], $logEntry['message'])
            ) {
                // Timestamp is in milliseconds, but date() requires seconds.
                $time = date('H:i:s', $logEntry['timestamp'] / 1000) .
                    // Append the milliseconds to the end of the time string
                    '.' . ($logEntry['timestamp'] % 1000);
                $test->getScenario()->comment("{$time} {$logEntry['level']} - {$logEntry['message']}");
            }
        }
    }
protected function logJSErrors ( ScenarioDriven $ test , array $ browserLogEntries ) { foreach ( $ browserLogEntries as $ logEntry ) { if ( true === isset ( $ logEntry [ 'level' ] ) && true === isset ( $ logEntry [ 'message' ] ) && $ this -> isJSError ( $ logEntry [ 'level' ] , $ logEntry [ 'message' ] ) ) { // Timestamp is in milliseconds, but date() requires seconds. $ time = date ( 'H:i:s' , $ logEntry [ 'timestamp' ] / 1000 ) . // Append the milliseconds to the end of the time string '.' . ( $ logEntry [ 'timestamp' ] % 1000 ) ; $ test -> getScenario ( ) -> comment ( "{$time} {$logEntry['level']} - {$logEntry['message']}" ) ; } } }
Logs JavaScript errors as comments.

@param ScenarioDriven $test
@param array $browserLogEntries
Logs JavaScript errors as comments .