爪哇 - 黃瓜例如JUnit的黃瓜缺少的步驟錯誤
貌似我缺少的步驟,它抱怨缺少的步驟和考慮它們爲未定義
.feature文件:
Feature: Roman Feature
Scenario: Convert Integer to Roman Number
Given I am on the demo page
When I pass number 1
Then the roman result is I
Scenario: Convert Integer to Roman Number
Given I am on the demo page
When I pass number 5
Then the roman result is V
步驟文件:
@When("^I pass number (\\d+)$")
public void convert_numbers_to_roman(int arg1) throws Throwable {
// convert number
}
@Then("^the roman result is (\\d+)$")
public void the_roman_result_is(int result) throws Throwable {
// match result
}
當我運行測試
種Scenario: Convert Integer to Roman Number [90m# net/xeric/demos/roman.feature:3[0m
[32mGiven [0m[32mI am on the demo page[0m [90m# DemoSteps.i_am_on_the_demo_page()[0m
[32mWhen [0m[32mI pass number [0m[32m[1m1[0m [90m# DemoSteps.convert_numbers_to_roman(int)[0m
[33mThen [0m[33mthe roman result is I[0m
6情景2未定義 您可以實現失蹤與下面的代碼片段步驟:
@Then("^the roman result is I$")
public void the_roman_result_is_I() throws Throwable {
// Write code here that turns the phrase above into concrete actions
throw new PendingException();
}
當問題中沒有顏色控制檯格式時,很感激。在你的配置中使用'monochrome = true'。 –