我想知道一些事情,当背景失败时,黄瓜会返回退出代码 0(据我所知,这意味着“好的”)。
现在失败的步骤可能不应该在后台(我猜充其量是在“之前”的钩子中??)。但是有人知道它返回这个退出代码的原理是什么吗?它是错误还是功能?
附录:一个更具体的例子:假设这段代码通过了:
Feature: Figuring out how Cucumber works
As a developer
I want to find out why cuccies fail, but my build doesnt
In order to have more confidence in my build
Background: logging in into the system
Given I am logged in
Scenario: creating a new test set
When I do something
Then I should see "you've done something"
它返回退出代码 0。让它失败:
Background: logging in into the system
Given I am logged in
Scenario: creating a new test set
Then I should see "there's no way you see this"
When I do something
Then I should see "you've done something"
输出显示一个失败的步骤,并返回退出代码 1 当我将失败的步骤移动到后台时:
Background: logging in into the system
Given I am logged in
Then I should see "there's no way you see this"
Scenario: creating a new test set
When I do something
Then I should see "you've done something"
输出仍然显示它失败,但它返回退出代码 0