我已经:
- 下载了
Cucumber Java
,Gherkin plugin
- 我已经有
the steps
和features
目录:
我的目录结构如下所示:
- test
- java
- features
- featureSet1
- oneFeature.feature
- anotherFeature.feature
- featuresSet2
- twoFeature.feature
- CucumberTests.java
- steps
- step1.java
- step2.java
在 features 文件夹下,我有一个名为CucumberTests.java
. 我可以通过运行测试,mvn test
但红色的错误标记真的让我很恼火。
我有这些标签CucumberTest.java
,应该运行测试:
@RunWith(Cucumber.class)
@CucumberOptions(plugin = { "pretty", "html:target/surefire-
reports/cucumber", "json:target/surefire-
reports/cucumberOriginal.json"},
features = {"src/test/java/features/featuresSet1",
"src/test/java/features/featuresSet2",
},
tags = {"~@ignore"},
glue = {"steps"})