9
votes

For some reason one of my cucumber tests seem to fail both on the poltergeist driver and from the rails server.

I am getting a full trace on the browser crash but almost nothing on the server side.

When I open the Capybara screenshot I just see

Internal Server Error undefined method name for nil:NilClass

When I tail the test.log

Completed 500 Internal Server Error in 0ms (Elasticsearch: 0.0ms)

(And no trace)

I have tried

  • to set config.action_dispatch.show_exceptions = true
  • the b flag (but it's only showing the detailed trace for the Capybara error
  • (my config level is set to :debug already in my environment file)

How can I get the full backtrace on the server side ?

EDIT

  • Capybara 2.13.0
  • Rails 5.0.2
  • everything commented in backtrace_silencers
2
Just a few random thoughts: try removing Rails silencers (see config/initializers/backtrace_silencers.rb) or perhaps this might be some log flushing issue? What Rails version are we talking about?Matouš Borák

2 Answers

1
votes

I got something from this answer !

So the solution was to allow rescuing the exception in ActionController::Base. In my env file I had the following lines that were misleading

# There are two ways to allow Rails to rescue exceptions:
#
# 1) Tag your scenario (or feature) with @allow-rescue
#
# 2) Set the value below to true. Beware that doing this globally is not
# recommended as it will mask a lot of errors for you!
#
ActionController::Base.allow_rescue = false

And by adding the @allow-rescue tag I got more comprehensive error trace showing in my test.log, along with a frontend error view

1
votes

If you (like me) do not use Cucumber but Capybara this answer might help you, too.

In config/environments/test.rb set

config.action_dispatch.show_exceptions = true