Package core.support.listeners
Class TestListener
- java.lang.Object
-
- core.support.listeners.TestListener
-
- All Implemented Interfaces:
org.testng.IClassListener,org.testng.IConfigurationListener,org.testng.ISuiteListener,org.testng.ITestListener,org.testng.ITestNGListener
public class TestListener extends Object implements org.testng.ITestListener, org.testng.IClassListener, org.testng.ISuiteListener, org.testng.IConfigurationListener
-
-
Field Summary
Fields Modifier and Type Field Description static StringCONSOLE_PAGESOURCE_ON_FAILstatic StringFAILED_RERUN_OPTIONstatic StringFAILED_RERUN_SUITE_NAMEstatic List<String>FAILED_RERUN_SUITE_PASSED_TESTSstatic StringGLOBAL_SKIP_TESTSstatic StringGLOBAL_SKIP_TESTS_MESSAGEstatic booleanisTestNGstatic StringPARALLEL_TEST_TYPE
-
Constructor Summary
Constructors Constructor Description TestListener()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcleanupProcessess()kills all process for clean startStringgenerateTestMessage(org.testng.ITestContext iTestContext)voidonAfterClass(org.testng.ITestClass testClass)voidonBeforeClass(org.testng.ITestClass testClass)voidonConfigurationFailure(org.testng.ITestResult itr)voidonConfigurationSkip(org.testng.ITestResult itr)voidonConfigurationSuccess(org.testng.ITestResult itr)voidonFinish(org.testng.ISuite suite)voidonFinish(org.testng.ITestContext iTestContext)After ending all tests, below method runs.voidonStart(org.testng.ISuite suite)onStart (suite) runs before onStart(ItestContext)voidonStart(org.testng.ITestContext iTestContext)voidonTestFailedButWithinSuccessPercentage(org.testng.ITestResult iTestResult)voidonTestFailure(org.testng.ITestResult iTestResult)voidonTestSkipped(org.testng.ITestResult iTestResult)voidonTestStart(org.testng.ITestResult iTestResult)voidonTestSuccess(org.testng.ITestResult iTestResult)voidrunFailedTests(org.testng.ISuite suite)runs failed tests at end of suite updates junit report and extent test report areas affected: JunitReportReporter.java, ExtentManager.javavoidsetTestClassName(org.testng.ITestResult iTestResult)-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
-
-
Field Detail
-
isTestNG
public static boolean isTestNG
-
PARALLEL_TEST_TYPE
public static final String PARALLEL_TEST_TYPE
- See Also:
- Constant Field Values
-
CONSOLE_PAGESOURCE_ON_FAIL
public static final String CONSOLE_PAGESOURCE_ON_FAIL
- See Also:
- Constant Field Values
-
GLOBAL_SKIP_TESTS
public static final String GLOBAL_SKIP_TESTS
- See Also:
- Constant Field Values
-
GLOBAL_SKIP_TESTS_MESSAGE
public static final String GLOBAL_SKIP_TESTS_MESSAGE
- See Also:
- Constant Field Values
-
FAILED_RERUN_SUITE_NAME
public static final String FAILED_RERUN_SUITE_NAME
- See Also:
- Constant Field Values
-
FAILED_RERUN_OPTION
public static final String FAILED_RERUN_OPTION
- See Also:
- Constant Field Values
-
-
Method Detail
-
onStart
public void onStart(org.testng.ITestContext iTestContext)
- Specified by:
onStartin interfaceorg.testng.ITestListener
-
onFinish
public void onFinish(org.testng.ITestContext iTestContext)
After ending all tests, below method runs. The report is launched after the test suit finishes- Specified by:
onFinishin interfaceorg.testng.ITestListener
-
onTestStart
public void onTestStart(org.testng.ITestResult iTestResult)
- Specified by:
onTestStartin interfaceorg.testng.ITestListener
-
onTestSuccess
public void onTestSuccess(org.testng.ITestResult iTestResult)
- Specified by:
onTestSuccessin interfaceorg.testng.ITestListener
-
onTestFailure
public void onTestFailure(org.testng.ITestResult iTestResult)
- Specified by:
onTestFailurein interfaceorg.testng.ITestListener
-
onTestSkipped
public void onTestSkipped(org.testng.ITestResult iTestResult)
- Specified by:
onTestSkippedin interfaceorg.testng.ITestListener
-
onTestFailedButWithinSuccessPercentage
public void onTestFailedButWithinSuccessPercentage(org.testng.ITestResult iTestResult)
- Specified by:
onTestFailedButWithinSuccessPercentagein interfaceorg.testng.ITestListener
-
cleanupProcessess
public void cleanupProcessess()
kills all process for clean start
-
generateTestMessage
public String generateTestMessage(org.testng.ITestContext iTestContext)
-
onBeforeClass
public void onBeforeClass(org.testng.ITestClass testClass)
- Specified by:
onBeforeClassin interfaceorg.testng.IClassListener
-
onAfterClass
public void onAfterClass(org.testng.ITestClass testClass)
- Specified by:
onAfterClassin interfaceorg.testng.IClassListener
-
onConfigurationSuccess
public void onConfigurationSuccess(org.testng.ITestResult itr)
- Specified by:
onConfigurationSuccessin interfaceorg.testng.IConfigurationListener
-
onConfigurationFailure
public void onConfigurationFailure(org.testng.ITestResult itr)
- Specified by:
onConfigurationFailurein interfaceorg.testng.IConfigurationListener
-
onConfigurationSkip
public void onConfigurationSkip(org.testng.ITestResult itr)
- Specified by:
onConfigurationSkipin interfaceorg.testng.IConfigurationListener
-
setTestClassName
public void setTestClassName(org.testng.ITestResult iTestResult)
-
onStart
public void onStart(org.testng.ISuite suite)
onStart (suite) runs before onStart(ItestContext)- Specified by:
onStartin interfaceorg.testng.ISuiteListener
-
onFinish
public void onFinish(org.testng.ISuite suite)
- Specified by:
onFinishin interfaceorg.testng.ISuiteListener
-
runFailedTests
public void runFailedTests(org.testng.ISuite suite)
runs failed tests at end of suite updates junit report and extent test report areas affected: JunitReportReporter.java, ExtentManager.java
-
-