Class FailureAnalysis
java.lang.Object
net.thucydides.core.model.failures.FailureAnalysis
public class FailureAnalysis
extends java.lang.Object
Determine whether a given type of exception should result in a failure or an error.
By default, any exception that extends AssertionError is a FAILURE.
Any exception that extends WebdriverAssertionError and has a cause that is an AssertionError is also a FAILURE.
All other exceptions are an ERROR (except for StepFailureException as described below)
Any exception that extends StepFailureException and has a cause that meets the above criteria is classed as above. All other exceptions are an ERROR
You can specify your own exceptions that will cause a failure by using the serenity.fail.on property. You can also specify those that will cause an error using serenity.error.on.
-
Constructor Summary
Constructors Constructor Description FailureAnalysis()
FailureAnalysis(EnvironmentVariables environmentVariables)
-
Method Summary
Modifier and Type Method Description boolean
reportAsCompromised(java.lang.Class<?> testFailureCause)
boolean
reportAsError(java.lang.Class<?> testFailureCause)
boolean
reportAsFailure(java.lang.Class<?> testFailureCause)
boolean
reportAsPending(java.lang.Class<?> testFailureCause)
boolean
reportAsSkipped(java.lang.Class<?> testFailureCause)
TestResult
resultFor(java.lang.Class testFailureCause)
TestResult
resultFor(java.lang.Throwable testFailureCause)
TestResult
resultFor(StepFailure stepFailure)
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
FailureAnalysis
public FailureAnalysis() -
FailureAnalysis
-
-
Method Details
-
resultFor
-
reportAsFailure
public boolean reportAsFailure(java.lang.Class<?> testFailureCause) -
reportAsCompromised
public boolean reportAsCompromised(java.lang.Class<?> testFailureCause) -
reportAsPending
public boolean reportAsPending(java.lang.Class<?> testFailureCause) -
reportAsSkipped
public boolean reportAsSkipped(java.lang.Class<?> testFailureCause) -
reportAsError
public boolean reportAsError(java.lang.Class<?> testFailureCause) -
resultFor
-
resultFor
-