Forum Discussion

sanj's avatar
Super Contributor
6 years ago

what would I need to import in order to run test runner

I am trying to do the following but want it in a standalone groovy script. I already have the jars imported for READY API What packages do I need to import in order to run tests from groovy def...
  • aaronpliu's avatar
    6 years ago

    No need.

    Just pass a parameter (testRunner) in your method.

    // assumed that you put it in MyScript.groovy
    def myTest(testRunner){
        // something
    // call it in groovy step
    def t = new MyScript()
    // if you defined a class MyScript.groovy
    class MyScript{
        def runner
        def myTest(YourStepName){
        // something
    // call it in groovy step
    def m = new MyScript(runner: testRunner)