当我添加扩展黄瓜依赖时,步骤定义没有执行,当我删除扩展黄瓜依赖时,它工作正常并执行步骤定义。
以下是我正在使用的Maven依赖项。
<dependency>
<groupId>com.github.mkolisnyk</groupId>
<artifactId>cucumber-reports</artifactId>
<version>1.0.5</version>
</dependency>
/ *此部分代码不执行步骤定义* /
import org.junit.runner.RunWith;
import com.github.mkolisnyk.cucumber.runner.ExtendedCucumber;
import com.github.mkolisnyk.cucumber.runner.ExtendedCucumberOptions;
import cucumber.api.CucumberOptions;
@RunWith(ExtendedCucumber.class)
@ExtendedCucumberOptions(jsonReport = "target/cucumber.json",
overviewReport = true,
outputFolder = "target")
@CucumberOptions(features = {"./src/test/resources/features"}, plugin = { "html:target/cucumber-html-report",
"json:target/cucumber.json", "pretty:target/cucumber-pretty.txt",
"usage:target/cucumber-usage.json", "junit:target/cucumber-results.xml" },
glue = { "com/test/stepdefinition" },
monochrome = true)
public class RunCucumberTest {
}
/ *这样可以正常工作并执行步骤定义* /
import org.junit.runner.RunWith;
import cucumber.api.CucumberOptions;
import cucumber.api.junit.Cucumber;
@RunWith(Cucumber.class)
@CucumberOptions(features = { "./src/test/resources/features" }, plugin = { "html:target/cucumber-html-report",
"json:target/cucumber.json", "pretty:target/cucumber-pretty.txt", "usage:target/cucumber-usage.json",
"junit:target/cucumber-results.xml" }, glue = {
"com/test/stepdefinition" }, monochrome = true)
public class RunCucumberTest {
}
我不确定为什么会这样,我在这里错过了什么?
答案 0 :(得分:0)
将所有黄瓜依赖项更新为1.2.5,即可正常工作