For a research I\'m doing, I\'m in need of capturing the result status (Passed/Failed) after running the test method (@Test), from @AfterMethod.
I have been using the im
The TestListenerAdapter
has methods for each of those situations (success, skipped, failure). My suggestions is to make your own listener like this.
public class MyTestResultListener extends TestListenerAdapter {
@Override
public void onTestFailure(ITestResult result) {
// do what you want to do
}
@Override
public void onTestSuccess(ITestResult result) {
// do what you want to do
}
@Override
public void onTestSkipped(ITestResult result) {
// do what you want to do
}
}
Then add your listener to the test class.
@Listeners(MyTestResultListener.class)
public class MyTest {
// your tests
}