我们正在使用Protractor-html-reporter创建 HTML 报告。如果我们使用多种功能,则会为每个浏览器生成报告。我想知道如果我们使用多种功能,有什么方法可以创建单个 HTML 报告?
HTML 报告是使用 xml 文件生成的(使用 jasmineRreporters)。请在配置文件中找到以下代码。
//This is to generate xml file
jasmine.getEnv().addReporter(new jasmineReporters.JUnitXmlReporter({
consolidateAll: true,
savePath: xmlOutputPath,
modifiedSuiteName: true,
filePrefix: 'xmloutput'
}));
//to generate html reporting
onComplete: function () {
var browserName, browserVersion;
var capsPromise = browser.getCapabilities();
capsPromise.then(function (caps) {
browserName = caps.get('browserName');
browserVersion = caps.get('version');
testConfig = {
reportTitle: 'Test Report',
outputPath: HtmlreportPath,
screenshotPath: ScreenshotPath,
testBrowser: browserName,
browserVersion: browserVersion,
screenshotsOnlyOnFailure: true
};
new HTMLReport().from(xmlOutputPath + '/xmloutput.xml', testConfig);
});
},