lib/log_reporter.js
/**
 * LogReporter is used to generate the HTML format report
 * with screenshots info.
 *
 * The JSON format of the "data" param is:
 * {
 *   screenshots: [
 *     { description: 'the first one', image: 'data:image/png;base64,' },
 *     { description: 'the second one', image: 'data:image/png;base64,' }
 *   ]
 * }
 *
 * @class LogReporter
 * @param {String} template the path of template file.
 */
LogReporter is used to generate the HTML format report
with screenshots info.



@class LogReporter
@param {String} template the path of template file.
LogReporter is used to generate the HTML format report with screenshots info . @class LogReporter @param { String } template the path of template file .
function LogReporter(template) {
  if (!template) {
    throw { message: 'No param template.' };
  }
  this._template = '';
  this._eventEmitter = new EventEmitter();
  fs.readFile(template,
              'utf8',
              function(error, data) {
                this._eventEmitter.emit('templateLoaded', data);
                this._template = data;
              }.bind(this));
}
function LogReporter ( template ) { if ( ! template ) { throw { message : 'No param template.' } ; } this . _template = '' ; this . _eventEmitter = new EventEmitter ( ) ; fs . readFile ( template , 'utf8' , function ( error , data ) { this . _eventEmitter . emit ( 'templateLoaded' , data ) ; this . _template = data ; } . bind ( this ) ) ; }
LogReporter is used to generate the HTML format report
 with screenshots info.
LogReporter is used to generate the HTML format report with screenshots info .