2017-04-18 85 views
0

我有一個場景大綱。我想跳過某些特定場景的某些步驟。我使用了Cucumber.wants_to_quit,但它似乎不起作用。無論如何,在這種方法之後提到的步驟都適用於所有情況。 我使用紅寶石,硒,黃瓜。如何讓黃瓜退出場景?

回答

0

這裏是如何創建一個功能,可以讓你跳過一個例子Directly from the Docs

給定一個名爲「功能/ test.feature」

Feature: test 
    Scenario: test 
    Given this step says to skip 
    And this step passes 

文件中使用標準分級defintions與文件如 「功能/ step_definitions/skippy.rb」 有:

Given /skip/ do 
    skip_this_scenario 
end 

如果您運行cucmber -q 那麼前面的回函ld通過:

Feature: test 

    Scenario: test 
    Given this step says to skip 
    And this step passes 

1 scenario (1 skipped) 
2 steps (2 skipped) 
0m0.012s