krogold
4 years agoRegular Contributor
How to run a testSuite setupScript from a groovy step
Hello,
I'm trying to run a testSuite's setup script from a groovy step.
I manage to play testCases setup script through the testCase's runSetupScript method but I can't find if the equivalent exists at testSuite's level. As testSuite have setup and teardown scripts I think that it should be possible to do so ...
I tried the following
testRunner.testCase.testSuite.project.testSuiteList.each
{
suite ->
suite.runSetupScript(context, testRunner)
... // other code
}
but it provokes an error
groovy.lang.MissingMethodException: No signature of method: com.eviware.soapui.impl.wsdl.WsdlTestSuitePro.runSetupScript() is applicable for argument types: (com.eviware.soapui.impl.wsdl.panels.support.MockTestRunContext...) values: [[ThreadIndex:0, log:Launch all available tests#423277805:INFO in Default, ...], ...] Possible solutions: runSetupScript(com.eviware.soapui.model.testsuite.TestSuiteRunContext, com.eviware.soapui.model.testsuite.TestSuiteRunner), getSetupScript(), setSetupScript(java.lang.String) error at line: 121
or I may use the wrong context and runner ? but my tesSuite is not executed on its own, just parsed for playing eligible tests (with particular tags)
Maybe my first approach is not optimized as I could play the testSuite with tags but how can I do it from a groovy step ?