Class PerfectoLogExtension
- java.lang.Object
-
- co.verisoft.fw.selenium.junit.extensions.PerfectoLogExtension
-
- All Implemented Interfaces:
org.junit.jupiter.api.extension.AfterTestExecutionCallback
,org.junit.jupiter.api.extension.BeforeEachCallback
,org.junit.jupiter.api.extension.Extension
public class PerfectoLogExtension extends Object implements org.junit.jupiter.api.extension.BeforeEachCallback, org.junit.jupiter.api.extension.AfterTestExecutionCallback
-
-
Constructor Summary
Constructors Constructor Description PerfectoLogExtension()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
afterTestExecution(org.junit.jupiter.api.extension.ExtensionContext context)
Executed after each test execution.void
beforeEach(org.junit.jupiter.api.extension.ExtensionContext extensionContext)
Executed before each test method.static void
setTagsAndTestName(String[] tags, String testName)
This function retrieves tags and a test name, storing them in the thread-local store for later use in reporting.
-
-
-
Method Detail
-
beforeEach
public void beforeEach(org.junit.jupiter.api.extension.ExtensionContext extensionContext) throws Exception
Executed before each test method.This method is executed before each individual test method and is responsible for retrieving tags and test name from the extension context and storing them in the thread-local store for later use in reporting.
- Specified by:
beforeEach
in interfaceorg.junit.jupiter.api.extension.BeforeEachCallback
- Parameters:
extensionContext
- The ExtensionContext representing the current test context.- Throws:
Exception
- if any error occurs during the execution of the method.- Since:
- 09.23
-
afterTestExecution
public void afterTestExecution(org.junit.jupiter.api.extension.ExtensionContext context) throws Exception
Executed after each test execution.This method is executed after test execution individual test method and is responsible for stopping the Perfecto Reportium test and reporting the test result (success or failure) based on the presence of an execution exception in the test context.
- Specified by:
afterTestExecution
in interfaceorg.junit.jupiter.api.extension.AfterTestExecutionCallback
- Parameters:
context
- The ExtensionContext representing the current test context.- Throws:
Exception
- if any error occurs during the execution of the method.- Since:
- 09.23
- See Also:
StoreManager.getStore(StoreType.LOCAL_THREAD)
,Store.getValueFromStore(Object)
,ReportiumClient
,TestResultFactory.createFailure(String)
,TestResultFactory.createSuccess()
-
setTagsAndTestName
public static void setTagsAndTestName(String[] tags, String testName)
This function retrieves tags and a test name, storing them in the thread-local store for later use in reporting.- Since:
- 10.23
- See Also:
StoreManager.getStore(StoreType.LOCAL_THREAD)
,Store.getValueFromStore(Object)
-
-