Creating an HTML report with embedded screenshots of failed JUnit tests

时光怂恿深爱的人放手 提交于 2020-02-04 04:49:31

问题


I've put together a custom JUnit runner that saves a screenshot when a WebDriver test fails. I'm using Maven's failsafe plugin to create reports of the integration tests and TeamCity is our CI server.

I know TeamCity supports custom reports, but I don't know how I'd embed the image files into an HTML page (or pages) with references to the relevant tests.

What would be a good method to integrate the screenshots into the test report? Is there a Maven plugin that'll do the job?


回答1:


Maybe Allure-report would suit for your purpose. It allows to create a nice report that contains different attachments, including screenshots. Moreover it has JUnit integration and Teamcity plugin, so it fully covers your use-case.




回答2:


Unfortunately there is no way to simply change the reports cause they are generated by the maven-report-plugin which can't be simply changed. What you can try is to create a separate folder and create a link via the site.xml descriptor.




回答3:


You can try maven-cobertura-plugin. Including this in your build will generate a HTML report of all the test case success, failure and coverage. Hope this helps....



来源:https://stackoverflow.com/questions/11155853/creating-an-html-report-with-embedded-screenshots-of-failed-junit-tests

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