Names for dynamically generated TestNG tests in Eclipse plugin

后端 未结 2 803
故里飘歌
故里飘歌 2021-01-20 04:17

I converted a dynamically generated JUnit test suite to TestNG using a @Factory annotation. The tests are generated by scanning a directory that contains severa

2条回答
  •  挽巷
    挽巷 (楼主)
    2021-01-20 05:02

    As carlin.scott suggested, extending XmlTest works for this problem. However, I overrode toString() to return the test name (instead of calling setName). This has the advantage that the test name in the TestNG view is easier to read. By default, it contains additional information such as parameters and metagroups.

提交回复
热议问题