我有下一个项目结构:
src/
|
| --main/
| --java/
| --cucumber/
| --CucumberRunner
| --features
| --MyFeatures.feature
| --StepDefinitions.java
我的跑步者:
@RunWith(Cucumber.class)
@CucumberOptions(
format ={"pretty", "json:target/cucumber.json"},
features = {"src/main/java"}
)
public class CucumberRunner {
}
我知道路径不正确但我尝试了所有可能的组合 - 结果是一样的((( 我的特色:
Feature: Testing my simple kickstarter project
Scenario: My first test
Given I navigate to Categories page
When When I enter 'f'
Then Error is displayed
我的步骤:
public class StepDefinitions {
@Given("^I navigate to Categories page$")
public void i_navigate_to_Categories_page() throws Throwable {
// Write code here that turns the phrase above into concrete actions
throw new PendingException();
}
@When("^When I enter 'f'$")
public void when_I_enter_f() throws Throwable {
// Write code here that turns the phrase above into concrete actions
throw new PendingException();
}
@Then("^Error is displayed$")
public void error_is_displayed() throws Throwable {
// Write code here that turns the phrase above into concrete actions
throw new PendingException();
}
}
问题是功能文件无法查看其步骤((
Test ignored.
Test ignored.
Test ignored.
Test ignored.
Test ignored.
Test ignored.Feature: Testing my simple kickstarter project
Scenario: My first test # features/myFeatures.feature:3
Given I navigate to Categories page
When When I enter 'f'
Then Error is displayed
1 Scenarios (1 undefined)
3 Steps (3 undefined)
0m0.000s
You can implement missing steps with the snippets below:
....
可能是什么问题?
答案 0 :(得分:0)
有时,IDE集成无法识别步骤类的更改。
检查您是否编译了测试代码 - 例如mvn test-compile或mvn verify。