从Maven设置TestNG的详细级别 [英] Set TestNG's verbosity level from Maven

查看:224
本文介绍了从Maven设置TestNG的详细级别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我正在运行测试时,我讨厌盯着闪烁的光标而不知道正在运行什么。为了解决这个问题,我在所有测试中添加了完成消息。然而,我意识到它是一个非常hacky的解决方案,并添加了绒毛。

When I'm running tests I hate staring at a blinking cursor with no idea what's running. To fix this I've added completion messages to all my tests. However I've realized that its a really hacky solution and adds fluff.

假设TestNG的详细级别打印测试描述,我如何在Maven中设置详细级别?请注意,我没有test.xml文件,所以如果它是唯一的方法,那么我不知道如何让test.xml文件+ Maven的自动生成的test.xml文件一起工作。

Assuming that TestNG's verbosity level prints the test description, how can I set the verbosity level in Maven? Note that I don't have a test.xml file, so if its the only way then I have no idea how to have a test.xml file + Maven's autogenerated test.xml file work together.

推荐答案

maven-failsafe-plugin 版本 2.19 详细级别可以配置如下:

Since maven-failsafe-plugin version 2.19 the verbosity level can be configured as follow:

<configuration>
      ...
      <properties>
        <property>
          <name>surefire.testng.verbose</name>
          <value>-1</value>
        </property>
      </properties>
      ...
 </configuration>

注意:
详细程度为0到10,其中10是最详细的。
-1将使TestNG进入调试模式。

Note: The verbosity level is 0 to 10, where 10 is most detailed. -1 will put TestNG in debug mode.

这篇关于从Maven设置TestNG的详细级别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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