Package org.testng
Interface ITestListener
- All Superinterfaces:
ITestNGListener
- All Known Subinterfaces:
IResultListener,IResultListener2
- All Known Implementing Classes:
DotTestListener,ExitCodeListener,ExitCodeListener,JUnitXMLReporter,TestHTMLReporter,TestListenerAdapter,TextReporter,VerboseReporter
A listener for test running.
-
Method Summary
Modifier and TypeMethodDescriptiondefault voidonFinish(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 voidonStart(ITestContext context) Invoked before running all the test methods belonging to the classes inside the <test> tag and calling all their Configuration methods.default voidInvoked each time a method fails but has been annotated with successPercentage and this failure still keeps it within the success percentage requested.default voidonTestFailedWithTimeout(ITestResult result) Invoked each time a test fails due to a timeout.default voidonTestFailure(ITestResult result) Invoked each time a test fails.default voidonTestSkipped(ITestResult result) Invoked each time a test is skipped.default voidonTestStart(ITestResult result) Invoked each time before a test will be invoked.default voidonTestSuccess(ITestResult result) Invoked each time a test succeeds.
-
Method Details
-
onTestStart
Invoked each time before a test will be invoked. TheITestResultis only partially filled with the references to class, method, start millis and status.- Parameters:
result- the partially filledITestResult- See Also:
-
onTestSuccess
Invoked each time a test succeeds.- Parameters:
result-ITestResultcontaining information about the run test- See Also:
-
onTestFailure
Invoked each time a test fails.- Parameters:
result-ITestResultcontaining information about the run test- See Also:
-
onTestSkipped
Invoked each time a test is skipped.- Parameters:
result-ITestResultcontaining information about the run test- See Also:
-
onTestFailedButWithinSuccessPercentage
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-ITestResultcontaining information about the run test- See Also:
-
onTestFailedWithTimeout
Invoked each time a test fails due to a timeout.- Parameters:
result-ITestResultcontaining information about the run test
-
onStart
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
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
-