It is possible to skip test in runtime?


#1

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.

#2

Agreed Dmitry, We need _markSkippedAndStop or _markBlockedAndStop keyword


#3

Agree, we would also want a keyword markSkippedAndNext, markBlockedAndNext to jump to nxt iteration.


#4

well noted! Thank you so much for the suggestion


#5

Hi, any news on this feature


#6

Yes, there is implementation on this in the listener class

@BeforeTestCase
def sampleBeforeTestCase(TestCaseContext testCaseContext) {
			testCaseContext.skipThisTestCase()
		}

This will skip all tests, You will need to add condition


#7

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