Class TestNgListener
- java.lang.Object
-
- com.testomatio.reporter.core.frameworkintegration.AbstractTestFrameworkListener
-
- com.testomatio.reporter.core.frameworkintegration.TestNgListener
-
- All Implemented Interfaces:
org.testng.IInvokedMethodListener,org.testng.ISuiteListener,org.testng.ITestListener,org.testng.ITestNGListener
public class TestNgListener extends AbstractTestFrameworkListener implements org.testng.ISuiteListener, org.testng.ITestListener, org.testng.IInvokedMethodListener
TestNG listener for Testomat.io integration. Reports TestNG test execution results to Testomat.io platform. Supports custom annotations (@Title, @TestId) and handles disabled tests.
-
-
Field Summary
-
Fields inherited from class com.testomatio.reporter.core.frameworkintegration.AbstractTestFrameworkListener
resultConstructor, runManager
-
-
Constructor Summary
Constructors Constructor Description TestNgListener()Creates new TestNG listener.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidaddFrameworkSpecificData(TestResultWrapper.Builder builder, Object frameworkSpecificData)Adds framework-specific data to result wrapper builder.protected ResultConstructorcreateResultConstructor()Creates framework-specific result constructor.voidonFinish(org.testng.ISuite suite)Called when test suite finishes.voidonStart(org.testng.ISuite suite)Called when test suite starts.voidonTestFailure(org.testng.ITestResult result)Called when test fails.voidonTestSkipped(org.testng.ITestResult result)Called when test is skipped.voidonTestSuccess(org.testng.ITestResult result)Called when test passes successfully.-
Methods inherited from class com.testomatio.reporter.core.frameworkintegration.AbstractTestFrameworkListener
buildTestRunResultHolder, createTestResult, handleSuiteFinished, handleSuiteStarted, logAndReportResult, logTestReporting, normalizeStatus, reportTestResult, reportTestResult
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
-
-
Method Detail
-
createResultConstructor
protected ResultConstructor createResultConstructor()
Description copied from class:AbstractTestFrameworkListenerCreates framework-specific result constructor.- Specified by:
createResultConstructorin classAbstractTestFrameworkListener- Returns:
- result constructor for the specific test framework
-
addFrameworkSpecificData
protected void addFrameworkSpecificData(TestResultWrapper.Builder builder, Object frameworkSpecificData)
Description copied from class:AbstractTestFrameworkListenerAdds framework-specific data to result wrapper builder.- Specified by:
addFrameworkSpecificDatain classAbstractTestFrameworkListener- Parameters:
builder- result wrapper builderframeworkSpecificData- framework-specific data to add
-
onStart
public void onStart(org.testng.ISuite suite)
Called when test suite starts. Initializes suite tracking and reports disabled tests.- Specified by:
onStartin interfaceorg.testng.ISuiteListener- Parameters:
suite- TestNG test suite
-
onFinish
public void onFinish(org.testng.ISuite suite)
Called when test suite finishes. Completes suite tracking.- Specified by:
onFinishin interfaceorg.testng.ISuiteListener- Parameters:
suite- TestNG test suite
-
onTestSuccess
public void onTestSuccess(org.testng.ITestResult result)
Called when test passes successfully. Reports test as passed.- Specified by:
onTestSuccessin interfaceorg.testng.ITestListener- Parameters:
result- TestNG test result
-
onTestFailure
public void onTestFailure(org.testng.ITestResult result)
Called when test fails. Reports test as failed.- Specified by:
onTestFailurein interfaceorg.testng.ITestListener- Parameters:
result- TestNG test result
-
onTestSkipped
public void onTestSkipped(org.testng.ITestResult result)
Called when test is skipped. Reports test as skipped.- Specified by:
onTestSkippedin interfaceorg.testng.ITestListener- Parameters:
result- TestNG test result
-
-