How can I merge multiple TestNG suite results to one report?

拈花ヽ惹草 提交于 2019-12-11 01:35:17

问题


So here's an issue at my work. I've got a few TestNG cases that, if run within the primary batch of test cases, wreak havock throughout the other test cases. Rather than going through and changing all our test cases, I've made a group for the involved cases. I run the main test suite, excluding that group, and then make a second Ant call to run the affected group. This way all test cases pass, but I'm ending up having to create two TestNG reports so that the first one doesn't get overriden with the results from the second group.

So here's my question: is it possible to merge the second test result report with the first, or am I stuck with the two?


回答1:


I think that the only way you would be able to do this is to process the TestNG XML output after the two runs. You should be able to collate the XML files from the two runs and combine it into a single HTML report using the Ant JUnit Report task.

If you aren't happy with the output you get from this, it could be because TestNG organises its JUnit XML output oddly. You get better results (in my opinion) if you use the JUnitXMLReporter from my ReportNG project and run JUnit Report on that.

Alternatively, you might be able to use this XSLT reporter for TestNG to combine the XML output from the two test runs into a single HTML report, though I've no idea if it supports this or not.




回答2:


I think the Jenkins TestNG plugin will take a *.xml filter to concatenate multiple result files.



来源:https://stackoverflow.com/questions/473911/how-can-i-merge-multiple-testng-suite-results-to-one-report

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!