如何在@CucumberOptions 中为 HTML 报告传递动态文件夹名称
How to pass dynamic folder name for HTML reports in @CucumberOptions
Currenlty,我正在通过 Runner class 中的 CucumberOptions 传递 HTML 报告生成路径。然而,每个 运行 旧报告都会被覆盖。有没有办法通过每个 运行 或内置黄瓜选项传递新文件夹名称,为每个 运行 生成新文件夹名称?
这是我的代码:
@CucumberOptions( features = "src/test/resources/features",
glue="com.bnymellon.sse.ui.step_definitions", tags = {"@demo"},
monochrome = true, plugin = {"html:output/HTML_Reports/"} )
有 three way 可以覆盖 Cucumber 选项。
- cucumber.options="..." 通过 -Dcucumber.options="..." 传递给 JVM。
- 环境变量 CUCUMBER_OPTIONS="...".
- CLASSPATH 上的黄瓜-jvm.properties cucumber.options="..." 属性.
有一个警告;你不能覆盖,只能添加一个插件。因此,您需要从 @CucumberOptions 中删除 html 插件,并使用上面列出的 3 种方法之一指定 html 插件。
如果你只是想避免为每个 运行 编辑你的 运行ner class 那么我会把 html 插件移动到:
-Dcucumber.options="--plugin html:output/HTML_Reports"
在您的 运行 用户的 VM 参数框中。然后,您可以在每个 运行 之前编辑 VM 参数,从而避免触发 git。我经常以这种方式覆盖标签参数。
Currenlty,我正在通过 Runner class 中的 CucumberOptions 传递 HTML 报告生成路径。然而,每个 运行 旧报告都会被覆盖。有没有办法通过每个 运行 或内置黄瓜选项传递新文件夹名称,为每个 运行 生成新文件夹名称?
这是我的代码:
@CucumberOptions( features = "src/test/resources/features", glue="com.bnymellon.sse.ui.step_definitions", tags = {"@demo"}, monochrome = true, plugin = {"html:output/HTML_Reports/"} )
有 three way 可以覆盖 Cucumber 选项。
- cucumber.options="..." 通过 -Dcucumber.options="..." 传递给 JVM。
- 环境变量 CUCUMBER_OPTIONS="...".
- CLASSPATH 上的黄瓜-jvm.properties cucumber.options="..." 属性.
有一个警告;你不能覆盖,只能添加一个插件。因此,您需要从 @CucumberOptions 中删除 html 插件,并使用上面列出的 3 种方法之一指定 html 插件。
如果你只是想避免为每个 运行 编辑你的 运行ner class 那么我会把 html 插件移动到:
-Dcucumber.options="--plugin html:output/HTML_Reports"
在您的 运行 用户的 VM 参数框中。然后,您可以在每个 运行 之前编辑 VM 参数,从而避免触发 git。我经常以这种方式覆盖标签参数。