Class TestNGInvocationEventListener
java.lang.Object
de.qytera.qtaf.testng.event_listener.TestNGInvocationEventListener
- All Implemented Interfaces:
org.testng.IInvokedMethodListener,org.testng.ITestNGListener
public class TestNGInvocationEventListener
extends Object
implements org.testng.IInvokedMethodListener
A custom TestNG listener that implements the
IInvokedMethodListener interface to listen to
method invocation events during test execution. This listener specifically checks whether any failed
steps occurred in the test scenario, using QTAF's own assertion methods, and manually updates the
test result status.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidafterInvocation(org.testng.IInvokedMethod method, org.testng.ITestResult testResult) This method is called after a test method has been invoked.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.testng.IInvokedMethodListener
afterInvocation, beforeInvocation, beforeInvocation
-
Constructor Details
-
TestNGInvocationEventListener
public TestNGInvocationEventListener()
-
-
Method Details
-
afterInvocation
public void afterInvocation(org.testng.IInvokedMethod method, org.testng.ITestResult testResult) This method is called after a test method has been invoked. It checks whether the test scenario has any failed steps by manually verifying the log messages associated with the scenario. If any failed steps are detected, the test result is marked as failed. This procedure is required because the QTAF assertions are not visible for TestNG, as the QTAF assertions typically do not throw an exception and are therefore not recognized by TestNG as a failed test.- Specified by:
afterInvocationin interfaceorg.testng.IInvokedMethodListener- Parameters:
method- The invoked method information.testResult- The result of the test method invocation, which contains information such as the test method, its result, status, and execution details.
-