如何在 jenkins 中执行之前将黄瓜标签作为参数传递并在测试运行程序文件中更新?

vis*_*bha 3 parameters cucumber test-runner jenkins

我是 Jenkins 的新手,想要从 jenkins 传递像黄瓜标签这样的参数,它应该在测试运行程序文件中动态更新,然后应该开始执行。请分享我的代码或屏幕截图。

mpk*_*nje 5

除了 UnknownBeast 之外,在 Cucumber v6 及更高版本中,您不能再使用cucumber.options像字符串这样的命令行。相反,您必须使用单独的属性。

mvn test -Dcucumber.filter.tags="(@cucumber or @gherkin) and not @salad"
Run Code Online (Sandbox Code Playgroud)

支持的属性有:

cucumber.ansi-colors.disabled=  # true or false. default: false                     
cucumber.execution.dry-run=     # true or false. default: false 
cucumber.execution.limit=       # number of scenarios to execute (CLI only).  
cucumber.execution.order=       # lexical, reverse, random or random:[seed] (CLI only). default: lexical
cucumber.execution.strict=      # true or false. default: false.
cucumber.execution.wip=         # true or false. default: false.
cucumber.features=              # command separated paths to feature files. example: path/to/example.feature, path/to/other.feature  
cucumber.filter.name=           # regex. example: .*Hello.*
cucumber.filter.tags=           # tag expression. example: @smoke and not @slow 
cucumber.glue=                  # comma separated package names. example: com.example.glue  
cucumber.plugin=                # comma separated plugin strings. example: pretty, json:path/to/report.json
cucumber.object-factory=        # object factory class name. example: com.example.MyObjectFactory
cucumber.snippet-type=          # underscore or camelcase. default: underscore
Run Code Online (Sandbox Code Playgroud)

来自 https://github.com/cucumber/cucumber-jvm/tree/master/core#properties-environment-variables-system-options