Class ErrorsCollector

java.lang.Object
com.codeborne.selenide.logevents.ErrorsCollector
All Implemented Interfaces:
LogEventListener
Direct Known Subclasses:
SoftAssertsErrorsCollector

@ParametersAreNonnullByDefault public class ErrorsCollector extends Object implements LogEventListener
  • Field Details

  • Constructor Details

    • ErrorsCollector

      public ErrorsCollector()
  • Method Details

    • copy

      public ErrorsCollector copy()
      Make a copy of this collector. Used to take over errors collected in "before all" to each test.
      Returns:
      A new collector that contains all errors collected by this collector
    • isEnabled

      protected boolean isEnabled()
    • afterEvent

      public void afterEvent(LogEvent event)
      Specified by:
      afterEvent in interface LogEventListener
    • beforeEvent

      public void beforeEvent(LogEvent currentLog)
      Specified by:
      beforeEvent in interface LogEventListener
    • cleanAndGetAssertionError

      @Nullable public AssertionError cleanAndGetAssertionError(String testName, @Nullable Throwable testFailure, boolean fullStacktraces)
      1. Clears all collected errors, and 2. returns SoftAssertionError if there were some errors
      Parameters:
      testName - any string, usually name of current test
    • cleanAndThrowAssertionError

      public void cleanAndThrowAssertionError(String testName, @Nullable Throwable testFailure, boolean fullStacktraces)
    • validateAssertionMode

      public static void validateAssertionMode(Config config)
    • toString

      public String toString()
      Overrides:
      toString in class Object