[英]Getting “Syntax error” when trying to setup Jasmine2HtmlReporter
Setting up Jasmine2HtmlReporter for my Protractor project. 为我的量角器项目设置Jasmine2HtmlReporter。
Adding next code to my conf.js file: 在我的conf.js文件中添加下一个代码:
onPrepare: function() {
jasmine.getEnv().addReporter(
new Jasmine2HtmlReporter({
savePath: 'target/screenshots'
})
);
}
And getting next error: 并得到下一个错误:
onPrepare: function() {
^^^^^^^^^
SyntaxError: Unexpected identifier
Below my whole conf.js file: 在我的整个conf.js文件下面:
var Jasmine2HtmlReporter = require('protractor-jasmine2-html-reporter');
exports.config = {
jasmineNodeOpts: {
showColors: true,
defaultTimeoutInterval: 100000
},
capabilities: {
'browserName': 'chrome'
},
directConnect: true,
framework: 'jasmine',
specs: ['specs/calbarSpec.js']
onPrepare: function() {
jasmine.getEnv().addReporter(
new Jasmine2HtmlReporter({
savePath: 'target/screenshots'
})
);
}
};
var Jasmine2HtmlReporter = require('protractor-jasmine2-html-reporter');
exports.config = {
jasmineNodeOpts: {
showColors: true,
defaultTimeoutInterval: 100000
},
capabilities: {
'browserName': 'chrome'
},
directConnect: true,
framework: 'jasmine',
specs: ['specs/calbarSpec.js'],
onPrepare: function() {
jasmine.getEnv().addReporter(
new Jasmine2HtmlReporter({
savePath: 'target/screenshots'
})
);
}
};
Put a comma after the "specs" key. 在“规格”键后面加上逗号。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.