Class TestNGEventListener

java.lang.Object
de.qytera.qtaf.testng.event_listener.TestNGEventListener
All Implemented Interfaces:
org.testng.ITestListener, org.testng.ITestNGListener

public class TestNGEventListener extends Object implements org.testng.ITestListener
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
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    onFinish(org.testng.ITestContext iTestContext)
    This method is called when a TestNG test run finishes.
    void
    onStart(org.testng.ITestContext iTestContext)
    This method is called when a TestNG test run starts.
    void
    onTestFailedButWithinSuccessPercentage(org.testng.ITestResult iTestResult)
    This method is called when a TestNG test fails but is within the success percentage.
    void
    onTestFailure(org.testng.ITestResult iTestResult)
    This method is called when a TestNG test fails.
    void
    onTestSkipped(org.testng.ITestResult iTestResult)
    This method is called when a TestNG test is skipped.
    void
    onTestStart(org.testng.ITestResult iTestResult)
    This method is called when a TestNG test starts.
    void
    onTestSuccess(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, wait

    Methods 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:
      onStart in interface org.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:
      onFinish in interface org.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:
      onTestStart in interface org.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:
      onTestSuccess in interface org.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:
      onTestFailure in interface org.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:
      onTestSkipped in interface org.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:
      onTestFailedButWithinSuccessPercentage in interface org.testng.ITestListener
      Parameters:
      iTestResult - The result of the current test.