bernerdschaefer / akephalos

Headless HTMLUnit powered browser for Capybara
bernerdschaefer.github.com/akephalos
MIT License
336 stars 50 forks source link

Dependency problem when akephalos gem installed with bundler? #29

Closed suan closed 13 years ago

suan commented 14 years ago

I'm using bundler 1.0.2 on rails 2.3.8. Below is the stack trace I get when it errors out during a test...

1) Error:
test_add_custom(RampartsTest):
NativeException: com.gargoylesoftware.htmlunit.ScriptException: ReferenceError:     "Raphael" is not defined. (http://localhost:9887/javascripts/04b21_400.font.js?1287041154#1)
(drbunix:///tmp/akephalos.1687.sock) akephalos (0.2.4) lib/akephalos/client.rb:54:in `visit'
(drbunix:///tmp/akephalos.1687.sock) file:/usr/lib/ruby/gems/1.8/gems/jruby-jars-1.5.3/lib/jruby-stdlib-1.5.3.jar!/META-INF/jruby.home/lib/ruby/1.8/drb/drb.rb:1593:in `perform_without_block'
(drbunix:///tmp/akephalos.1687.sock) file:/usr/lib/ruby/gems/1.8/gems/jruby-jars-1.5.3/lib/jruby-stdlib-1.5.3.jar!/META-INF/jruby.home/lib/ruby/1.8/drb/drb.rb:1553:in `perform'
(drbunix:///tmp/akephalos.1687.sock) file:/usr/lib/ruby/gems/1.8/gems/jruby-jars-1.5.3/lib/jruby-stdlib-1.5.3.jar!/META-INF/jruby.home/lib/ruby/1.8/drb/drb.rb:1627:in `main_loop'
(drbunix:///tmp/akephalos.1687.sock) file:/usr/lib/ruby/gems/1.8/gems/jruby-jars-1.5.3/lib/jruby-stdlib-1.5.3.jar!/META-INF/jruby.home/lib/ruby/1.8/drb/drb.rb:1623:in `loop'
(drbunix:///tmp/akephalos.1687.sock) file:/usr/lib/ruby/gems/1.8/gems/jruby-jars-1.5.3/lib/jruby-stdlib-1.5.3.jar!/META-INF/jruby.home/lib/ruby/1.8/drb/drb.rb:1623:in `main_loop'
(drbunix:///tmp/akephalos.1687.sock) file:/usr/lib/ruby/gems/1.8/gems/jruby-jars-1.5.3/lib/jruby-stdlib-1.5.3.jar!/META-INF/jruby.home/lib/ruby/1.8/drb/drb.rb:1619:in `start'
(drbunix:///tmp/akephalos.1687.sock) file:/usr/lib/ruby/gems/1.8/gems/jruby-jars-1.5.3/lib/jruby-stdlib-1.5.3.jar!/META-INF/jruby.home/lib/ruby/1.8/drb/drb.rb:1619:in `main_loop'
(drbunix:///tmp/akephalos.1687.sock) file:/usr/lib/ruby/gems/1.8/gems/jruby-jars-1.5.3/lib/jruby-stdlib-1.5.3.jar!/META-INF/jruby.home/lib/ruby/1.8/drb/drb.rb:1468:in `run'
(drbunix:///tmp/akephalos.1687.sock) file:/usr/lib/ruby/gems/1.8/gems/jruby-jars-1.5.3/lib/jruby-stdlib-1.5.3.jar!/META-INF/jruby.home/lib/ruby/1.8/drb/drb.rb:1465:in `start'
(drbunix:///tmp/akephalos.1687.sock) file:/usr/lib/ruby/gems/1.8/gems/jruby-jars-1.5.3/lib/jruby-stdlib-1.5.3.jar!/META-INF/jruby.home/lib/ruby/1.8/drb/drb.rb:1465:in `run'
(drbunix:///tmp/akephalos.1687.sock) file:/usr/lib/ruby/gems/1.8/gems/jruby-jars-1.5.3/lib/jruby-stdlib-1.5.3.jar!/META-INF/jruby.home/lib/ruby/1.8/drb/drb.rb:1385:in `initialize'
(drbunix:///tmp/akephalos.1687.sock) file:/usr/lib/ruby/gems/1.8/gems/jruby-jars-1.5.3/lib/jruby-stdlib-1.5.3.jar!/META-INF/jruby.home/lib/ruby/1.8/drb/drb.rb:1665:in `new'
(drbunix:///tmp/akephalos.1687.sock) file:/usr/lib/ruby/gems/1.8/gems/jruby-jars-1.5.3/lib/jruby-stdlib-1.5.3.jar!/META-INF/jruby.home/lib/ruby/1.8/drb/drb.rb:1665:in `start_service'
(drbunix:///tmp/akephalos.1687.sock) akephalos (0.2.4) lib/akephalos/server.rb:29:in `start!'
(drbunix:///tmp/akephalos.1687.sock) -e:1
akephalos (0.2.4) lib/akephalos/capybara.rb:159:in `visit'
capybara (0.3.9) lib/capybara/dsl.rb:55:in `visit'
lib/authenticated_test_helper.rb:11:in `login_as'
/test/javascript/ramparts_test.rb:7:in `test_add_custom'

Here is my Gemfile:

source :rubygems group :test do gem "capybara" gem "akephalos" end

bernerdschaefer commented 13 years ago

Akephalos doesn't support Raphael.js, since it requires either SVG or VML, neither of which are present in HtmlUnil (since it's a headless browser...).

The best solution is probably to set up a filter for requests to raphael as shown here for other javascript libraries: http://oinopa.com/akephalos/filters.html

If you come up with a solution, let me know -- I'm trying to keep track of some common filters people have had to set up.