Last active
January 9, 2020 00:46
-
-
Save automationhacks/ced041ae6153282dbf8674b5fcd00dba to your computer and use it in GitHub Desktop.
An implementation of TestListenerAdapter class with a custom implementation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Listener : TestListenerAdapter() { | |
override fun onStart(context: ITestContext) { | |
Logger.log("Beginning test suite: ${context.outputDirectory}") | |
} | |
override fun onFinish(context: ITestContext?) {} | |
override fun onTestSkipped(result: ITestResult?) {} | |
override fun onTestStart(result: ITestResult) { | |
super.onTestStart(result) | |
Logger.log("===>>> Test started: ${result.name}") | |
} | |
override fun onTestSuccess(result: ITestResult?) { | |
super.onTestSuccess(result) | |
if (result != null) { | |
Logger.log("<<<=== Test completed successfully: ${result.name}") | |
} | |
} | |
override fun onTestFailure(result: ITestResult) { | |
super.onTestFailure(result) | |
Logger.log("<<<=== Test failed: ${result.name}") | |
} | |
override fun onTestFailedButWithinSuccessPercentage(result: ITestResult?) {} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment