I'm trying to detect skipped test in my @AfterMethod for reporting purpose.
I can catch failed or passed test but it doesn't seems to enter it when a test is skipped.
My tests :
@Test public void method1 () { Assert.fail("created failure"); } @Test (dependsOnMethods = {"method1"}) public void method2 () {} My AfterMethod :
@AfterMethod protected void afterMethod(ITestResult result){ switch (result.getStatus()) { case ITestResult.FAILURE: ... break; case ITestResult.SKIP: ... break; case ITestResult.SUCCESS: ... break; } for example here i only retrieve the failure but the skip doesn't pass in the after method
Any idea on how to do it ?
Thank you !
TestListener, shall help.