【问题标题】:How to run multiple cucumber features?如何运行多个黄瓜功能?
【发布时间】:2017-07-14 02:11:17
【问题描述】:

我有一个这样的运行测试类。

@RunWith(Cucumber.class)
@CucumberOptions(
        features = {"src/test/resources/features"},
        glue = {"classpath:com.wirecard.step"},
        format = {"pretty", "html:target/cucumber-report", "json:target/cucumber.json"},
        tags = {"@Login_Flow", "@Merch_Creation", "@Add_Terminal", "@MERCHBATCH_UPLOAD"}
)
public class AsortStdTests {

}

我在 src/test/resources/features 下有 4 个黄瓜功能文件。当我尝试运行这个测试(4 个黄瓜功能)时,我得到了错误:

None of the features at [src/test/resources/features] matched the filters: [@Login_Flow, @Merch_Creation, @Add_Terminal, @MERCHBATCH_UPLOAD]
0 Scenarios
0 Steps
0m0.000s


Process finished with exit code 0
Empty test suite.

我尝试为 Cucumber 选项提供完整路径,但效果不佳。任何人都可以帮助我吗?谢谢。

【问题讨论】:

    标签: java selenium cucumber


    【解决方案1】:

    cucumberoptions 中的 tag 值不正确,当前设置为使用所有提到的 tag 拾取场景。您使用的是 AND 而不是 OR。

    您可以完全省略标签选项。

    或者您可以将其用于标签选项 --- tags = {"@Login_Flow, @Merch_Creation, @Add_Terminal, @MERCHBATCH_UPLOAD"}

    【讨论】:

      猜你喜欢
      • 2011-03-04
      • 2017-05-14
      • 2019-01-29
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多