Yes, this looks like the thing to do ...
I have added a test step to the test case and got details out to the script log and it all looks OK
def groovyUtils = new com.eviware.soapui.support.GroovyUtils(context)
log.info('my log here')
log.info('Just wanted to cancel this test ' + context.getCurrentStep().getLabel())
testRunner.cancel('Just wanted to cancel this test ' + context.getCurrentStep().getLabel())
In the test case log I get ....
- Test started at 2016-09-27 15:50:08.106
- Step 1 [GAD.001: Overall status 1] OK: took 2074 ms
- TestCase canceled [Just wanted to cancel this test GAD.001-Cancel-Test], time taken = 2096
- Step 2 [GAD.001-Cancel-Test] CANCELED: took 22 ms
But I get this in the error log, I have no idea why this is happening, I don't have any assertions on the results from the groovy script, it just stops the test as Canceled.
Any help on how I should be getting rid of this error, if the groovy script is disabled, then the test passes its step1...
- Tue Sep 27 15:50:10 BST 2016:ERROR:groovy.lang.MissingMethodException: No signature of method: com.eviware.soapui.impl.wsdl.teststeps.WsdlGroovyScriptTestStep.getAssertionList() is applicable for argument types: () values: []
- groovy.lang.MissingMethodException: No signature of method: com.eviware.soapui.impl.wsdl.teststeps.WsdlGroovyScriptTestStep.getAssertionList() is applicable for argument types: () values: []
- at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.unwrap(ScriptBytecodeAdapter.java:55)
- at org.codehaus.groovy.runtime.callsite.PojoMetaClassSite.call(PojoMetaClassSite.java:46)
- at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:112)
- at Script1$_run_closure1.doCall(Script1.groovy:3)
- at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
- at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
- at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
- at java.lang.reflect.Method.invoke(Unknown Source)
- at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90)
- at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233)
- at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:272)
- at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:909)
- at groovy.lang.Closure.call(Closure.java:411)
- at org.codehaus.groovy.runtime.DefaultGroovyMethods.callClosureForMapEntry(DefaultGroovyMethods.java:3873)