动态特征文件传入黄瓜

时间:2016-01-08 12:51:03

标签: cucumber gherkin

我想在Cucumber

下面的注释中的'Features'字段中动态传递Feature File名称
@CucumberOptions(
  dryRun = false,
  strict = true,
  features = {
    "src/com/Proj/Feature/Dashboard.feature"
  },
  glue = "com/Proj/StepDefinition",
  tags = {},
  monochrome = true,
  plugin = { 
    "pretty",
    "html:target/site/cucumber-pretty",
    "json:target/cucumber.json" 
  }
)

目前在运行之前我们必须传递功能文件,不想硬编码Dashboard.feature功能文件

1 个答案:

答案 0 :(得分:1)

默认情况下,您只会在运行时传递.feature文件。

运行特定功能文件

> cucumber feature_file_name.feature

运行特定方案

  

cucumber feature_file_name.feature :(方案行号)

> cucumber feature_file_name.feature:10

在项目中运行整个要素文件

> cucumber