简体   繁体   中英

Trouble running Jasmine specs headless

I'm trying to get Jasmine to run in the command line (headless), but have had no success. With our current configuration:

Gemfile:

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

My current configuration of jasmine specs runs in the browser. rake jasmine:ci , however, opens a browser, and then aborts shortly thereafter with this error message:

/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)

I looked at the github page for jasmine-headless-webkit , and saw that the project is listed as dead. So! I tried to replace the jasmine & jasmine-headless-webkit gem with jasmine-rails , and I got this error:

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="

Since most users seemed to want to run their jasmine specs using phantom, as part of the 2.0 release we made that the default. The ability to run jasmine:ci with selenium was extracted into its own gem .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM