How to use the junit-report-builder.writeTo function in junit-report-builder

To help you get started, we’ve selected a few junit-report-builder examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github mucsi96 / nightwatch-cucumber / lib / cucumber-junit-report.js View on Github external
break
        // if at least one step failed
        case 'failure':
          // mark as failure and output failure messages
          testCase
            .failure(messages.join('\n\n'))
          break
        // if a scenario runs without any failed or skipped steps
        default:
          // successful tests are already handled
      }
    })
  })

  // persistent data
  builder.writeTo(options.output)
}
github oxygenhq / oxygen / lib / reporters / junit-reporter.js View on Github external
JUnitXmlReporter.prototype.generate = function() {
    var resultFilePath = this.createFolderStructureAndFilePath('.xml');
    var resultFolderPath = path.dirname(resultFilePath);

    this.replaceScreenshotsWithFiles(resultFolderPath);
    // the 'results' object can contain a single test suite result or an array of multiple parallel test results
    if (this.results instanceof Array) {
        // go through multiple results
        _.each(this.results, function(resultSet) {
            populateSuiteResults(resultSet, builder);
        });
    } else {
        populateSuiteResults(this.results, builder);
    }

    builder.writeTo(resultFilePath);

    return resultFilePath;
};
github okta / okta-signin-widget / test / e2e / util / junit-reporter.js View on Github external
.className(packageName + '.' + ruleResult.id)
        .name(violation.target)
        .failure(failure)
        .stacktrace(stacktrace);
    });
  });

  result.passes.forEach(function (ruleResult) {
    ruleResult.nodes.forEach(function (pass) {
      suite.testCase()
        .className(packageName + '.' + ruleResult.id)
        .name(pass.target);
    });
  });

  junitReportBuilder.writeTo(outFile);
};
github oxygenhq / oxygen / src / ox_reporters / reporter-junit.js View on Github external
generate(results) {        
        var resultFilePath = this.createFolderStructureAndFilePath('.xml');
        var resultFolderPath = path.dirname(resultFilePath);

        this.replaceScreenshotsWithFiles(results, resultFolderPath);
        
        for (let result of results) {
            for (let suite of result.suites) {
                this._populateSuiteResults(suite, builder);
            }
        }

        builder.writeTo(resultFilePath);

        return resultFilePath;
    }
github sitespeedio / sitespeed.io / lib / plugins / budget / junit.js View on Github external
result.metric +
              ' is ' +
              result.friendlyValue +
              ' and limit ' +
              result.limitType +
              ' ' +
              result.friendlyLimit +
              ' ' +
              url
          );
      }
    }
  }
  const file = path.join(dir, 'junit.xml');
  log.info('Write junit budget to %s', path.resolve(file));
  builder.writeTo(file);
};
github garris / BackstopJS / core / command / report.js View on Github external
return new Promise(function (resolve, reject) {
    var testReportFilename = config.testReportFileName || config.ciReport.testReportFileName;
    testReportFilename = testReportFilename.replace(/\.xml$/, '') + '.xml';
    var destination = path.join(config.ci_report, testReportFilename);

    try {
      builder.writeTo(destination);
      logger.success('jUnit report written to: ' + destination);

      resolve();
    } catch (e) {
      return reject(e);
    }
  });
}

junit-report-builder

Aimed at making it easier to build Jenkins compatible JUnit XML reports in plugins for testing frameworks

MIT
Latest version published 3 months ago

Package Health Score

74 / 100
Full package analysis