krogold
7 years agoRegular Contributor
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.
Of course, these scripts would include variables that would take values according to the current running test case ...
If anyone knows ...
So far I tried to do this in setup script and it failed with a
groovy.lang.MissingPropertyException: No such property: testRunner for class: Script1
message.
Maybe SOAP ui could be configured ?
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() }