@TearDownIfPassed, @TearDownIfPassed, @TearDownIfFailed not working


#1

Hi there,

os = Windows 10 64bit

katalonVersion = 6.1.5.3

Test Suite Scripts

import com.kms.katalon.core.annotation.SetUp
import com.kms.katalon.core.annotation.SetupTestCase
import com.kms.katalon.core.annotation.TearDown
import com.kms.katalon.core.annotation.TearDownIfError
import com.kms.katalon.core.annotation.TearDownIfFailed
import com.kms.katalon.core.annotation.TearDownIfPassed
import com.kms.katalon.core.annotation.TearDownTestCase

/**
 * Some methods below are samples for using SetUp/TearDown in a test suite.
 */

/**
 * Setup test suite environment.
 */
@SetUp(skipped = true) // Please change skipped to be false to activate this method.
def setUp() {
	// Put your code here.
}

/**
 * Clean test suites environment.
 */
@TearDown(skipped = false) // Please change skipped to be false to activate this method.
def tearDown() {
	// Put your code here.
}

/**
 * Run before each test case starts.
 */
@SetupTestCase(skipped = true) // Please change skipped to be false to activate this method.
def setupTestCase() {
	// Put your code here.
}

/**
 * Run after each test case ends.
 */
//@TearDownTestCase(skipped = false) // Please change skipped to be false to activate this method.
//def tearDownTestCase() {
//	// Put your code here.
//	println(ErrorCollector.getCollector().isKeywordPassed())
//}

@TearDownIfError
def test1(skipped = false) {
	println('errored!');
}
@TearDownIfPassed
def test2(skipped = false) {
	println('passed!');
}
@TearDownIfFailed
def test3(skipped = false) {
	println('failed!');
}


#2

@passPassPass

I am seeing the same behaviour
The annotations @TearDownIfFailed and @TearDownIfPassed simply do not work
@kazurayam do you have any idea here ?


#3

Looks like these annotations @TearDownIfPassed and @TearDownIfFailed works only in Test Case level …

Looks like it do not work in Test suite .
If it works at Test suite level, it is required to keep only once in Test suite and then it should be applicable to all test cases in the suite.

Can you please clarify by checking it


#4

No, I have no idea.

I have never used the annotated method of test cases including @SetUp, @TearDown.

I only use TestListener.