JUnit,TestNG, and Spring testing have test execution listeners as an extension mechanism. Test execution listeners seem to be a low level feature of interest to framework developers and tool developers.
What are the main use cases in which Test execution listeners are useful? Can they be useful to application developers?
In Case of testng the listners are the most remarkable thing for me. The testNg listners allows me to simplyfy the test method content and manage each test with server startup , user registration, populating artifacts need for tests . And also clear up the environment for each test cycle.
At the each listener level im performing following operations so i don’t have to bother about them in side my tests
IExecutionListener
ISuiteListener
Set environment properties ex- Key Store Paths
ITestListener
On Start
On Finish
IReporter
Generate TestNg Report,
Generate sure-fire report,
Export data for Dashboard