Package org.testng
Interface ITestListener
-
- All Superinterfaces:
ITestNGListener
- All Known Implementing Classes:
DotTestListener
,ExitCodeListener
,JUnitXMLReporter
,TestHTMLReporter
,TestListenerAdapter
,TextReporter
,VerboseReporter
public interface ITestListener extends ITestNGListener
A listener for test running.
-
-
Method Summary
All Methods Instance Methods Default Methods Modifier and Type Method Description default void
onFinish(ITestContext context)
Invoked after all the test methods belonging to the classes inside the <test> tag have run and all their Configuration methods have been called.default void
onStart(ITestContext context)
Invoked before running all the test methods belonging to the classes inside the <test> tag and calling all their Configuration methods.default void
onTestFailedButWithinSuccessPercentage(ITestResult result)
Invoked each time a method fails but has been annotated with successPercentage and this failure still keeps it within the success percentage requested.default void
onTestFailedWithTimeout(ITestResult result)
Invoked each time a test fails due to a timeout.default void
onTestFailure(ITestResult result)
Invoked each time a test fails.default void
onTestSkipped(ITestResult result)
Invoked each time a test is skipped.default void
onTestStart(ITestResult result)
Invoked each time before a test will be invoked.default void
onTestSuccess(ITestResult result)
Invoked each time a test succeeds.
-
-
-
Method Detail
-
onTestStart
default void onTestStart(ITestResult result)
Invoked each time before a test will be invoked. TheITestResult
is only partially filled with the references to class, method, start millis and status.- Parameters:
result
- the partially filledITestResult
- See Also:
ITestResult.STARTED
-
onTestSuccess
default void onTestSuccess(ITestResult result)
Invoked each time a test succeeds.- Parameters:
result
-ITestResult
containing information about the run test- See Also:
ITestResult.SUCCESS
-
onTestFailure
default void onTestFailure(ITestResult result)
Invoked each time a test fails.- Parameters:
result
-ITestResult
containing information about the run test- See Also:
ITestResult.FAILURE
-
onTestSkipped
default void onTestSkipped(ITestResult result)
Invoked each time a test is skipped.- Parameters:
result
-ITestResult
containing information about the run test- See Also:
ITestResult.SKIP
-
onTestFailedButWithinSuccessPercentage
default void onTestFailedButWithinSuccessPercentage(ITestResult result)
Invoked each time a method fails but has been annotated with successPercentage and this failure still keeps it within the success percentage requested.- Parameters:
result
-ITestResult
containing information about the run test- See Also:
ITestResult.SUCCESS_PERCENTAGE_FAILURE
-
onTestFailedWithTimeout
default void onTestFailedWithTimeout(ITestResult result)
Invoked each time a test fails due to a timeout.- Parameters:
result
-ITestResult
containing information about the run test
-
onStart
default void onStart(ITestContext context)
Invoked before running all the test methods belonging to the classes inside the <test> tag and calling all their Configuration methods.- Parameters:
context
- The test context
-
onFinish
default void onFinish(ITestContext context)
Invoked after all the test methods belonging to the classes inside the <test> tag have run and all their Configuration methods have been called.- Parameters:
context
- The test context
-
-