renatoathaydes / spock-reports

This project creates a global extension to Spock to create test reports.
Apache License 2.0
273 stars 68 forks source link

Single Page Report #248

Closed tfij closed 1 year ago

tfij commented 1 year ago

I'd like to generate a report as a single-page file. Such a file you can easily attach to an email or JIRA issue.

renatoathaydes commented 1 year ago

Isn't it already the case?

Perhaps you're missing the fact that the CSS file can be optionally embedded in the HTML, making the reports self-contained?

See https://github.com/renatoathaydes/spock-reports#default-properties-values

com.athaydes.spockframework.report.internal.HtmlReportCreator.inlineCss=true
tfij commented 1 year ago

The issue is not about CSS but merging HTML. Generated report contains many HTML files (index + file per test class). I'd like to have a single HTML file. E.g like with Spock documentation, there is a multi-pages version but there is also a version with a single page - https://spockframework.org/spock/docs/2.3/all_in_one.html

renatoathaydes commented 1 year ago

spock-reports also generates a summary report with all specs. Can you explain why that's not enough?

tfij commented 1 year ago

are you talking about the index.html file? This is just a summary with links to other files (file per test class).

I'm looking for a single file with both summary (from index.html) and all described test cases (from all other HTML files). Something like merging all HTML files into a single one.

renatoathaydes commented 1 year ago

I see. Hm, I'm sorry but I don't see this as ever becoming a feature of spock-reports. It would require keeping everything in memory, possibly causing trouble on very large builds. Notice that based on all information spock-reports already provides, this should be possible to implement as a completely separate Gradle/Spock plugin that just uses spock-reports files as input.

Let me know if you ever implement something like that, and I can link from the README.

For this reason, I will close this request.

tfij commented 1 year ago

I think the memory problem could be solved in many ways. For example, next to each HTML file generate json. Combining jsons into one report should be much easier than merging HTML.