getTestCaseList only for enabled test cases

Viewed 96

I would like to have a test case list containing only enabled test cases in the tear down script. I tried below code. however it return all the test cases including the disabled ones.

project.getTestSuiteList().each {
    it.getTestCaseList().each { tcList ->
        tcList.each {
log.info it.properties
}
2 Answers
project.getTestSuiteList().each {
    it.getTestCaseList().each { tcList ->
        tcList.each {
if(!it.isDisabled()){
/*do your stuff*/
}

}

your testCase, same as at testStep level, has a 'disabled' property

        tcList.each{
        log.info it.name
        log.info it.disabled
        ...
    }

Then you can set condition on it ...

Related