简体   繁体   中英

Is it possible to customize gradle's test reports? (Integrate geb reports with gradle test reports)

I am using geb + spock + gradle for tests and I'd really like to integrate a link to geb's screenshots into the gradle report. For those not familiar with geb, essentially it organizes screenshots for each test into a folder structure that follows the project package structure, for example:

com
  domain
    tests
      package
        class1
          screenshot-of-test-method1.jpg
          screenshot-of-test-method2.jpg
        class2
          screenshot-of-test-method1.jpg

I realize I'd have to write some code to figure out what the path to the image should be, but does gradle provide a way to customize the test reports that would allow me to at least insert the link somehow into the appropriate class's test report?

If gradle does not offer direct customization what other options or general approaches would you recommend?

Gradle's HTML test reporting doesn't expose any customization hooks. You'd have to post-process the HTML on your own.

For Geb Spock html reports along with screenshots, you can refer below project from github. This example is very nice to get html reports for geb spock along with screenshots and detailed error log in case of failure.

https://github.com/AOEpeople/geb-spock-reports

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM