在日志中看不到黄瓜片段
Cannot see cucumber snippets on logs
我刚刚启动了一个 2.1.6 版的 sping-boot 项目(使用启动器:spring-boot-starter-web,spring-boot-starter-test)
并且我正在尝试在版本 4.7.1 中将黄瓜用于 java,并具有以下 Maven 依赖项:cucumber-spring、cucumber-junit、cucumber-java8。
当我启动我的验收测试时,我看到日志中某个步骤未定义。但是没有出现片段
所有验收测试
@RunWith(Cucumber.class)
@CucumberOptions(plugin = {"pretty", "html:FeaturesReport"},
features = {"src/test/resources/features"},
snippets = CucumberOptions.SnippetType.UNDERSCORE)
public class AllAcceptanceTests {
}
我的场景
Scenario: Creation from initialisation
Given name "Jean"
Given gender "Male"
Given picture "picture.png"
Given account identifier 1
When try to create the profile with these parameters
Then the profile id = 1 , name = "Jean" , gender = "Male" and picture = "picture.png" is saved
Junit日志
Scenario: Creation from initialisation # src/test/resources/features/create-profile.feature:9
Given name "Jean" # ProfileSteps.java:23
Given gender "Male" # ProfileSteps.java:27
Given picture "picture.png" # ProfileSteps.java:31
Given account identifier 1 # null
When try to create the profile with these parameters # ProfileSteps.java:37
Then the profile id = 1 , name = "Jean" , gender = "Male" and picture = "picture.png" is saved # ProfileSteps.java:46
io.cucumber.junit.UndefinedThrowable: The step "existing account in nisfee-account :" is undefined
我正在使用所有 spring-boot 默认配置。我是不是忘记了一些东西,因为我的日志中有这样的东西:
You can implement missing steps with the snippets below:
@Given("^today is Sunday$")
public void today_is_Sunday() {
// Write code here that turns the phrase above into concrete actions
throw new PendingException();
}
如果您 运行 通过 JUnit 而不是 CLI 或 IDEA,则必须显式添加 summary
插件。
@CucumberOptions(plugin = {"summary", "pretty", "html:FeaturesReport"},
我刚刚启动了一个 2.1.6 版的 sping-boot 项目(使用启动器:spring-boot-starter-web,spring-boot-starter-test)
并且我正在尝试在版本 4.7.1 中将黄瓜用于 java,并具有以下 Maven 依赖项:cucumber-spring、cucumber-junit、cucumber-java8。
当我启动我的验收测试时,我看到日志中某个步骤未定义。但是没有出现片段
所有验收测试
@RunWith(Cucumber.class)
@CucumberOptions(plugin = {"pretty", "html:FeaturesReport"},
features = {"src/test/resources/features"},
snippets = CucumberOptions.SnippetType.UNDERSCORE)
public class AllAcceptanceTests {
}
我的场景
Scenario: Creation from initialisation
Given name "Jean"
Given gender "Male"
Given picture "picture.png"
Given account identifier 1
When try to create the profile with these parameters
Then the profile id = 1 , name = "Jean" , gender = "Male" and picture = "picture.png" is saved
Junit日志
Scenario: Creation from initialisation # src/test/resources/features/create-profile.feature:9
Given name "Jean" # ProfileSteps.java:23
Given gender "Male" # ProfileSteps.java:27
Given picture "picture.png" # ProfileSteps.java:31
Given account identifier 1 # null
When try to create the profile with these parameters # ProfileSteps.java:37
Then the profile id = 1 , name = "Jean" , gender = "Male" and picture = "picture.png" is saved # ProfileSteps.java:46
io.cucumber.junit.UndefinedThrowable: The step "existing account in nisfee-account :" is undefined
我正在使用所有 spring-boot 默认配置。我是不是忘记了一些东西,因为我的日志中有这样的东西:
You can implement missing steps with the snippets below:
@Given("^today is Sunday$")
public void today_is_Sunday() {
// Write code here that turns the phrase above into concrete actions
throw new PendingException();
}
如果您 运行 通过 JUnit 而不是 CLI 或 IDEA,则必须显式添加 summary
插件。
@CucumberOptions(plugin = {"summary", "pretty", "html:FeaturesReport"},