Forum Discussion

larsn's avatar
larsn
Contributor
12 years ago

From maven or testrunner.sh, how can enable/disable testcase

From maven or testrunner.sh, how can enable/disable testcases to run?
I'm looking to disable all tests that have a manual teststep.

If I was using Robot Framework, I could assign a label to all those tests (like "manual-teststep") and then when running the testsuites, tell it to not run all tests with that label.
  • Hi,

    There is currently no option for this in testrunner.sh\.bat.

    You can do this using Groovy though, this will disable every manual test step in a test suite.


    def testSuite = context.testCase.testSuite;
    def totalTestCases = testSuite.getTestCases().size();

    for(n in (0..totalTestCases-1))
    {
    def testSteps = testSuite.getTestCaseAt(n).getTestStepsOfType(com.eviware.soapui.impl.wsdl.teststeps.ManualTestStep)
    for (t in testSteps)
    {
    t.setDisabled(true);
    }
    }



    Regards,
    Marcus
    SmartBear Support
  • Thanks. This would be a nice feature to add but it sounds like a writing a new test runner would be required.
    I guess the test runner would have check all steps of a test case to see if there is a manual step before choosing to execute the test case or not.

    If I read your code correctly, the code disables all manual test steps but not disabling the test cases that have manual test steps.
  • Hi,

    You are correct. The code snippet will disable the manual test steps, but will not disable the test cases.



    Regards,
    Marcus
    SmartBear Support