Capybara服务器和浏览器错误,服务器上没有跟踪

Cyr*_*ris 9 ruby-on-rails capybara ruby-on-rails-5

出于某种原因,我的一个黄瓜测试似乎在恶作剧驱动程序和rails服务器上都失败了.

我对浏览器崩溃进行了全面跟踪,但在服务器端几乎没有任何内容.

当我打开Capybara截图时,我看到了

内部服务器错误namenil的未定义方法:NilClass

当我拖尾test.log

在0ms内完成500内部服务器错误(Elasticsearch:0.0ms)

(并没有痕迹)

我试过了

  • 设置 config.action_dispatch.show_exceptions = true
  • b标志(但它只是显示了水豚错误详细跟踪
  • (我的配置级别设置为:我的环境文件中已经调试)

如何在服务器端获得完整的回溯?

编辑

  • Capybara 2.13.0
  • Rails 5.0.2
  • 所有在backtrace_silencers中评论的内容

Cyr*_*ris 1

我从这个答案中得到了一些东西!

所以解决方案是允许在 ActionController::Base 中拯救异常。在我的 env 文件中,以下几行具有误导性

# 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
Run Code Online (Sandbox Code Playgroud)

通过添加 @allow-rescue 标签,我在我的 中显示了更全面的错误跟踪test.log以及前端错误视图