停止执行套房首次故障TestNG中后 [英] Stop Suite Execution After First Failure In TestNG

查看:212
本文介绍了停止执行套房首次故障TestNG中后的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用Ant来执行一组TestNG进行如下:

I am using Ant to execute a set of TestNG tests as follows:

 <testng suitename="functional_test_suite" outputdir="${basedir}/target/"
classpathref="maven.test.classpath" dumpCommand="false" verbose="2"
haltonfailure="true" haltonskipped="false" parallel="methods" threadCount="2">
   <classfileset dir="${basedir}/target/test-classes/">
    <include name="**/*Test.class" />
   </classfileset>

我想对于测试的第一次失败之后立即停止。 haltonfailure似乎并没有这样的伎俩,它只是停止Ant构建如果全套房设有测试失败。有没有什么办法可以阻止在第一次失败套房执行?

I would like for the tests to stop immediately after the first failure. haltonfailure does not seem to do the trick, it just halts the ant build if the whole suite has test failures. Is there any way I can halt the suite execution on first failure?

感谢

推荐答案

您可以在您的测试方法来设置依赖关系。 TestNG的依赖。如果需要依赖通过这将只运行的测试方法。

You can set dependencies on your individual test methods. testng dependencies. This will only run test methods if desired dependencies passed.

这篇关于停止执行套房首次故障TestNG中后的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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