3

我试图让 Jasmine 在命令行中运行(无头),但没有成功。使用我们当前的配置:

宝石文件:

gem 'jasmine', :git => "git://github.com/pivotal/jasmine-gem.git"
gem 'jasmine-headless-webkit', :git => "git://github.com/johnbintz/jasmine-headless-webkit.git"

我当前的茉莉花规格配置在浏览器中运行。rake jasmine:ci但是,会打开浏览器,然后很快中止并显示以下错误消息:

/Users/`<me>`/.rvm/gems/ruby-2.0.0-p353/gems/selenium-webdriver-2.25.0/lib/selenium/webdriver/firefox/launcher.rb:79:in `connect_until_stable': unable to obtain stable firefox connection in 60 seconds (127.0.0.1:7055) (Selenium::WebDriver::Error::WebDriverError)

我查看了jasmine-headless-webkit的 github 页面,发现该项目被列为已死。所以!我尝试用 替换 jasmine & jasmine-headless-webkit gem jasmine-rails,但出现此错误:

ERROR: TypeError: 'undefined' is not an object (evaluating 'jasmine.Matchers.prototype')
TRACE:
 -> file:///Users/<me>/<myapp>/tmp/jasmine/assets/jasmine-specs.js: 711
 -> file:///Users/<me>/<myapp>/tmp/jasmine/assets/jasmine-specs.js: 736
 -> file:///Users/<me>/<myapp>/tmp/jasmine/assets/jasmine-specs.js: 738
 -> file:///Users/<me>/<myapp>/tmp/jasmine/assets/jasmine-specs.js: 862
rake aborted!
Error executing command: "/Users/<me>/.phantomjs/1.9.7/darwin/bin/phantomjs" "/Users/<me>/.rvm/gems/ruby-2.0.0-p353/gems/jasmine-rails-0.9.0/lib/jasmine_rails/../assets/javascripts/jasmine-runner.js" "/Users/<me>/<myapp>/tmp/jasmine/runner.html?spec="
4

1 回答 1

1

由于大多数用户似乎都希望使用 phantom 运行他们的 jasmine 规范,因此作为 2.0 版本的一部分,我们将其设为默认值。jasmine:ci使用 selenium运行的能力被提取到它自己的 gem中。

于 2014-11-13T21:12:45.543 回答