简体   繁体   English

黄瓜特征输出中的蓝色破折号是否总是意味着跳过?

[英]Do the blue dashes in cucumber features output always mean skipped?

I've understood that blue dashes in features output means the step was skipped because something before it failed but in all of my scenario outlines I get blue dashes but also a line that says all passed. 我已经明白功能输出中的蓝色短划线意味着跳过了一步,因为它失败了,但在我的所有场景概述中,我得到蓝色破折号,但也有一条说明全部通过的行。

Here is my Scenario Outline. 这是我的场景大纲。

Scenario Outline: Attempt to assign a role when not authorized
  Given a <user_who_can_not_assign_roles> exists with email: "johndoe@example.com"
  And that user is signed in
  And I am on the user's show page
  And a role exists with name: "<other_role1>"
  And a role exists with name: "<other_role2>"
  When I follow "Edit"
  Then I should not see "Admin"
  And I should not see "Manager"
  And I should not see "Salesperson"
  When I fill in "username" with "spuds"
  And I fill in "password" with "potatoes"
  And I fill in "password confirmation" with "potatoes"
  And I fill in "email" with "spuds@gmail.com"
  And I press "Save"
  Then I should see "success"
  And a role should exist with name: "<other_role1>"
  And that role should not be one of the user's roles
  And a role should exist with name: "<other_role2>"
  And that role should not be one of the user's roles

  Examples:
    | user_who_can_not_assign_roles | other_role1 | other_role2 |
    | manager                       | Admin       | Salesperson |
    | salesperson                   | Admin       | Manager     |

When I run this feature I get this output. 当我运行此功能时,我得到了这个输出。

-------------------...... -------------------......

2 scenarios (2 passed) 2个场景(2个通过)
38 steps (38 passed) 38步(38通过)
0m3.300s 0m3.300s

I get that its 2 scenarios because I have 2 examples listed and 38 steps would be the 19 run twice. 我得到了它的2个场景,因为我列出了2个例子,38个步骤将是19个两次运行。 What I don't understand is why it shows the blue dashes (like it normally shows for skipped steps) when it also says 38 steps passed. 我不明白的是为什么它显示了蓝色破折号(就像通常显示的跳过步骤一样),当它还说38步已通过时。

I would assume that this is intended when running outlines because if I change on of the steps marked with a blue dash it will show failed. 我认为这是在运行大纲时的意图,因为如果我改变标有蓝色短划线的步骤,它将显示失败。 I was just looking for some confirmation in the cucumber docs and I can't find anything. 我只是在黄瓜文档中寻找一些确认,我找不到任何东西。

I'm running rails 3.0.0, cucumber 0.9.3, and pickle 0.4.2. 我正在运行rails 3.0.0,黄瓜0.9.3和pickle 0.4.2。

The blue dashes in this case represent the parsing of the scenario outline, which is more metadata than test. 在这种情况下,蓝色破折号表示场景大纲的解析,这是比测试更多的元数据。 I find it confusing as well. 我发现它也令人困惑。 To get a better idea of what is going on, try executing: 为了更好地了解正在发生的事情,请尝试执行:

cucumber -f pretty <your_fancy_scenario.feature>

This will force cucumber to display the actual scenario text with the color coding, instead of just the dots and dashes. 这将迫使黄瓜用颜色编码显示实际的场景文本,而不仅仅是点和短划线。

Hope that helps! 希望有所帮助!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM