[英]cucumber: how to run specific scenario from a feature file
我在功能文件中列出了多个方案,并且我只需要运行一个失败的方案(出于调试目的)。
我在场景之前提到过@tag,但是在Test Runner文件中时,给定此标记,它将运行整个功能文件。 请帮助我正确放置它。
测试亚军文件-
tags={"@Islamic_User_check"},
如果要使用黄瓜运行特定方案,则需要提供方案开始的行号,例如:
cucumber features/test.feature:7
如果您使用@功能,则应指向仍然提供行号的txt文件。
资料来源: https : //www.relishapp.com/cucumber/cucumber/docs/cli/run-specific-scenarios
希望这可以帮助
更新:现在有一个标签选项
cucumber --tags @tagname
在行家中:
mvn test -Dcucumber.options="--tags @tagname"
(并且在Windows powershell中使用反引号转义-D)
mvn test `-Dcucumber.options="--tags @tagname"
使用--name REGEXP
命令行参数仅运行与正则表达式REGEXP匹配的方案:
cucumber --name "Islamic_User_check"
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.