什么是当我尝试运行通过PhantomJS测试此DalekJS错误? [英] What is this DalekJS error when I try to run a test via PhantomJS?
问题描述
我每次尝试使用PhantomJS运行测试,Dalek的给了我这个错误。但是使用GoogleChrome测试运行正常。
Every time I try to run a test using PhantomJS, Dalek gives me this error. However using GoogleChrome the test runs properly.
Running tests
/Users/user/node_modules/dalekjs/node_modules/dalek-browser-phantomjs/index.js:273
this.spawned.kill('SIGTERM');
^
TypeError: Cannot read property 'kill' of null
at Object.PhantomJSDriver.kill (/Users/user/node_modules/dalekjs/node_modules/dalek-browser-phantomjs/index.js:273:17)
at EventEmitter.emit (/Users/user/node_modules/dalekjs/node_modules/eventemitter2/lib/eventemitter2.js:312:17)
at Object.Dalek._shutdown (/Users/user/node_modules/dalekjs/lib/dalek.js:346:24)
at emitOne (events.js:77:13)
at process.emit (events.js:169:7)
at process._fatalException (node.js:211:26)
还有什么问题呢?
What could the problem be?
的请注意,我用的OS X 10.10.5和我在的Dalek和JS测试自动化初学者。谢谢!的
推荐答案
它看起来像有一些文件Dalek的浏览器,phantomjs缺少
It looks like there are some files missing in dalek-browser-phantomjs
缺少文件夹/文件从Dalek的浏览器 - phantomjs /节点模块/ phantomjs / lib目录
如果您安装phantomjs(NPM安装phantomjs)独自你会得到一个名为location.js
+一个名为幻影目录
。该location.js文件包含路径phantomjs和幻象文件夹包含二进制文件。
If you install phantomjs (npm install phantomjs) alone you get a file called "location.js"
+ a directory called "phantom"
. The location.js file contains the path to phantomjs and the phantom folder holds the binary.
这两个缺失,这导致了this.spawned设置为null,这在 dalekjs / node_modules / Dalek的浏览器 - phantomjs / index.js引发错误的错误:273:17
。
Those two are missing, which leads to the error that this.spawned is set to null which throws the error at dalekjs/node_modules/dalek-browser-phantomjs/index.js:273:17
.
因此,在短期:
- 从NPM下载最新phantom.js(NPM安装phantomjs)
- 在你的项目中的文件夹phantomjs将其更换。
位置:
yourproject / node_modules / dalekjs / node_modules / Dalek的浏览器 - phantomjs /节点模块/
yourproject/node_modules/dalekjs/node_modules/dalek-browser-phantomjs/node-modules/
现在所有的测试应该努力!
Now all your tests should work!
这篇关于什么是当我尝试运行通过PhantomJS测试此DalekJS错误?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!