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
config.action_dispatch.show_exceptions = true
b
flag (but it's only showing the detailed trace for the Capybara errorHow can I get the full backtrace on the server side ?
EDIT
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
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With