cancel
Showing results for 
Search instead for 
Did you mean: 

Custom HTML reports - Need Your Contribution

Highlighted
Community Leader

Re: Custom HTML reports

My cat is still working on it...

 

IMG_20181013_124107.jpg



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

Re: Custom HTML reports

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.
Community Leader

Re: Custom HTML reports

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.
Community Leader

Re: Custom HTML reports

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

Community Leader

Re: Custom HTML reports

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.
Community Leader

Re: Custom HTML reports

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.

Community Leader

Re: Custom HTML reports

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.
Community Leader

Re: Custom HTML reports

Ok. Solved that also.

 



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

Re: Custom HTML reports

Can you please share your latest code ?

Moderator

Re: Custom HTML reports

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

Join us for SmartBear Community Wintertainment!

Share Your Stories
Read Latest News
Top Kudoed Authors