0

在我的测试中,我捕获每个测试的输出并将它们保存为目录中的 html 文件。如何在 TestNG 报告中为每个测试提供指向这些输出的链接?

例如,如果 testNG 结果中记录了失败,它还会提供指向已保存 html 文件的链接。

谢谢

4

1 回答 1

0

It all depends on where and how you want to report the results. It sounds like you want to create a custom TestNG report that will contain information on the status as well as link to the file generated. There are two main ways to accomplish this in TestNG:

  1. Create a test listener - implements org.testng.ITestListener, reports status of every tests immediately after tests is executed.
  2. Create a test reporter - implements org.testng.IReporter, provides a consolidated result of the test statuses, when all the tests were executed.

You can refer to TestNG web site for some examples on listeners.

于 2012-06-05T01:05:17.097 回答