【发布时间】:2015-03-04 15:27:50
【问题描述】:
我正在尝试使用 jasmine-reporter 插件为 jenkins 生成报告。
我的量角器配置是:
exports.config = {
allScriptsTimeout: 99999,
seleniumAddress: 'http://localhost:4444/wd/hub',
capabilities: {
'browserName': 'chrome'
},
baseUrl: 'http://localhost:9000/',
framework: 'jasmine2',
specs: ['../test/e2e/**/*.js'],
onPrepare: function() {
var jasmineReporters = require('jasmine-reporters');
jasmine.getEnv().addReporter(new jasmineReporters.JUnitXmlReporter({
consolidateAll: true,
filePrefix: 'test_results_e2e'
}));
},
jasmineNodeOpts: {
showColors: true,
defaultTimeoutInterval: 60000,
print: function() {}
}
};
生成了带有测试报告的文件,但测试失败并出现以下错误:
Failed: Angular could not be found on the page http://localhost:9000/# : retries looking for angular exceeded
我正在使用咕噜声。所以我定义了两项任务,一项用于测试,另一项用于开发。这两个任务使用不同的配置文件,唯一的区别是执行“grunt test”应该得到文件报告,而“grunt dev”执行测试并监视更改。因此,如果我使用“dev”任务运行应用程序,那么我不会收到任何错误。但是任务“test”仍然会产生错误的文件。
【问题讨论】:
标签: angularjs selenium gruntjs jasmine protractor