Skip to content
This repository has been archived by the owner on Nov 27, 2020. It is now read-only.

ThreadError #6

Closed
kbaum opened this issue Jan 6, 2012 · 22 comments
Closed

ThreadError #6

kbaum opened this issue Jan 6, 2012 · 22 comments

Comments

@kbaum
Copy link

kbaum commented Jan 6, 2012

I got the following error when i tried out poltergeist.

 @javascript
  Scenario: Update a space                                          # features/add_update_spaces.feature:59
    Given I am a broker                                             # features/step_definitions/common_steps.rb:3
    And I have a space                                              # features/step_definitions/common_steps.rb:36
{"name"=>"visit", "args"=>["http://127.0.0.1:53891/backdoor/347"]}
    And I am logged in                                              # features/step_definitions/authentication_steps.rb:19
      killed thread (ThreadError)
      /Users/karl/.rvm/gems/ruby-1.9.2-p290@viewthespace/gems/poltergeist-0.2.0/lib/capybara/poltergeist/server_manager.rb:75:in `run'
      /Users/karl/.rvm/gems/ruby-1.9.2-p290@viewthespace/gems/poltergeist-0.2.0/lib/capybara/poltergeist/server_manager.rb:75:in `thread_execute'
      /Users/karl/.rvm/gems/ruby-1.9.2-p290@viewthespace/gems/poltergeist-0.2.0/lib/capybara/poltergeist/server_manager.rb:51:in `block in send'
      /Users/karl/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/timeout.rb:58:in `timeout'
      /Users/karl/.rvm/gems/ruby-1.9.2-p290@viewthespace/gems/poltergeist-0.2.0/lib/capybara/poltergeist/server_manager.rb:46:in `send'
      /Users/karl/.rvm/gems/ruby-1.9.2-p290@viewthespace/gems/poltergeist-0.2.0/lib/capybara/poltergeist/server.rb:19:in `send'
      /Users/karl/.rvm/gems/ruby-1.9.2-p290@viewthespace/gems/poltergeist-0.2.0/lib/capybara/poltergeist/browser.rb:124:in `command'
      /Users/karl/.rvm/gems/ruby-1.9.2-p290@viewthespace/gems/poltergeist-0.2.0/lib/capybara/poltergeist/browser.rb:19:in `visit'
      /Users/karl/.rvm/gems/ruby-1.9.2-p290@viewthespace/gems/poltergeist-0.2.0/lib/capybara/poltergeist/driver.rb:31:in `visit'
      /Users/karl/.rvm/gems/ruby-1.9.2-p290@viewthespace/gems/capybara-1.1.2/lib/capybara/session.rb:157:in `visit'
      /Users/karl/.rvm/gems/ruby-1.9.2-p290@viewthespace/gems/capybara-1.1.2/lib/capybara/dsl.rb:161:in `visit'
      /Users/karl/workspace/viewthespace/features/step_definitions/authentication_steps.rb:20:in `block in <top (required)>'
      /Users/karl/.rvm/gems/ruby-1.9.2-p290@viewthespace/gems/cucumber-1.1.3/lib/cucumber/core_ext/instance_exec.rb:48:in `instance_exec'
      /Users/karl/.rvm/gems/ruby-1.9.2-p290@viewthespace/gems/cucumber-1.1.3/lib/cucumber/core_ext/instance_exec.rb:48:in `block in cucumber_instance_exec'
      /Users/karl/.rvm/gems/ruby-1.9.2-p290@viewthespace/gems/cucumber-1.1.3/lib/cucumber/core_ext/instance_exec.rb:69:in `cucumber_run_with_backtrace_filtering'
      /Users/karl/.rvm/gems/ruby-1.9.2-p290@viewthespace/gems/cucumber-1.1.3/lib/cucumber/core_ext/instance_exec.rb:36:in `cucumber_instance_exec'
      /Users/karl/.rvm/gems/ruby-1.9.2-p290@viewthespace/gems/cucumber-1.1.3/lib/cucumber/rb_support/rb_step_definition.rb:62:in `invoke'
      /Users/karl/.rvm/gems/ruby-1.9.2-p290@viewthespace/gems/cucumber-1.1.3/lib/cucumber/step_match.rb:25:in `invoke'
      /Users/karl/.rvm/gems/ruby-1.9.2-p290@viewthespace/gems/cucumber-1.1.3/lib/cucumber/ast/step_invocation.rb:59:in `invoke'
      /Users/karl/.rvm/gems/ruby-1.9.2-p290@viewthespace/gems/cucumber-1.1.3/lib/cucumber/ast/step_invocation.rb:38:in `accept'
      /Users/karl/.rvm/gems/ruby-1.9.2-p290@viewthespace/gems/cucumber-1.1.3/lib/cucumber/ast/tree_walker.rb:99:in `block in visit_step'
      /Users/karl/.rvm/gems/ruby-1.9.2-p290@viewthespace/gems/cucumber-1.1.3/lib/cucumber/ast/tree_walker.rb:163:in `broadcast'

I am using:

osx 10.6.8
ruby 1.9.2p290
capybara 1.1.2
rails 3.1.3
phantomjs 1.4.1

thx

@jonleighton
Copy link
Contributor

Thanks for trying it out and reporting this bug. Does it happen on each test, or just on one of them? Is it reliably reproducible? If it's just one - is there anything special happening in that test? I don't suppose you can provide me with steps / code to reproduce the issue myself?

@kbaum
Copy link
Author

kbaum commented Jan 6, 2012

Hi Jon. It happens on all tests for me. It almost seems like something is wrong with my installation honestly. I downloaded the phantomjs osx install here:

http://code.google.com/p/phantomjs/downloads/detail?name=phantomjs-1.4.1-macosx-static-x86.zip&can=2&q=

I used brew to install the latest QT.

It could be that there is something wrong with our project and all of it's million gems. Is there some type of example plain rails 3.1/capybara/poltergeist i can try on my machine.

@jonleighton
Copy link
Contributor

Do the poltergeist tests work for you? (I.e. clone the repo and run rake.)

@kbaum
Copy link
Author

kbaum commented Jan 6, 2012

14 errors in all.

https://gist.github.com/42e033fb094feef3a140

@rb2k
Copy link

rb2k commented Jan 7, 2012

Strange, tested in in Lion (10.7) on 1.9.2-p290 with phantomjs 1.4.1

$ rake test
/Users/mseeger/.rvm/rubies/ruby-1.9.2-p290/bin/ruby -S rspec ./spec/integration/driver_spec.rb ./spec/integration/session_spec.rb ./spec/unit/browser_spec.rb ./spec/unit/driver_spec.rb ./spec/unit/server_manager_spec.rb
.............................................................................................................................................................................................................................................................................................................................................................................................................................................................................................

Finished in 38.64 seconds
477 examples, 0 failures

@ghost
Copy link

ghost commented Jan 7, 2012

Hello,

MacOS X Lion 10.7.2

EnvyDeux:poltergeist rfuentealbac$ ruby --version
ruby 1.9.2p312 (2011-08-11 revision 32926) [x86_64-darwin11.2.0]

Using the latest capybara from github and rails 3.1.3.

After running "rake test" (had to do it w/bundle exec due to problems with rspec-2.8.0 which in turn I am using for another projects):

EnvyDeux:poltergeist rfuentealbac$ bundle exec rake test
/usr/local/rvm/rubies/ruby-1.9.2-head/bin/ruby -S rspec ./spec/integration/driver_spec.rb ./spec/integration/session_spec.rb ./spec/unit/browser_spec.rb ./spec/unit/driver_spec.rb ./spec/unit/server_manager_spec.rb
..........................................F.................................................................................................................................................................................FFF........FFF............................................................................FFFF................................................................................................................FF.........F................................

Failures:

  1) Capybara::Session with poltergeist driver it should behave like session#reset_session! resets page body
     Failure/Error: @session.body.should_not include('This is a test')
     NoMethodError:
       undefined method `include?' for nil:NilClass
     Shared Example Group: "session" called from ./spec/integration/session_spec.rb:10
     # /Users/rfuentealbac/.bundler/ruby/1.9.1/capybara-2a9a968d8bed/lib/capybara/spec/session.rb:77:in `block (3 levels) in <top (required)>'

  2) Capybara::Session with poltergeist driver it should behave like session it should behave like has_text#has_text? should be false if text is in the title tag in the head
     Failure/Error: @session.should_not have_text('with_js')
       expected #has_text?("with_js") to return false, got true
     Shared Example Group: "has_text" called from /Users/rfuentealbac/.bundler/ruby/1.9.1/capybara-2a9a968d8bed/lib/capybara/spec/session.rb:96
     # /Users/rfuentealbac/.bundler/ruby/1.9.1/capybara-2a9a968d8bed/lib/capybara/spec/session/has_text_spec.rb:58:in `block (3 levels) in <top (required)>'

  3) Capybara::Session with poltergeist driver it should behave like session it should behave like has_text#has_text? should be false if text is inside a script tag in the body
     Failure/Error: @session.should_not have_text('a javascript comment')
       expected #has_text?("a javascript comment") to return false, got true
     Shared Example Group: "has_text" called from /Users/rfuentealbac/.bundler/ruby/1.9.1/capybara-2a9a968d8bed/lib/capybara/spec/session.rb:96
     # /Users/rfuentealbac/.bundler/ruby/1.9.1/capybara-2a9a968d8bed/lib/capybara/spec/session/has_text_spec.rb:63:in `block (3 levels) in <top (required)>'

  4) Capybara::Session with poltergeist driver it should behave like session it should behave like has_text#has_text? should be false if the given text is on the page but not visible
     Failure/Error: @session.should_not have_text('Inside element with hidden ancestor')
       expected #has_text?("Inside element with hidden ancestor") to return false, got true
     Shared Example Group: "has_text" called from /Users/rfuentealbac/.bundler/ruby/1.9.1/capybara-2a9a968d8bed/lib/capybara/spec/session.rb:96
     # /Users/rfuentealbac/.bundler/ruby/1.9.1/capybara-2a9a968d8bed/lib/capybara/spec/session/has_text_spec.rb:69:in `block (3 levels) in <top (required)>'

  5) Capybara::Session with poltergeist driver it should behave like session it should behave like has_text#has_no_text? should be true if text is in the title tag in the head
     Failure/Error: @session.should have_no_text('with_js')
       expected #has_no_text?("with_js") to return true, got false
     Shared Example Group: "has_text" called from /Users/rfuentealbac/.bundler/ruby/1.9.1/capybara-2a9a968d8bed/lib/capybara/spec/session.rb:96
     # /Users/rfuentealbac/.bundler/ruby/1.9.1/capybara-2a9a968d8bed/lib/capybara/spec/session/has_text_spec.rb:124:in `block (3 levels) in <top (required)>'

  6) Capybara::Session with poltergeist driver it should behave like session it should behave like has_text#has_no_text? should be true if text is inside a script tag in the body
     Failure/Error: @session.should have_no_text('a javascript comment')
       expected #has_no_text?("a javascript comment") to return true, got false
     Shared Example Group: "has_text" called from /Users/rfuentealbac/.bundler/ruby/1.9.1/capybara-2a9a968d8bed/lib/capybara/spec/session.rb:96
     # /Users/rfuentealbac/.bundler/ruby/1.9.1/capybara-2a9a968d8bed/lib/capybara/spec/session/has_text_spec.rb:129:in `block (3 levels) in <top (required)>'

  7) Capybara::Session with poltergeist driver it should behave like session it should behave like has_text#has_no_text? should be true if the given text is on the page but not visible
     Failure/Error: @session.should have_no_text('Inside element with hidden ancestor')
       expected #has_no_text?("Inside element with hidden ancestor") to return true, got false
     Shared Example Group: "has_text" called from /Users/rfuentealbac/.bundler/ruby/1.9.1/capybara-2a9a968d8bed/lib/capybara/spec/session.rb:96
     # /Users/rfuentealbac/.bundler/ruby/1.9.1/capybara-2a9a968d8bed/lib/capybara/spec/session/has_text_spec.rb:135:in `block (3 levels) in <top (required)>'

  8) Capybara::Session with poltergeist driver it should behave like session it should behave like has_link#has_link? should be true if the given link is on the page
     Failure/Error: @session.should have_link('A link', :href => '/with_simple_html')
     NoMethodError:
       undefined method `axis' for XPath:Module
     Shared Example Group: "has_link" called from /Users/rfuentealbac/.bundler/ruby/1.9.1/capybara-2a9a968d8bed/lib/capybara/spec/session.rb:100
     # /Users/rfuentealbac/.bundler/ruby/1.9.1/capybara-2a9a968d8bed/lib/capybara/selector.rb:96:in `block (2 levels) in <top (required)>'
     # /Users/rfuentealbac/.bundler/ruby/1.9.1/capybara-2a9a968d8bed/lib/capybara/query.rb:58:in `call'
     # /Users/rfuentealbac/.bundler/ruby/1.9.1/capybara-2a9a968d8bed/lib/capybara/query.rb:58:in `block in matches_filters?'
     # /Users/rfuentealbac/.bundler/ruby/1.9.1/capybara-2a9a968d8bed/lib/capybara/query.rb:57:in `each'
     # /Users/rfuentealbac/.bundler/ruby/1.9.1/capybara-2a9a968d8bed/lib/capybara/query.rb:57:in `matches_filters?'
     # /Users/rfuentealbac/.bundler/ruby/1.9.1/capybara-2a9a968d8bed/lib/capybara/node/finders.rb:115:in `block in all'
     # /Users/rfuentealbac/.bundler/ruby/1.9.1/capybara-2a9a968d8bed/lib/capybara/node/finders.rb:113:in `select'
     # /Users/rfuentealbac/.bundler/ruby/1.9.1/capybara-2a9a968d8bed/lib/capybara/node/finders.rb:113:in `all'
     # /Users/rfuentealbac/.bundler/ruby/1.9.1/capybara-2a9a968d8bed/lib/capybara/node/matchers.rb:38:in `block in has_selector?'
     # /Users/rfuentealbac/.bundler/ruby/1.9.1/capybara-2a9a968d8bed/lib/capybara/node/base.rb:46:in `wait_until'
     # /Users/rfuentealbac/.bundler/ruby/1.9.1/capybara-2a9a968d8bed/lib/capybara/node/matchers.rb:37:in `has_selector?'
     # /Users/rfuentealbac/.bundler/ruby/1.9.1/capybara-2a9a968d8bed/lib/capybara/node/matchers.rb:232:in `has_link?'
     # (eval):2:in `has_link?'
     # /Users/rfuentealbac/.bundler/ruby/1.9.1/capybara-2a9a968d8bed/lib/capybara/spec/session/has_link_spec.rb:11:in `block (3 levels) in <top (required)>'

  9) Capybara::Session with poltergeist driver it should behave like session it should behave like has_link#has_link? should be false if the given link is not on the page
     Failure/Error: @session.should_not have_link('A link', :href => '/non-existant-href')
     NoMethodError:
       undefined method `axis' for XPath:Module
     Shared Example Group: "has_link" called from /Users/rfuentealbac/.bundler/ruby/1.9.1/capybara-2a9a968d8bed/lib/capybara/spec/session.rb:100
     # /Users/rfuentealbac/.bundler/ruby/1.9.1/capybara-2a9a968d8bed/lib/capybara/selector.rb:96:in `block (2 levels) in <top (required)>'
     # /Users/rfuentealbac/.bundler/ruby/1.9.1/capybara-2a9a968d8bed/lib/capybara/query.rb:58:in `call'
     # /Users/rfuentealbac/.bundler/ruby/1.9.1/capybara-2a9a968d8bed/lib/capybara/query.rb:58:in `block in matches_filters?'
     # /Users/rfuentealbac/.bundler/ruby/1.9.1/capybara-2a9a968d8bed/lib/capybara/query.rb:57:in `each'
     # /Users/rfuentealbac/.bundler/ruby/1.9.1/capybara-2a9a968d8bed/lib/capybara/query.rb:57:in `matches_filters?'
     # /Users/rfuentealbac/.bundler/ruby/1.9.1/capybara-2a9a968d8bed/lib/capybara/node/finders.rb:115:in `block in all'
     # /Users/rfuentealbac/.bundler/ruby/1.9.1/capybara-2a9a968d8bed/lib/capybara/node/finders.rb:113:in `select'
     # /Users/rfuentealbac/.bundler/ruby/1.9.1/capybara-2a9a968d8bed/lib/capybara/node/finders.rb:113:in `all'
     # /Users/rfuentealbac/.bundler/ruby/1.9.1/capybara-2a9a968d8bed/lib/capybara/node/matchers.rb:38:in `block in has_selector?'
     # /Users/rfuentealbac/.bundler/ruby/1.9.1/capybara-2a9a968d8bed/lib/capybara/node/base.rb:46:in `wait_until'
     # /Users/rfuentealbac/.bundler/ruby/1.9.1/capybara-2a9a968d8bed/lib/capybara/node/matchers.rb:37:in `has_selector?'
     # /Users/rfuentealbac/.bundler/ruby/1.9.1/capybara-2a9a968d8bed/lib/capybara/node/matchers.rb:232:in `has_link?'
     # (eval):2:in `has_link?'
     # /Users/rfuentealbac/.bundler/ruby/1.9.1/capybara-2a9a968d8bed/lib/capybara/spec/session/has_link_spec.rb:16:in `block (3 levels) in <top (required)>'

  10) Capybara::Session with poltergeist driver it should behave like session it should behave like has_link#has_no_link? should be false if the given link is on the page
     Failure/Error: @session.should_not have_no_link('A link', :href => '/with_simple_html')
     NoMethodError:
       undefined method `axis' for XPath:Module
     Shared Example Group: "has_link" called from /Users/rfuentealbac/.bundler/ruby/1.9.1/capybara-2a9a968d8bed/lib/capybara/spec/session.rb:100
     # /Users/rfuentealbac/.bundler/ruby/1.9.1/capybara-2a9a968d8bed/lib/capybara/selector.rb:96:in `block (2 levels) in <top (required)>'
     # /Users/rfuentealbac/.bundler/ruby/1.9.1/capybara-2a9a968d8bed/lib/capybara/query.rb:58:in `call'
     # /Users/rfuentealbac/.bundler/ruby/1.9.1/capybara-2a9a968d8bed/lib/capybara/query.rb:58:in `block in matches_filters?'
     # /Users/rfuentealbac/.bundler/ruby/1.9.1/capybara-2a9a968d8bed/lib/capybara/query.rb:57:in `each'
     # /Users/rfuentealbac/.bundler/ruby/1.9.1/capybara-2a9a968d8bed/lib/capybara/query.rb:57:in `matches_filters?'
     # /Users/rfuentealbac/.bundler/ruby/1.9.1/capybara-2a9a968d8bed/lib/capybara/node/finders.rb:115:in `block in all'
     # /Users/rfuentealbac/.bundler/ruby/1.9.1/capybara-2a9a968d8bed/lib/capybara/node/finders.rb:113:in `select'
     # /Users/rfuentealbac/.bundler/ruby/1.9.1/capybara-2a9a968d8bed/lib/capybara/node/finders.rb:113:in `all'
     # /Users/rfuentealbac/.bundler/ruby/1.9.1/capybara-2a9a968d8bed/lib/capybara/node/matchers.rb:70:in `block in has_no_selector?'
     # /Users/rfuentealbac/.bundler/ruby/1.9.1/capybara-2a9a968d8bed/lib/capybara/node/base.rb:46:in `wait_until'
     # /Users/rfuentealbac/.bundler/ruby/1.9.1/capybara-2a9a968d8bed/lib/capybara/node/matchers.rb:69:in `has_no_selector?'
     # /Users/rfuentealbac/.bundler/ruby/1.9.1/capybara-2a9a968d8bed/lib/capybara/node/matchers.rb:244:in `has_no_link?'
     # (eval):2:in `has_no_link?'
     # /Users/rfuentealbac/.bundler/ruby/1.9.1/capybara-2a9a968d8bed/lib/capybara/spec/session/has_link_spec.rb:28:in `block (3 levels) in <top (required)>'

  11) Capybara::Session with poltergeist driver it should behave like session it should behave like has_link#has_no_link? should be true if the given link is not on the page
     Failure/Error: @session.should have_no_link('A link', :href => '/non-existant-href')
     NoMethodError:
       undefined method `axis' for XPath:Module
     Shared Example Group: "has_link" called from /Users/rfuentealbac/.bundler/ruby/1.9.1/capybara-2a9a968d8bed/lib/capybara/spec/session.rb:100
     # /Users/rfuentealbac/.bundler/ruby/1.9.1/capybara-2a9a968d8bed/lib/capybara/selector.rb:96:in `block (2 levels) in <top (required)>'
     # /Users/rfuentealbac/.bundler/ruby/1.9.1/capybara-2a9a968d8bed/lib/capybara/query.rb:58:in `call'
     # /Users/rfuentealbac/.bundler/ruby/1.9.1/capybara-2a9a968d8bed/lib/capybara/query.rb:58:in `block in matches_filters?'
     # /Users/rfuentealbac/.bundler/ruby/1.9.1/capybara-2a9a968d8bed/lib/capybara/query.rb:57:in `each'
     # /Users/rfuentealbac/.bundler/ruby/1.9.1/capybara-2a9a968d8bed/lib/capybara/query.rb:57:in `matches_filters?'
     # /Users/rfuentealbac/.bundler/ruby/1.9.1/capybara-2a9a968d8bed/lib/capybara/node/finders.rb:115:in `block in all'
     # /Users/rfuentealbac/.bundler/ruby/1.9.1/capybara-2a9a968d8bed/lib/capybara/node/finders.rb:113:in `select'
     # /Users/rfuentealbac/.bundler/ruby/1.9.1/capybara-2a9a968d8bed/lib/capybara/node/finders.rb:113:in `all'
     # /Users/rfuentealbac/.bundler/ruby/1.9.1/capybara-2a9a968d8bed/lib/capybara/node/matchers.rb:70:in `block in has_no_selector?'
     # /Users/rfuentealbac/.bundler/ruby/1.9.1/capybara-2a9a968d8bed/lib/capybara/node/base.rb:46:in `wait_until'
     # /Users/rfuentealbac/.bundler/ruby/1.9.1/capybara-2a9a968d8bed/lib/capybara/node/matchers.rb:69:in `has_no_selector?'
     # /Users/rfuentealbac/.bundler/ruby/1.9.1/capybara-2a9a968d8bed/lib/capybara/node/matchers.rb:244:in `has_no_link?'
     # (eval):2:in `has_no_link?'
     # /Users/rfuentealbac/.bundler/ruby/1.9.1/capybara-2a9a968d8bed/lib/capybara/spec/session/has_link_spec.rb:33:in `block (3 levels) in <top (required)>'

  12) Capybara::Session with poltergeist driver it should behave like session it should behave like current_url#current_url, #current_path, #current_host is unaffected by posting through a relative form
     Failure/Error: @session.current_url.should == "#{scheme}://#{s.host}:#{s.port}#{path}"
       expected: "http://127.0.0.1:61785/host"
            got: "http://127.0.0.1:61785/host?" (using ==)
     Shared Example Group: "current_url" called from /Users/rfuentealbac/.bundler/ruby/1.9.1/capybara-2a9a968d8bed/lib/capybara/spec/session.rb:110
     # /Users/rfuentealbac/.bundler/ruby/1.9.1/capybara-2a9a968d8bed/lib/capybara/spec/session/current_url_spec.rb:17:in `should_be_on'
     # /Users/rfuentealbac/.bundler/ruby/1.9.1/capybara-2a9a968d8bed/lib/capybara/spec/session/current_url_spec.rb:69:in `block (3 levels) in <top (required)>'

  13) Capybara::Session with poltergeist driver it should behave like session it should behave like current_url#current_url, #current_path, #current_host is affected by posting through an absolute form
     Failure/Error: @session.current_url.should == "#{scheme}://#{s.host}:#{s.port}#{path}"
       expected: "http://127.0.0.1:61788/host"
            got: "http://127.0.0.1:61788/host?" (using ==)
     Shared Example Group: "current_url" called from /Users/rfuentealbac/.bundler/ruby/1.9.1/capybara-2a9a968d8bed/lib/capybara/spec/session.rb:110
     # /Users/rfuentealbac/.bundler/ruby/1.9.1/capybara-2a9a968d8bed/lib/capybara/spec/session/current_url_spec.rb:17:in `should_be_on'
     # /Users/rfuentealbac/.bundler/ruby/1.9.1/capybara-2a9a968d8bed/lib/capybara/spec/session/current_url_spec.rb:75:in `block (3 levels) in <top (required)>'

  14) Capybara::Session with poltergeist driver it should behave like session with javascript support all JS specs#body should return the current state of the page
     Failure/Error: @session.body.should include('I changed it')
       expected "<html xmlns=\"http://www.w3.org/1999/xhtml\" lang=\"en\"><head>\n    <meta http-equiv=\"Content-type\" content=\"text/html; charset=utf-8\">\n    <title>with_js</title>\n    <script src=\"/jquery.js\" type=\"text/javascript\" charset=\"utf-8\"></script>\n    <script src=\"/jquery-ui.js\" type=\"text/javascript\" charset=\"utf-8\"></script>\n    <script src=\"/test.js\" type=\"text/javascript\" charset=\"utf-8\"></script>\n  </head>\n  \n  <body id=\"with_js\">\n    <h1>FooBar</h1>\n    \n    <p id=\"change\">This is text</p>\n    <div id=\"drag\">\n      <p>This is a draggable element.</p>\n    </div>\n    <div id=\"drop\">\n      <p>It should be dropped here.</p>\n    </div>\n    \n    <p><a href=\"#\" id=\"clickable\">Click me</a></p>\n    \n    <p>\n      <select id=\"waiter\">\n        <option>Foo</option>\n        <option>My Waiting Option</option>\n      </select>\n    </p>\n    \n    <p>\n      <input type=\"text\" name=\"with_focus_event\" value=\"\" id=\"with_focus_event\">\n    </p>\n\n    <p>\n      <input type=\"checkbox\" id=\"checkbox_with_event\">\n    </p>\n\n    <p>\n      <input type=\"submit\" id=\"fire_ajax_request\" value=\"Fire Ajax Request\">\n    </p>\n\n    <p>\n      <a id=\"reload-link\" href=\"#\">Reload!</a>\n      </p><div id=\"reload-me\"><em>waiting to be reloaded</em></div>\n    <p></p>\n\n    <script type=\"text/javascript\">\n      // a javascript comment\n      var aVar = 123;\n    </script>\n  \n\n\n</body></html>" to include "I changed it"
       Diff:
       @@ -1,2 +1,54 @@
       -I changed it
       +<html xmlns="http://www.w3.org/1999/xhtml" lang="en"><head>
       +    <meta http-equiv="Content-type" content="text/html; charset=utf-8">
       +    <title>with_js</title>
       +    <script src="/jquery.js" type="text/javascript" charset="utf-8"></script>
       +    <script src="/jquery-ui.js" type="text/javascript" charset="utf-8"></script>
       +    <script src="/test.js" type="text/javascript" charset="utf-8"></script>
       +  </head>
       +  
       +  <body id="with_js">
       +    <h1>FooBar</h1>
       +    
       +    <p id="change">This is text</p>
       +    <div id="drag">
       +      <p>This is a draggable element.</p>
       +    </div>
       +    <div id="drop">
       +      <p>It should be dropped here.</p>
       +    </div>
       +    
       +    <p><a href="#" id="clickable">Click me</a></p>
       +    
       +    <p>
       +      <select id="waiter">
       +        <option>Foo</option>
       +        <option>My Waiting Option</option>
       +      </select>
       +    </p>
       +    
       +    <p>
       +      <input type="text" name="with_focus_event" value="" id="with_focus_event">
       +    </p>
       +
       +    <p>
       +      <input type="checkbox" id="checkbox_with_event">
       +    </p>
       +
       +    <p>
       +      <input type="submit" id="fire_ajax_request" value="Fire Ajax Request">
       +    </p>
       +
       +    <p>
       +      <a id="reload-link" href="#">Reload!</a>
       +      </p><div id="reload-me"><em>waiting to be reloaded</em></div>
       +    <p></p>
       +
       +    <script type="text/javascript">
       +      // a javascript comment
       +      var aVar = 123;
       +    </script>
       +  
       +
       +
       +</body></html>
     Shared Example Group: "session with javascript support" called from ./spec/integration/session_spec.rb:11
     # /Users/rfuentealbac/.bundler/ruby/1.9.1/capybara-2a9a968d8bed/lib/capybara/spec/session/javascript.rb:94:in `block (4 levels) in <top (required)>'

Finished in 35.12 seconds
470 examples, 14 failures

Failed examples:

rspec /Users/rfuentealbac/.bundler/ruby/1.9.1/capybara-2a9a968d8bed/lib/capybara/spec/session.rb:71 # Capybara::Session with poltergeist driver it should behave like session#reset_session! resets page body
rspec /Users/rfuentealbac/.bundler/ruby/1.9.1/capybara-2a9a968d8bed/lib/capybara/spec/session/has_text_spec.rb:56 # Capybara::Session with poltergeist driver it should behave like session it should behave like has_text#has_text? should be false if text is in the title tag in the head
rspec /Users/rfuentealbac/.bundler/ruby/1.9.1/capybara-2a9a968d8bed/lib/capybara/spec/session/has_text_spec.rb:61 # Capybara::Session with poltergeist driver it should behave like session it should behave like has_text#has_text? should be false if text is inside a script tag in the body
rspec /Users/rfuentealbac/.bundler/ruby/1.9.1/capybara-2a9a968d8bed/lib/capybara/spec/session/has_text_spec.rb:67 # Capybara::Session with poltergeist driver it should behave like session it should behave like has_text#has_text? should be false if the given text is on the page but not visible
rspec /Users/rfuentealbac/.bundler/ruby/1.9.1/capybara-2a9a968d8bed/lib/capybara/spec/session/has_text_spec.rb:122 # Capybara::Session with poltergeist driver it should behave like session it should behave like has_text#has_no_text? should be true if text is in the title tag in the head
rspec /Users/rfuentealbac/.bundler/ruby/1.9.1/capybara-2a9a968d8bed/lib/capybara/spec/session/has_text_spec.rb:127 # Capybara::Session with poltergeist driver it should behave like session it should behave like has_text#has_no_text? should be true if text is inside a script tag in the body
rspec /Users/rfuentealbac/.bundler/ruby/1.9.1/capybara-2a9a968d8bed/lib/capybara/spec/session/has_text_spec.rb:133 # Capybara::Session with poltergeist driver it should behave like session it should behave like has_text#has_no_text? should be true if the given text is on the page but not visible
rspec /Users/rfuentealbac/.bundler/ruby/1.9.1/capybara-2a9a968d8bed/lib/capybara/spec/session/has_link_spec.rb:8 # Capybara::Session with poltergeist driver it should behave like session it should behave like has_link#has_link? should be true if the given link is on the page
rspec /Users/rfuentealbac/.bundler/ruby/1.9.1/capybara-2a9a968d8bed/lib/capybara/spec/session/has_link_spec.rb:14 # Capybara::Session with poltergeist driver it should behave like session it should behave like has_link#has_link? should be false if the given link is not on the page
rspec /Users/rfuentealbac/.bundler/ruby/1.9.1/capybara-2a9a968d8bed/lib/capybara/spec/session/has_link_spec.rb:25 # Capybara::Session with poltergeist driver it should behave like session it should behave like has_link#has_no_link? should be false if the given link is on the page
rspec /Users/rfuentealbac/.bundler/ruby/1.9.1/capybara-2a9a968d8bed/lib/capybara/spec/session/has_link_spec.rb:31 # Capybara::Session with poltergeist driver it should behave like session it should behave like has_link#has_no_link? should be true if the given link is not on the page
rspec /Users/rfuentealbac/.bundler/ruby/1.9.1/capybara-2a9a968d8bed/lib/capybara/spec/session/current_url_spec.rb:66 # Capybara::Session with poltergeist driver it should behave like session it should behave like current_url#current_url, #current_path, #current_host is unaffected by posting through a relative form
rspec /Users/rfuentealbac/.bundler/ruby/1.9.1/capybara-2a9a968d8bed/lib/capybara/spec/session/current_url_spec.rb:72 # Capybara::Session with poltergeist driver it should behave like session it should behave like current_url#current_url, #current_path, #current_host is affected by posting through an absolute form
rspec /Users/rfuentealbac/.bundler/ruby/1.9.1/capybara-2a9a968d8bed/lib/capybara/spec/session/javascript.rb:92 # Capybara::Session with poltergeist driver it should behave like session with javascript support all JS specs#body should return the current state of the page
rake aborted!
ruby /usr/local/rvm/rubies/ruby-1.9.2-head/bin/ruby -S rspec ./spec/integration/driver_spec.rb ./spec/integration/session_spec.rb ./spec/unit/browser_spec.rb ./spec/unit/driver_spec.rb ./spec/unit/server_manager_spec.rb failed

Tasks: TOP => test
(See full trace by running task with --trace)
EnvyDeux:poltergeist rfuentealbac$ 

@jonleighton
Copy link
Contributor

I think possibly it's a linker problem. (See here.) Can you guys tell me if you have Qt installed on your systems?

/cc @ariya

@rb2k
Copy link

rb2k commented Jan 7, 2012

$ brew info qt
qt 4.8.0
http://qt.nokia.com/
/usr/local/Cellar/qt/4.7.3 (2562 files, 281M)
/usr/local/Cellar/qt/4.7.4 (2578 files, 285M)

We agreed to the Qt opensource license for you.
If this is unacceptable you should uninstall.

http://github.com/mxcl/homebrew/commits/master/Library/Formula/qt.rb

@jonleighton
Copy link
Contributor

Interesting. What's the output of otool -L bin/phantomjs? Thanks

@kbaum
Copy link
Author

kbaum commented Jan 7, 2012

Same here:

karl:viewthespace karl$ brew info qt
qt 4.8.0
http://qt.nokia.com/
/usr/local/Cellar/qt/4.7.3 (2564 files, 196M)
/usr/local/Cellar/qt/4.8.0 (2722 files, 200M) *

We agreed to the Qt opensource license for you.
If this is unacceptable you should uninstall.

http://github.com/mxcl/homebrew/commits/master/Library/Formula/qt.rb

@kbaum kbaum closed this as completed Jan 7, 2012
@kbaum kbaum reopened this Jan 7, 2012
@rb2k
Copy link

rb2k commented Jan 7, 2012

msmbp:~ mseeger$ otool -L /usr/local/bin/phantomjs 
/usr/local/bin/phantomjs:
msmbp:~ mseeger$ 

@kbaum
Copy link
Author

kbaum commented Jan 7, 2012

I got weird results:

karl:poltergeist karl$ otool -L phantomjs
otool: can't open file: phantomjs (No such file or directory)
karl:poltergeist karl$ which phantomjs
/usr/local/bin/phantomjs

@jonleighton
Copy link
Contributor

@kbaum I think you need to specify the full path to the binary, e.g. otool -L /usr/local/bin/phantomjs

@kbaum
Copy link
Author

kbaum commented Jan 7, 2012

Actually.. i meant to do explicit path there.. sorry:

/usr/local/bin/phantomjs:
karl:poltergeist karl$ which phantomjs
/usr/local/bin/phantomjs

```
But still strange results.
```

@ghost
Copy link

ghost commented Jan 7, 2012

I got nothing from the output of otool -L.

In fact, I used the phantomjs version which is statically linked without having qt. Oh, and I read somewhere that PhantomJS required Qt 4.8, not 4.7.

@kbaum
Copy link
Author

kbaum commented Jan 7, 2012

I think it also could be a problem with different versions of some dependencies as we are not locked at the same versions. Here is my Gemfile.lock.

https://gist.github.com/f42baa791822172a0e0c

You can drop it in and try it yourself on your own machine.

@jonleighton Can you share your Gemfile.lock?

thx!

@jonleighton
Copy link
Contributor

facepalm yes, when I bundle update capybara I do get test failures. thanks for pointing that out.

I did have poltergeist set up on travis ci previously, building against various capybara versions, but had to turn that off due to issues with qt version. I'll be setting it up again soon to prevent this in the future.

I'll fix these failures and then we can return and see whether the original problem is solved by that.

cheers

@kbaum
Copy link
Author

kbaum commented Jan 7, 2012

Cool. Not sure my problems were related but I'm glad we figured it out!

Sent from my iPhone

On Jan 7, 2012, at 5:17 PM, Jon Leightonreply@reply.github.com wrote:

facepalm yes, when I bundle update capybara I do get test failures. thanks for pointing that out.

I did have poltergeist set up on travis ci previously, building against various capybara versions, but had to turn that off due to issues with qt version. I'll be setting it up again soon to prevent this in the future.

I'll fix these failures and then we can return and see whether the original problem is solved by that.

cheers


Reply to this email directly or view it on GitHub:
#6 (comment)

@jonleighton
Copy link
Contributor

Ok, I've made some progress fixing the failures, but in any case I am pretty sure you're correct that they're unrelated.

So: is it possible for you to provide some other way for me to reproduce the issue? I.e. an example Rails app. (Alternatively, if you want to provide your actual app in provide, I'd be happy to sign an NDA or whatever in order to get access to the problem.)

Also: are you doing anything else in your app that uses threads and/or EventMachine?

@jonleighton
Copy link
Contributor

I'm pretty sure this bug was caused because you were using Thin, and it was conflicting with Poltergeist's use of EventMachine. It should be fixed by the above commit.

@kbaum
Copy link
Author

kbaum commented Jan 13, 2012

Wow.. awesome.. i'll give it a shot soon.. probably this weekend. Thx!

@kbaum
Copy link
Author

kbaum commented Jan 13, 2012

Worked!
On Jan 13, 2012, at 9:34 AM, Jon Leighton wrote:

I'm pretty sure this bug was caused because you were using Thin, and it was conflicting with Poltergeist's use of EventMachine. It should be fixed by the above commit.


Reply to this email directly or view it on GitHub:
#6 (comment)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants