35

我已经:

  • 下载了Cucumber JavaGherkin plugin
  • 我已经有the stepsfeatures目录:

我的目录结构如下所示:

- 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"})
4

1 回答 1

131

问题出Substeps IntelliJ PluginIntelliJ建议您.feature在项目中找到文件时进行安装。

在此处输入图像描述

如果您已经拥有它,请在弹出或卸载时忽略此扩展程序。

Cucumber for JavaGherkin应该足够了。

于 2017-08-31T07:13:27.720 回答