Class ScreenshotRule

  • All Implemented Interfaces:
    org.junit.rules.TestRule

    @Deprecated
    public class ScreenshotRule
    extends TestFailureAwareRule
    Deprecated.
    Creates a PNG screenshot if there is a test failure. Please note, that creating the screenshot is not instant when a failure happens. It happens a few milliseconds after the failure, and it can show a different state.
    • Constructor Detail

      • ScreenshotRule

        public ScreenshotRule​(SeleniumProvider seleniumProvider)
        Deprecated.
    • Method Detail

      • onError

        protected void onError​(org.junit.runner.Description description,
                               java.lang.Throwable testFailure)
                        throws java.lang.Throwable
        Deprecated.
        Description copied from class: TestFailureAwareRule
        Called if the test has thrown an error. By default it does nothing.
        Overrides:
        onError in class TestFailureAwareRule
        Parameters:
        description - junit test description object
        testFailure - any error from the test
        Throws:
        java.lang.Throwable - this will be added to testFailure as suppressed exception. See Throwable.addSuppressed(Throwable)