【问题标题】:Dynamic feature file passing in cucumber传入黄瓜的动态特征文件
【发布时间】:2017-05-24 18:43:01
【问题描述】:

我想在 Cucumber 注释下方的“功能”字段中动态传递功能文件名

@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 特征文件

【问题讨论】:

  • 你能提供一些关于这个上下文的配置或代码吗?

标签: cucumber gherkin


【解决方案1】:

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

运行特定的功能文件

> cucumber feature_file_name.feature

运行特定场景

黄瓜 feature_file_name.feature:(场景的行号)

> cucumber feature_file_name.feature:10

在项目中运行整个功能文件

> cucumber

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2016-12-23
    • 2016-06-04
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-03-01
    • 1970-01-01
    • 2018-07-25
    相关资源
    最近更新 更多