如何通过命令行 运行 cucumber tags/step defs?
How to run cucumber tags/step defs via command line?
我需要通过命令行运行特定场景!带标签!我该怎么做?
你可以借助标签来实现。为该特定场景定义标签,然后可以 运行.
EX:
gradle --daemon -D"cucumber.filter.tags=@testscenario1" build --info
您可以 运行 通过在功能文件中指定方案的行号来从功能中提取单个方案,例如
cucumber path/to/feature/foo.feature#xx
其中 xx 是场景中的行号。
您可以通过 运行ning cucumber --help
从命令提示符获得有关 运行ning cucumber 的帮助
如果您使用的是 java,情况可能会有所不同,具体取决于您 运行 黄瓜的使用方式。也许 mvn test -Dcucumber.options=”feature file path” + “line number of the scenario”
可能有效(来自谷歌搜索 run cucumber java from command line
和第一个结果 https://www.toolsqa.com/selenium-cucumber-framework/run-cucumber-test-from-command-line-terminal/)
注意:我不使用java所以我的部分回答可能用处不大
已添加到 build.gradle
插件
id "se.thinkcode.cucumber-runner" version "0.0.8"
配置
cucumberRuntime {
extendsFrom testImplementation
}
任务
cucumber {
glue = 'classpath:com.ingenico.component.tests.cucumber'
main = 'io.cucumber.core.cli.Main'
featurePath = 'src/test/resources/features'
}
命令
gradle cucumber --tags @tag
中得到了这个代码
我需要通过命令行运行特定场景!带标签!我该怎么做?
你可以借助标签来实现。为该特定场景定义标签,然后可以 运行.
EX:
gradle --daemon -D"cucumber.filter.tags=@testscenario1" build --info
您可以 运行 通过在功能文件中指定方案的行号来从功能中提取单个方案,例如
cucumber path/to/feature/foo.feature#xx
其中 xx 是场景中的行号。
您可以通过 运行ning cucumber --help
如果您使用的是 java,情况可能会有所不同,具体取决于您 运行 黄瓜的使用方式。也许 mvn test -Dcucumber.options=”feature file path” + “line number of the scenario”
可能有效(来自谷歌搜索 run cucumber java from command line
和第一个结果 https://www.toolsqa.com/selenium-cucumber-framework/run-cucumber-test-from-command-line-terminal/)
注意:我不使用java所以我的部分回答可能用处不大
已添加到 build.gradle
插件
id "se.thinkcode.cucumber-runner" version "0.0.8"
配置
cucumberRuntime {
extendsFrom testImplementation
}
任务
cucumber {
glue = 'classpath:com.ingenico.component.tests.cucumber'
main = 'io.cucumber.core.cli.Main'
featurePath = 'src/test/resources/features'
}
命令
gradle cucumber --tags @tag
中得到了这个代码