黄瓜JVM ant任务 [英] Cucumber-JVM ant task

查看:198
本文介绍了黄瓜JVM ant任务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我如何知道蚂蚁的文件夹中执行所有黄瓜测试(功能,实现)?

我坚持用这个例子

 <目标名称=runcukes依赖=编译 - 测试>
        < MKDIR DIR =目标/黄瓜的JUnit报告/>
        < Java类名=cucumber.cli.Main叉=真failonerror =false的resultproperty =cucumber.exitstatus>
            <类路径REFID =类路径/>
            < ARG值= - 格式/>
            < ARG值=JUnit的:目标/黄瓜的JUnit报告/ allcukes.xml/>
            < ARG值= - 格式/>
            < ARG值=pretty/>
            < ARG值= - 格式/>
            < ARG值=HTML:目标/黄瓜HTML的报告/>
            < ARG值= - 胶/>
            < ARG值=cucumber.examples.java.helloworld/>
            < ARG值=的src /测试/资源/>
        < / JAVA>        < junitreport todir =目标/黄瓜的JUnit报告>
            <文件集DIR =目标/黄瓜的JUnit报告>
                <包括姓名=allcukes.xml/>
            < /文件集>
            <报告格式=帧todir =目标/黄瓜的JUnit报告/>
        < / junitreport>        <失败消息=黄瓜失败>
            <条件>
                <而非>
                    &所述;等于ARG1 =$ {cucumber.exitstatus}ARG2 =0/>
                < /&不GT;
            < /条件>
        < /失败>
    < /目标与GT;


解决方案

  

用法:java的cucumber.cli.Main [选项] [[FILE | DIR] [:LINE [:LINE] *] +


选项:

  -g,--glue所在路径胶code(步骤定义和挂钩)从加载。
-f,--format FORMAT [:OUT]如何格式化结果。除非指定输出到stdout。
                                可用格式:JUnit中,HTML,pretty,进步,JSON,json- pretty。
-t,--tags TAG_EX preSSION只有运行标记标签匹配TAG_EX preSSION场景。
-n,--name表达式只运行场景名匹配REGEXP。
-d,胶水code的--dry运行跳过执行。
-m,--monochrome不要彩色终端输出。
    --dotcucumber在哪里写出来运行时信息。
-v,--version打印版本。
-h,--help你看它。

在你的情况 - 修改< ARG值=的src /测试/资源/> 您要针对其运行目录。请注意,您可以指定多个文件和目录用空格分开。

How do i tell ant to execute all cucumber tests (features, implementations) in a folder?

I'm stuck using this example

<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]*] ]+

Options:

-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.

In your case - change the <arg value="src/test/resources"/> to directory you want to run against. Note that you can specify multiple individual files and directories space-separated.

这篇关于黄瓜JVM ant任务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆