Reputation: 628
In using capybara and selenium to run integration tests in rails, if an exception is raised a blank white page is shown instead of the usual exception screen with the stack trace. Is there a way to get capybara to show the stack trace pages?
Upvotes: 6
Views: 4955
Reputation: 3072
Matt's solution didn't work for me, but precisely this gist https://gist.github.com/1443408 did.
https://github.com/thoughtbot/capybara-webkit/issues/226 explains in more detail why it happens and provides explanation on what given gist does.
Upvotes: 5
Reputation: 146
I was not able to get the stack traces to show with Webrick or Thin, but my eventual workaround was to use Mongrel, which properly prints the stack traces to stderr.
With capybara 0.4.1.2 or later, you can configure capybara to use mongrel like so:
Capybara.server do |app, port|
require 'rack/handler/mongrel'
Rack::Handler::Mongrel.run(app, :Port => port)
end
Upvotes: 5
Reputation: 19840
this is most likely because the stack trace is only shown in the development execution mode (or 'environment'), and your integration tests are run within the production environment.
Of course, by tweaking the production mode settings, you may be able to make it show the exception. But it would not be the correct way. The best way is to :
Hope this helps. Best regards.
Upvotes: -2