我在Windows VM上设置了Jenkins Slave。当我的测试中出现故障时,构建状态总是显示成功。
以下是我如何在jenkins上运行量角器测试
Windows PowerShell命令:
cd conf 量角器ConfProd.js
我的Conf文件:
var HtmlReporter = require('protractor-html-screenshot-reporter');
exports.config = {
seleniumAddress: 'http://localhost:4444/wd/hub', //desktop
allScriptsTimeout: 60000,
baseUrl: 'https://myTest.com',
params: {
empUrl: 'https://employeeurl.com/',
},
// frameworks to use
frameworks: 'jasmine2',
directConnect: 'true',
//Capabilities to be passed to the webdriver instance.
multiCapabilities: [{
'browserName': 'chrome',
'chromeOptions' : {
args: ['--window-size=1200,1200']
},
specs: [
'../tests/*.spec.js'
],
},
{
'browserName': 'firefox',
'firefoxOptions' : {
args: ['--window-size=900,900']
},
specs: [
'../tests/*.spec.js'
],
exclude: ['../tests/EmployeeTests.spec.js'],
}],
onPrepare: function () {
jasmine.getEnv().addReporter(new HtmlReporter({
baseDirectory: '/tmp/screenshots',
docTitle: 'TestReports',
takeScreenShotsOnlyForFailedSpecs: true
}));
},
jasmineNodeOpts: {
showColors: true,
isVerbose: true,
includeStackTrace: true,
}
};
这是来自Jenkins控制台输出的消息:
[launcher] chrome #1 failed 4 test(s)
[launcher] firefox #2 failed 4 test(s)
[launcher] overall: 8 failed spec(s)
Checking for post-build
Performing post-build step
Checking if email needs to be generated
No emails were triggered.
Finished: SUCCESS