Forum Discussion

krogold's avatar
krogold
Regular Contributor
8 years ago

How to implement logic at testsuite level ?

Hello,   Is there any way to implement logic at testSuite level ? What I'm trying to achieve is to implement setup or teardown scripts feature that would apply on every testCase of my testSuite. ...
  • krogold's avatar
    krogold
    8 years ago

    After further investigation, I managed to do a complete summary of my tests, test cases and test steps, in my testSuite teardown script:

    def runner = context.testRunner;
    
    for (testRun in runner.getResults())
    {
    	testCase = testRun.getTestCase()
    	//log.info "testCase " + testCase
    	log.info context.expand( '${#Project#testcase_flag}' ) + testCase.getName()
    
    	for (testResult in  testRun.getResults())
    		log.info testResult.getTestStep().getName() + " : " + testResult.getStatus()
    	
    	log.info context.expand( '${#Project#testcase_status_flag}' ) + " : " + runner.getStatus()
    }