Looks you have come up with approach and groovy script. What is the issue?
And why do you need all the above things in the report?
There couple of factors that needs to be considered.
- Who is the target audience for the report?
- Request and response can be collected easily. However, imagine the time that will be spend to generate and amount of memory required if there are thousands of tests. Why are these required if the tests are passed? Of course, for that good assertions to be in place so that the test is passed all the checks. The tool any way captures them if the test fails which might actually interested for the responsible engineer.
- When the test is failed it will have the end point details.
- The tool can generate the report in pdf format. Use testrunner utility to execute the tests with appropriate reporting options and these designed based on wide usage and standards. And the tool allows to customize the reports. Please try them before writing our own.
https://support.smartbear.com/readyapi/docs/testing/reports/getting-started.htmlhttps://support.smartbear.com/readyapi/docs/testing/reports/index.html