简体   繁体   中英

Testng on IntelliJ no output after tests are ignored

Is there a way to get the cause of the tests being ignored when Testng ignores the tests?

In the console, after a long list of names of the files built with no result stated, then all I can see is:

[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

From what I learned, it can be any runtime error. Like IllegalArgumentException etc.

As long as it's during building process, no error message will be displayed.

Is there a more effective way to debug with the missing log?

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

If you want your tests to run even after failing previous tests the add below attribute in <suite> tag of temp-testng-customsuite.xml

<suite name="Suite" parallel="tests" thread-count="10" verbose="10" configfailurepolicy="continue">

Then add a Assert.Ignore("message_here"); to your test code... but ignoring tests is a bad practice. And test SHOULD fail and stop the execution on unexpected exceptions!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM