Hey,
I found this sample might be helpful How to use tearDownIfPassed and tearDownIfFailed - #5 by musaffir.puthukudi