黄瓜错误得到抑制(未完全显示) [英] Cucumber errors suppressed (not displayed fully)

查看:89
本文介绍了黄瓜错误得到抑制(未完全显示)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚安装了黄瓜,并对其进行了测试。我收到以下错误:

I just installed cucumber, and I tested it. I got the following error:

teefcomp:cucumber-intro teef$ cucumber features/manage_users.feature
Using the default profile...
F----F

Failing Scenarios:
cucumber features/manage_users.feature:6 # Scenario: User List

1 scenario (1 failed)
4 steps (4 skipped)
0m0.029s

似乎正在抑制该错误。我期望像这样的东西:

It seems to be suppressing the error. I was expecting something like:

Feature: Manage users
  In order to understand my user base better
  As an administrator
  I want to view a list of users

  Scenario: User List
    Given I have users named George, Mary
      uninitialized constant User (NameError)
      ./features/step_definitions/user_steps.rb:3
      ./features/step_definitions/user_steps.rb:2:in '/^I have users named (.*)$/'
      features/manage_users.feature:7:in 'Given I have users named George, Mary'

任何人都知道如何要让黄瓜完全显示错误?

Anyone know how to get cucumber to display the errors in full?

-backtrace -详细 -b -trace 不起作用;我仍然看到 F ---- F ,并且列出了失败的情况,但是我仍然希望在 NameError行上有类似的描述。这是旧版黄瓜的功能吗? (我正在使用截屏广播开始使用黄瓜。)

--backtrace, --verbose, -b and --trace do not work; I still see F----F and the failing scenario is listed, but I still expect something like description on the "NameError" line. Is this a feature of an older version of cucumber? (I'm using screencasts to start using cucumber.)

推荐答案

运行 -b 标志应为您提供完整的回溯

running with the -b flag should give you a full backtrace

cucumber features/manage_users.feature -b

编辑:

此外,您可以使用-backtrace 。如果通过rake运行,请使用-trace 标志

Additionally, you can use the full notation of --backtrace. If you are running via rake, run with the --trace flag

运行以获取完整的输出,可以使用-format 标志。我通常使用-格式漂亮逐行浏览。

to get full output, you can use the --format flag. I generally use --format pretty to get a line-by-line walk through.

-help 输出。

-f, --format FORMAT              How to format features (Default: pretty). Available formats:
                                   debug       : For developing formatters - prints the calls made to the listeners.
                                   html        : Generates a nice looking HTML report.
                                   json        : Prints the feature as JSON
                                   json_pretty : Prints the feature as pretty JSON
                                   junit       : Generates a report similar to Ant+JUnit.
                                   pdf         : Generates a PDF report. You need to have the
                                                 prawn gem installed. Will pick up logo from
                                                 features/support/logo.png or
                                                 features/support/logo.jpg if present.
                                   pretty      : Prints the feature as is - in colours.
                                   progress    : Prints one character per scenario.
                                   rerun       : Prints failing files with line numbers.
                                   stepdefs    : Prints All step definitions with their locations. Same as
                                                 the usage formatter, except that steps are not printed.
                                   tag_cloud   : Prints a tag cloud of tag usage.
                                   usage       : Prints where step definitions are used.
                                                 The slowest step definitions (with duration) are
                                                 listed first. If --dry-run is used the duration
                                                 is not shown, and step definitions are sorted by
                                                 filename instead.
                                 Use --format rerun --out features.txt to write out failing
                                 features. You can rerun them with cucumber @rerun.txt.
                                 FORMAT can also be the fully qualified class name of
                                 your own custom formatter. If the class isn't loaded,
                                 Cucumber will attempt to require a file with a relative
                                 file name that is the underscore name of the class name.
                                 Example: --format Foo::BarZap -> Cucumber will look for
                                 foo/bar_zap.rb. You can place the file with this relative
                                 path underneath your features/support directory or anywhere
                                 on Ruby's LOAD_PATH, for example in a Ruby gem.

这篇关于黄瓜错误得到抑制(未完全显示)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆