Custom HTML reports - Need Your Contribution
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Custom HTML reports - Need Your Contribution
Hi guys,
I am working on a custom HTML report for ReadyApi tests. This is how the report will look like:
If you know html, css, javascript or groovy and you want to contribute the git project can be found here.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
My cat is still working on it...
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Added the posiblity to filter results (all tests vs only the failed ones).
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @Lucian, this is a bit rough and ready, but does the following project teardown script help at all?
log.info('Project Teardown') // I don't think you can trust the order matched the order displayed in the GUI project.getTestSuites().each(){ testSuiteName, testSuite -> log.info(testSuiteName) def currentSuiteResult = runner.getResults().find{it.getTestSuite().getName() == testSuiteName } // Assume if null test suite doesn't have results as it hasn't been run - probably need to do something smarter here if(currentSuiteResult){ log.info(currentSuiteResult.getTestSuite().getName() + ' = ' + currentSuiteResult.getStatus()) // I don't think you can trust the order matched the order displayed in the GUI testSuite.getTestCases().each(){ testCaseName, testCase -> log.info(testCaseName) def currentCaseResult = currentSuiteResult.getResults().find{it.getTestCase().getName() == testCaseName } // Assume if null test case doesn't have results as it hasn't been run - probably need to do something smarter here if(currentCaseResult){ log.info(currentCaseResult.getTestCase().getName() + ' = ' + currentCaseResult.getStatus()) }else{ log.info(testCaseName + ' not run, probably disabled???') } } }else{ log.info(testSuiteName + ' not run, probably disabled???') } }
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks @Radford,
This is what I came up with:
testSuitesResult.each() { log.info it.getTestSuite().getName() log.info it.getStatus() testCasesResults = it.getResults() testCasesResults.each() { log.info it.getTestCase().getName() log.info it.getStatus() testStepResults = it.getResults() testStepResults.each() { log.info it.getTestStep() log.info it.getStatus() log.info it.getTestStep().getName() testAssertionsList = it.getTestStep().getAssertionList() testAssertionsList.each() { log.info it.getName() log.info it.getStatus() } } }
I am now looking for a way to get the explanation on why a test assertion failed. Something like: "Expected value was 1, Actual value is 2". Also the assertion type would be nice to be know.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I'm a bit short of time at the moment, but can I point you towards this post of mine:
It might help.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I already tried something simillar but it didn't work. I will try to see what's going wrong.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Ok. Solved that also.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Can you please share your latest code ?
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi all,
@Bharathi2003, I guess, the latest version of the report that Lucian created is located here, on GitHub.
@Lucian, it looks like the work on the report is complete now, am I right? If so, do you mind modifying the initial post in this thread and update it with the list of specific features this report has and with a link to the project for more visibility? This will allow us to add this topic to the TechCorner area.
Thanks in advance,
Olga Terentieva
SmartBear Assistant Community Manager
