这根本不会发生任何报告。你能看出原因吗?谢谢!
onPrepare: function() {
var jasmineReporters = require('jasmine-reporters');
var capsPromise = browser.getCapabilities();
return capsPromise.then(function(caps){
var browserName = caps.caps_.browserName;
});
jasmine.getEnv().addReporter(new jasmineReporters.JUnitXmlReporter({
consolidateAll: false,
savePath: 'C:/QA/test_results/'
}));
},
// 测试完成后调用的回调函数。
onComplete: function() {
var path = require("path");
var browserName, browserVersion;
var reportPath = 'C:/QA/test_results/';
var capsPromise = browser.getCapabilities();
return capsPromise.then(function (caps) {
browserName = caps.caps_.browserName.toLowerCase();
browserName = browserName.replace(/ /g,"-");
browserVersion = caps.caps_.version;
return null;
});
var HTMLReport = require('jasmine-xml2html-converter');
reportPath += browserName;
//为html输出调用自定义报告
testConfig = {
reportTitle: 'Test Execution Report',
outputPath: reportPath,
seleniumServer: browser.seleniumAddress,
applicationUrl: browser.baseUrl,
testBrowser: browserName + ' ' + browserVersion
};
new HTMLReport().from(reportPath + '/junitresults.xml', testConfig);
}