我正在阅读Angular tutorial,并在第一章中介绍了如何运行unit和e2e测试。在教程中他们使用Chrome和Firefox。由于我在没有GUI的Ubuntu 14虚拟机上运行应用程序,因此我决定使用Phantomjs浏览器。e2e使用Phantom.js进行量角器测试
最终我能够用Phantom运行单元测试,但是我遇到了e2e问题。
这是量角器,conf.js的样子:
exports.config = {
allScriptsTimeout: 11000,
specs: [
'e2e/*.js'
],
capabilities: {
'browserName': 'phantomjs',
'phantomjs.binary.path':'./node_modules/phantomjs/bin/phantomjs',
'phantomjs.ghostdriver.cli.args': ['--loglevel=DEBUG']
},
chromeOnly:true,
baseUrl: 'http://localhost:8000/',
framework: 'jasmine',
jasmineNodeOpts: {
defaultTimeoutInterval: 30000
}
};
但是当我运行测试存在以下错误:
Starting selenium standalone server...
[launcher] Running 1 instances of WebDriver
[launcher] Process exited with error code 1
events.js:72
throw er; // Unhandled 'error' event
^
Error: spawn ENOENT
at errnoException (child_process.js:988:11)
at Process.ChildProcess._handle.onexit (child_process.js:779:34)
npm ERR! weird error 8
npm WARN This failure might be due to the use of legacy binary "node"
npm WARN For further explanations, please read
/usr/share/doc/nodejs/README.Debian
npm ERR! not ok code 0
我错过了在配置上的东西吗?在这种情况下如何获得更详细的错误描述?
什么版本的节点是你使用'节点 - 版本'和什么版本的量角器? – martin770
可能相关:http://stackoverflow.com/questions/21072439/protractor-0-16-1-e2e-angularjs-starting-selenium-standalone-server-events。 – alecxe
@ martin770节点版本是v0.10.25。量角器版本是2.5.1。 – Tamara