page.driver.error_messages exception for console.log #416

Closed
betelgeuse opened this Issue Nov 18, 2012 · 1 comment

Comments

Projects
None yet
2 participants
Contributor

betelgeuse commented Nov 18, 2012

I put the following to features/support/

After do |scenario|
  if Capybara.current_driver == :webkit && scenario.failed?
    p page.driver.error_messages
  end
end

I have this in a js template responding to a ajax request:

console.log('ajax response');

This gives me the following exception to console:

      invalid value for Integer(): "ajax response" (ArgumentError)
      /Users/betelgeuse/.rvm/gems/ruby-1.9.3-p286/gems/capybara-webkit-0.13.0/lib/capybara/webkit/browser.rb:48:in `Integer'
      /Users/betelgeuse/.rvm/gems/ruby-1.9.3-p286/gems/capybara-webkit-0.13.0/lib/capybara/webkit/browser.rb:48:in `block in console_messages'
      /Users/betelgeuse/.rvm/gems/ruby-1.9.3-p286/gems/capybara-webkit-0.13.0/lib/capybara/webkit/browser.rb:46:in `map'
      /Users/betelgeuse/.rvm/gems/ruby-1.9.3-p286/gems/capybara-webkit-0.13.0/lib/capybara/webkit/browser.rb:46:in `console_messages'
      /Users/betelgeuse/.rvm/gems/ruby-1.9.3-p286/gems/capybara-webkit-0.13.0/lib/capybara/webkit/browser.rb:53:in `error_messages'
      /Users/betelgeuse/.rvm/gems/ruby-1.9.3-p286/gems/capybara-webkit-0.13.0/lib/capybara/webkit/driver.rb:68:in `error_messages'
      /Users/betelgeuse/app/features/support/javascript_errors.rb:3:in `After'

@mhoran mhoran closed this in 08abca4 Nov 22, 2012

Collaborator

mhoran commented Nov 22, 2012

Just pushed a fix for this to master. Let me know if it works for you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment