Class ScreenShotExtension
java.lang.Object
co.verisoft.fw.selenium.junit.extensions.ScreenShotExtension
- All Implemented Interfaces:
org.junit.jupiter.api.extension.BeforeTestExecutionCallback
,org.junit.jupiter.api.extension.Extension
,org.junit.jupiter.api.extension.TestExecutionExceptionHandler
public class ScreenShotExtension
extends Object
implements org.junit.jupiter.api.extension.TestExecutionExceptionHandler, org.junit.jupiter.api.extension.BeforeTestExecutionCallback
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
beforeTestExecution
(org.junit.jupiter.api.extension.ExtensionContext context) Initializes the screenshot storage by creating a new HashMap and storing it in the local thread store, allowing for screenshot capture during test execution.void
handleTestExecutionException
(org.junit.jupiter.api.extension.ExtensionContext extensionContext, Throwable throwable) If test has failed, take a screenshot and put it in the store
-
Constructor Details
-
ScreenShotExtension
public ScreenShotExtension()
-
-
Method Details
-
beforeTestExecution
public void beforeTestExecution(org.junit.jupiter.api.extension.ExtensionContext context) Initializes the screenshot storage by creating a new HashMap and storing it in the local thread store, allowing for screenshot capture during test execution.- Specified by:
beforeTestExecution
in interfaceorg.junit.jupiter.api.extension.BeforeTestExecutionCallback
- Parameters:
context
-
-
handleTestExecutionException
public void handleTestExecutionException(org.junit.jupiter.api.extension.ExtensionContext extensionContext, Throwable throwable) throws Throwable If test has failed, take a screenshot and put it in the store- Specified by:
handleTestExecutionException
in interfaceorg.junit.jupiter.api.extension.TestExecutionExceptionHandler
- Parameters:
extensionContext
-throwable
-- Throws:
Throwable
-