有 Java 编程相关的问题?

你可以在下面搜索框中键入要查询的问题!

IntelliJ上的java Testng忽略测试后没有输出

当Testng忽略测试时,有没有办法找到忽略测试的原因

在控制台中,在生成了一长串没有结果的文件名之后, 那么我所能看到的就是:

[TestNG] Running:
  /Users/user1/Library/Caches/IntelliJIdea2018.1/temp-testng-customsuite.xml

Test ignored.

Test ignored.

Test ignored.

===============================================
Default Suite
Total tests run: 3, Failures: 0, Skips: 3
===============================================


Process finished with exit code 0

据我所知,这可能是任何运行时错误。比如IllegalArgumentException等

只要是在构建过程中,就不会显示错误消息

有没有更有效的方法来调试丢失的日志


共 (2) 个答案

  1. # 1 楼答案

    The default configfailurepolicy for testng is skip, i.e if any test fails in suite it will skip the remaining.

    如果您希望在之前的测试失败后仍能运行测试,请在temp testng customsuite的<suite>标记中添加以下属性。xml

    <suite name="Suite" parallel="tests" thread-count="10" verbose="10" configfailurepolicy="continue">
    
  2. # 2 楼答案

    然后在测试代码中添加Assert.Ignore("message_here");。。。但忽视测试是一种糟糕的做法。测试应该失败,并在出现意外异常时停止执行