build-system/tasks/make-golden.js
/**
 * Write preambule html into the report file
 * @param {string} reportFile filepath to report file
 */
Write preambule html into the report file
@param {string} reportFile filepath to report file
Write preambule html into the report file @param { string } reportFile filepath to report file
function reportPreambule(reportFile) {
  fs.writeFileSync(reportFile,
      '<html>' +
      '<head><style>' +
          ' table {border-collapse: collapse}' +
          ' tr {border-bottom: 1px solid gray}' +
          ' td {padding: 8px 0}' +
          ' .thumb{display: block; width: 100px; height: 100px}' +
          ' .thumb img{display: block; width: auto; height: auto;' +
              'margin: auto; max-width: 100%; max-height: 100%}' +
          ' .result {text-align: center}' +
          ' .error {background: red} .success {background: green}' +
      '</style></head>' +
      '<body><h1>Screenshot Diffs</h1><table width=100%>' +
      '<thead><tr>' +
      '<th>Path</th>' +
      '<th>Result</th>' +
      '<th>Golden</th>' +
      '<th>Work</th>' +
      '<th>Diff</th>' +
      '</tr></thead>' +
      '<tbody>',
      'utf8');
}
function reportPreambule ( reportFile ) { fs . writeFileSync ( reportFile , '<html>' + '<head><style>' + ' table {border-collapse: collapse}' + ' tr {border-bottom: 1px solid gray}' + ' td {padding: 8px 0}' + ' .thumb{display: block; width: 100px; height: 100px}' + ' .thumb img{display: block; width: auto; height: auto;' + 'margin: auto; max-width: 100%; max-height: 100%}' + ' .result {text-align: center}' + ' .error {background: red} .success {background: green}' + '</style></head>' + '<body><h1>Screenshot Diffs</h1><table width=100%>' + '<thead><tr>' + '<th>Path</th>' + '<th>Result</th>' + '<th>Golden</th>' + '<th>Work</th>' + '<th>Diff</th>' + '</tr></thead>' + '<tbody>' , 'utf8' ) ; }
Write preambule html into the report file
 @param {string} reportFile filepath to report file
Write preambule html into the report file @param { string } reportFile filepath to report file