Class TestNGEventListener
java.lang.Object
de.qytera.qtaf.testng.event_listener.TestNGEventListener
- All Implemented Interfaces:
org.testng.ITestListener,org.testng.ITestNGListener
This class is an event listener for TestNG events. It connects TestNG with the QTAF event system.
It implements the ITestListener interface from TestNG, which provides methods for handling test events
and triggers corresponding QTAF events.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidonFinish(org.testng.ITestContext iTestContext) This method is called when a TestNG test run finishes.voidonStart(org.testng.ITestContext iTestContext) This method is called when a TestNG test run starts.voidonTestFailedButWithinSuccessPercentage(org.testng.ITestResult iTestResult) This method is called when a TestNG test fails but is within the success percentage.voidonTestFailure(org.testng.ITestResult iTestResult) This method is called when a TestNG test fails.voidonTestSkipped(org.testng.ITestResult iTestResult) This method is called when a TestNG test is skipped.voidonTestStart(org.testng.ITestResult iTestResult) This method is called when a TestNG test starts.voidonTestSuccess(org.testng.ITestResult iTestResult) This method is called when a TestNG test succeeds.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.testng.ITestListener
onTestFailedWithTimeout
-
Constructor Details
-
TestNGEventListener
public TestNGEventListener()
-
-
Method Details
-
onStart
public void onStart(org.testng.ITestContext iTestContext) This method is called when a TestNG test run starts. It initializes the QTAF system, logs a start message, and dispatches a start testing event.- Specified by:
onStartin interfaceorg.testng.ITestListener- Parameters:
iTestContext- The test context for the current test run.
-
onFinish
public void onFinish(org.testng.ITestContext iTestContext) This method is called when a TestNG test run finishes. It logs a finish message and dispatches a finish testing event.- Specified by:
onFinishin interfaceorg.testng.ITestListener- Parameters:
iTestContext- The test context for the current test run.
-
onTestStart
public void onTestStart(org.testng.ITestResult iTestResult) This method is called when a TestNG test starts. It dispatches a test started event if it has not been dispatched before for the current test.- Specified by:
onTestStartin interfaceorg.testng.ITestListener- Parameters:
iTestResult- The result of the current test.
-
onTestSuccess
public void onTestSuccess(org.testng.ITestResult iTestResult) This method is called when a TestNG test succeeds. It dispatches a test success event.- Specified by:
onTestSuccessin interfaceorg.testng.ITestListener- Parameters:
iTestResult- The result of the current test.
-
onTestFailure
public void onTestFailure(org.testng.ITestResult iTestResult) This method is called when a TestNG test fails. It dispatches a test failure event. Important note: TestNG does not support changing the status of the test result after a test terminates. An InvocationEventListener can be used for this purpose. See also: TestNGInvocationEventListener.java- Specified by:
onTestFailurein interfaceorg.testng.ITestListener- Parameters:
iTestResult- The result of the current test.
-
onTestSkipped
public void onTestSkipped(org.testng.ITestResult iTestResult) This method is called when a TestNG test is skipped. It dispatches a test skipped event.- Specified by:
onTestSkippedin interfaceorg.testng.ITestListener- Parameters:
iTestResult- The result of the current test.
-
onTestFailedButWithinSuccessPercentage
public void onTestFailedButWithinSuccessPercentage(org.testng.ITestResult iTestResult) This method is called when a TestNG test fails but is within the success percentage. It dispatches a test failed but within success percentage event.- Specified by:
onTestFailedButWithinSuccessPercentagein interfaceorg.testng.ITestListener- Parameters:
iTestResult- The result of the current test.
-