How to abort test execution after triggering through KRE manually

I have developed a reusable lib for this issue: