node.js僵尸无头浏览器不加载url

工具

  • Linux ubuntuG5 3.13.0-48-powerpc64-smp
  • node.js v0.10.38
  • 僵尸版本3.1.0 2015-03-15
  • 茉莉花节点1.14.3

sample_zombie_spec.js

var Browser, assert, browser, url, title; assert = require('assert'); Browser = require('zombie'); var google = "https://google.com" var google_title = "Google" url = google title = google_title browser = new Browser(); describe('home page', function() { describe('title', function() { it('should have a title', function(done) { browser.visit(url).then(function() { assert.equal(browser.text('title'), title); done(); }).fail(function(err) { console.log('Failed with error: ', error); done(err); }); }); }); }); 

这个文件是在spec/所以我运行以下命令:

 jasmine-node spec/ 

结果:

 F Failures: 1) home page title should have a title Message: TypeError: Object [object Promise] has no method 'fail' Stacktrace: TypeError: Object [object Promise] has no method 'fail' at null.<anonymous> (/home/dmmmd/Dropbox/node_js_projects/affinity-zombie/spec/sample_zombie_spec.js:21:12) at null.<anonymous> (/usr/local/lib/node_modules/jasmine-node/lib/jasmine-node/async-callback.js:45:37) at Timer.listOnTimeout [as ontimeout] (timers.js:112:15) Finished in 0.12 seconds 1 test, 1 assertion, 1 failure, 0 skipped 

我在另一台机器上尝试了完全相同的东西:

工具

  • 达尔文14.3.0达尔文内核版本14.3.0
  • io.js v1.8.1
  • 僵尸版本4.0.7 2015-04-10
  • 茉莉花节点1.14.3

结果:

 F Failures: 1) home page title should have a title Message: TypeError: undefined is not a function Stacktrace: TypeError: undefined is not a function at null.<anonymous> (/Users/dmmmd/Dropbox/node_js_projects/spec/sample_zombie_spec.js:21:12) at null.<anonymous> (/usr/local/lib/node_modules/jasmine-node/lib/jasmine-node/async-callback.js:45:37) at Timer.listOnTimeout (timers.js:89:15) Finished in 0.069 seconds 1 test, 1 assertion, 1 failure, 0 skipped 

我也尝试了一些其他的URL,甚至本地主机也没有成功。

JavaScript,node.js,io.js,僵尸和茉莉花都是新来的,所以我基本上只是从文档和stackoverflow问题食谱。 我将不胜感激任何build议。 我怀疑我错过了很简单的事情。

谢谢。