Class ScreenshotAfterTestFailExtension
java.lang.Object
com.redhat.devtools.intellij.commonuitest.utils.testextension.ScreenshotAfterTestFailExtension
- All Implemented Interfaces:
org.junit.jupiter.api.extension.AfterTestExecutionCallback,org.junit.jupiter.api.extension.Extension
public class ScreenshotAfterTestFailExtension
extends Object
implements org.junit.jupiter.api.extension.AfterTestExecutionCallback
ScreenshotAfterTestFailExtension takes screenshot immediately after test has failed
and perform a cleanup to ensure no dialog or windows is opened
USAGE: Add the following annotation before every class with JUnit tests:
USAGE: Add the following annotation before every class with JUnit tests:
@ExtendWith(ScreenshotAfterTestFailExtension.class)-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidafterTestExecution(org.junit.jupiter.api.extension.ExtensionContext extensionContext) Take screenshot right after a test has failed and perform a cleanup to ensure no dialog or window is opened
-
Field Details
-
LOGGER
-
-
Constructor Details
-
ScreenshotAfterTestFailExtension
public ScreenshotAfterTestFailExtension()
-
-
Method Details
-
afterTestExecution
public void afterTestExecution(org.junit.jupiter.api.extension.ExtensionContext extensionContext) Take screenshot right after a test has failed and perform a cleanup to ensure no dialog or window is opened- Specified by:
afterTestExecutionin interfaceorg.junit.jupiter.api.extension.AfterTestExecutionCallback- Parameters:
extensionContext- test run data
-