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 clean up to ensure no dialog or windows is opened
USAGE: Add the following annotation before every class with JUnit tests: @ExtendWith(ScreenshotAfterTestFailExtension.class)
  • 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 clean up to ensure no dialog or window is opened
      Specified by:
      afterTestExecution in interface org.junit.jupiter.api.extension.AfterTestExecutionCallback
      Parameters:
      extensionContext - test run data