How to beautify the test report generated by TestNg
When we execute the Testng.xml to run the test case, we will generate a test-output folder under the project file, and open the following index.html file, which is the report of the Testng output.
1. Download TestNG-xslt and copy the saxon-8.7.jar package into the lib directory of the test project, and attach it to the project.
two。 Copy the file testng-results.xsl from the downloaded package to the test-output directory. The location of the testng-results.xsl file is testng-xslt-1.1.1/src/main/resources, and the test report is generated with this style.
3. Create a new build.xml with the following contents:
4. After you successfully execute this xml with ant, go to the test-output directory and view the generated index.html.
The report can clearly see the number of successful and failed case, as well as the exception thrown by the failed case.