Cyr*_*ris 9 ruby-on-rails capybara ruby-on-rails-5
出于某种原因,我的一个黄瓜测试似乎在恶作剧驱动程序和rails服务器上都失败了.
我对浏览器崩溃进行了全面跟踪,但在服务器端几乎没有任何内容.
当我打开Capybara截图时,我看到了
内部服务器错误
name
nil的未定义方法:NilClass
当我拖尾test.log
在0ms内完成500内部服务器错误(Elasticsearch:0.0ms)
(并没有痕迹)
我试过了
config.action_dispatch.show_exceptions = true
b
标志(但它只是显示了水豚错误详细跟踪如何在服务器端获得完整的回溯?
编辑
我从这个答案中得到了一些东西!
所以解决方案是允许在 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
以及前端错误视图
归档时间: |
|
查看次数: |
508 次 |
最近记录: |