We have TestSuites with TestCases on the TestRail.
After creating TestSuite with TC, I know TestSuite ID only.
In Katalon i am configured @BeforeTestSuite Listener to get TestSuite ID from file. Then Katalon connects to the TestRail, gets TestCase IDs from TestSuite and puts IDs into Collection. In Katalon i’m adding IDs to TestCase into Variable. Via @BeforeTestCase Listener i get TestCase ID from TestCase context. If Collection of IDs contains TestCase ID - test runs. Else - the test shouldn’t run. Maybe someone knows how to skip the test?
As a temporary solution i add flag into Global variable. And in the Else block i set flag to false and on tests i check this flag and use markErrorAndStop. But i think this is not good solution.
Thanks, but just as Idea:
It still would be good to have such ability maybe supply skip function as third parameter:
it(‘should skip if not fit’, function(done, skip){
if (fit) done() else (skip())
}
or maybe do it with done function by supplying some paramenters done({skip: true}), by the way done(‘some message’) output is huge and like error out, I wonder why? source
It doesn’t acctually skip the test it just marked it as passed and run the whole execution but only doesn’t care about the result, which is pretty dummy.
I expect from the method like that to not run the test at all and to not include it in the report.
It works only partially for me I wanted to marked some of the tests as smoke, to not divide the data table in my DDT test suite.
So it looks like it triggers the rest test execution, Listener example above:
Map<String, Object> map = testCaseContext.getTestCaseVariables()
if (GlobalVariable.smokeSuite) {
if (!map.get("smoke")) {
testCaseContext.skipThisTestCase()
}
}
// Ignore test case create a message in log failing tests
if (map.get('ignore')) {
GlobalVariable.FailedTestsList += GlobalVariable.testNumber + ": " + map.get('testName') + ": IGNORED.\n\n"
testCaseContext.skipThisTestCase(true)
}
// Reset counters if resetCounters variable is set on true
if (map.get('resetCounters')) {
WebUI.callTestCase(findTestCase('GenericTestCases/ResetCountersForUID'), [("uid"): map.get('uid')], FailureHandling.CONTINUE_ON_FAILURE)
}
// Get last known counter value and refer it to the variable
if (map.get('cornerCondition').equals('checkCounter')) {
GlobalVariable.lastCounterValue = WebUI.callTestCase(findTestCase('GenericTestCases/GetDataForUID'), [('uid') : map.get('uid')], FailureHandling.CONTINUE_ON_FAILURE).get('nfcCounter')
}
}
I do expect from it to stop from this moment on if the test is not marked as smoke, but it seems to go further with the rest of variables, counters reset etc which is a time consuming.
Of course I can put the rest into the else block, but why does it happen?
Also I would like to have the information about the number of skipped tests, not passed in the report or even to not execute and include them in the test report at all.