【发布时间】:2018-05-25 02:37:06
【问题描述】:
这是我的问题。 我在功能级别上有一个@env 标签来识别要在哪个环境上运行,在场景级别上有一个@current 标签来识别要运行的环境。
功能文件放置在不同的文件夹下(取决于环境),我使用@Cucumberoptions 来设置标签特定的功能文件路径。
到这里为止一切顺利。
但是当我运行功能文件时,它会选择带有@current 标签的所有场景,而与功能文件标签无关。 对于 E.G.我在 cucumber 选项中只添加了@Env1 和@Env2,但它也选择了@Env3 功能并运行它们。如何停止 cucumber 运行 @cucumberOptions 中未提及的功能文件?
这是 ANT 目标代码:
<java classname="cucumber.api.cli.Main" fork="true" failonerror="false" resultproperty="cucumber.exitstatus">
<sysproperty key="log4j.configuration" value="file:///${basedir}/log4j.conf"/>
<classpath refid="classpath"/>
<arg value="--monochrome"/>
<arg value="--format"/>
<arg value="junit:target/cucumber-junit-report/allcukes.xml"/>
<arg value="--format"/>
<arg value="pretty"/>
<arg value="--format"/>
<arg value="html:target/cucumber-html-report"/>
<arg value="--glue"/>
<arg value="src.test.cucumber.userlevel"/>
<arg value="features"/>
<arg value="--tags" />
<arg value="@current"/>
<arg value="--tags" />
<arg value="~@obsolete" />
<arg value="--tags" />
<arg value="~@business" />
</java>
我们将不胜感激。
谢谢。
【问题讨论】: