gpt4 book ai didi

java - Cucumber-JVM Ant 任务

转载 作者:塔克拉玛干 更新时间:2023-11-01 22:30:55 34 4
gpt4 key购买 nike

我如何告诉 ant 执行文件夹中的所有 Cucumber 测试(功能、实现)?

我无法使用这个例子

<target name="runcukes" depends="compile-test">
<mkdir dir="target/cucumber-junit-report"/>
<java classname="cucumber.cli.Main" fork="true" failonerror="false" resultproperty="cucumber.exitstatus">
<classpath refid="classpath"/>
<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="cucumber.examples.java.helloworld"/>
<arg value="src/test/resources"/>
</java>

<junitreport todir="target/cucumber-junit-report">
<fileset dir="target/cucumber-junit-report">
<include name="allcukes.xml"/>
</fileset>
<report format="frames" todir="target/cucumber-junit-report"/>
</junitreport>

<fail message="Cucumber failed">
<condition>
<not>
<equals arg1="${cucumber.exitstatus}" arg2="0"/>
</not>
</condition>
</fail>
</target>

最佳答案

Usage: java cucumber.cli.Main [options] [ [FILE|DIR][:LINE[:LINE]*] ]+

选项:

-g, --glue PATH Where glue code (step definitions and hooks) is loaded from.
-f, --format FORMAT[:OUT] How to format results. Goes to STDOUT unless OUT is specified.
Available formats: junit, html, pretty, progress, json, json-pretty.
-t, --tags TAG_EXPRESSION Only run scenarios tagged with tags matching TAG_EXPRESSION.
-n, --name REGEXP Only run scenarios whose names match REGEXP.
-d, --dry-run Skip execution of glue code.
-m, --monochrome Don't colour terminal output.
--dotcucumber Where to write out runtime information.
-v, --version Print version.
-h, --help You're looking at it.

在您的情况下 - 更改 <arg value="src/test/resources"/>到您要运行的目录。请注意,您可以指定多个单独的文件和目录,以空格分隔。

关于java - Cucumber-JVM Ant 任务,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11466040/

34 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com