我的系统中有以下版本
jasmine - reporters@1.0.0
node - v4.5.0
protractor - 4.0.10
而且我无法生成任何结果文件。对于我的脚本这些版本是否存在兼容性问题,我也尝试过使用 jasmine-reporters - 2.0.0 仍然没有运气。
请帮帮我谢谢
我的 conf.js 看起来像
capabilities: {
'browserName': 'firefox
},
onPrepare: function() {
//The require statement must be down here, since jasmine-reporters
//needs jasmine to be in the global and protractor does not guarantee
// this until inside the onPrepare function.
browser.driver.manage().window().maximize();
require('jasmine-reporters');
jasmine.getEnv().addReporter(new jasmine.JUnitXmlReporter('testresults', true, true));
},
specs: [
'Apps/ImportApp/importEMC.js',
],
我也尝试过使用 jasmine-reporters 2.0.0 并且代码是
framework: 'jasmine2',
onPrepare: function() {
var jasmineReporters = require('jasmine-reporters');
jasmine.getEnv().addReporter(new jasmineReporters.JUnitXmlReporter({
consolidateAll: true,
savePath: 'testresults',
filePrefix: 'xmloutput'
}));
},
为此,它给了我错误
jasmineReporters.JUnitXmlReporter 不是函数
错误日志
在 export.config.onPrepare (D:\HalomemTestScripts\halosysNewScripts\localWorkspace\halosysus_halomem-newtests\conf_importapp.js:33:38) 在 C:\Users\tanushree.y\AppData\Roaming\npm\node_modules\protractor\built\ util.js:48:49 在 Function.promise (C:\Users\tanushree.y\AppData\Roaming\npm\node_modules\protractor\node_modules\q\q.js:682:9) 在 Object.runFilenameOrFn_ (C: \Users\tanushree.y\AppData\Roaming\npm\node_modules\protractor\built\util.js:38:16) 在 C:\Users\tanushree.y\AppData\Roaming\npm\node_modules\protractor\built\runner .js:93:27 at _fulfilled (C:\Users\tanushree.y\AppData\Roaming\npm\node_modules\protractor\node_modules\q\q.js:834:54) 在 Promise.then.Q.nextTick.self .promiseDispatch.done (C:\Users\tanushree.y\AppData\Roaming\npm\node_modules\protractor\node_modules\q\q.js:863:30) 在 Promise.promise。promiseDispatch (C:\Users\tanushree.y\AppData\Roaming\npm\node_modules\protractor\node_modules\q\q.js:796:13) 在 C:\Users\tanushree.y\AppData\Roaming\npm\node_modules \protractor\node_modules\q\q.js:556:49 at runSingle (C:\Users\tanushree.y\AppData\Roaming\npm\node_modules\protractor\node_modules\q\q.js:137:13) [11 :42:23] E/launcher - 进程退出,错误代码为 100