Ask a Question

Custom HTML reports - Need Your Contribution

Lucian
Community Hero

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:

 

2018-10-01_16h43_12.png

If you know html, css, javascript or groovy and you want to contribute the git project can be found here.



If my answer helped please click on the 'Accept as Solution' button.
37 REPLIES 37
Lucian
Community Hero

My cat is still working on it...

 

IMG_20181013_124107.jpg



If my answer helped please click on the 'Accept as Solution' button.
Lucian
Community Hero

2018-10-14_19h13_28.png

 

Added the posiblity to filter results (all tests vs only the failed ones). 



If my answer helped please click on the 'Accept as Solution' button.
Lucian
Community Hero

I'm working now on the report generation part. I'm stuck at finding how to get testsuite and testcase statuses from inside a project teardown script.


If my answer helped please click on the 'Accept as Solution' button.
Radford
Super Contributor

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???')
    }
}

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.



If my answer helped please click on the 'Accept as Solution' button.
Radford
Super Contributor

I'm a bit short of time at the moment, but can I point you towards this post of mine:

 

https://community.smartbear.com/t5/SoapUI-Pro/how-do-i-get-the-assertions-list-test-data-wise-in-a-t...

 

It might help.

I already tried something simillar but it didn't work. I will try to see what's going wrong.



If my answer helped please click on the 'Accept as Solution' button.
Lucian
Community Hero

Ok. Solved that also.

 



If my answer helped please click on the 'Accept as Solution' button.

Can you please share your latest code ?

Olga_T
SmartBear Alumni (Retired)

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

cancel
Showing results for 
Search instead for 
Did you mean: