Class ValidationsHelper
java.lang.Object
com.shaft.validation.internal.ValidationsHelper
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidWrites an end-of-test Allure step summarizing every accumulated soft (verify) failure, in the order they occurred, before the test is force-failed.static AssertionErrorstatic voidrecordVerificationFailure(String failureMessage) Records a soft verification failure so it can be reported at the end of the test.static voidreportValidationState(ValidationEnums.ValidationCategory validationCategory, boolean validationState, Object expected, Object actual, List<List<Object>> attachments) Reports a validation outcome that was evaluated by a non-WebDriver backend while preserving the same checkpoint, attachment, and failure-reporting semantics used by WebDriver validations.static voidreportValidationState(ValidationEnums.ValidationCategory validationCategory, boolean validationState, Object expected, Object actual, List<List<Object>> attachments, long validationStartTime) Same asreportValidationState(ValidationEnums.ValidationCategory, boolean, Object, Object, List)with an explicit validation start timestamp so the reported outcome step carries the real validation duration.static voidreportValidationState(ValidationEnums.ValidationCategory validationCategory, boolean validationState, Object expected, Object actual, List<List<Object>> attachments, long validationStartTime, boolean richEvidenceAlreadyAttached) Same asreportValidationState(ValidationEnums.ValidationCategory, boolean, Object, Object, List, long)for callers that already attached authoritative comparison evidence through a different channel before invoking this method (e.g. a Playwright visual-diff image attached directly viaAllure.addAttachment).static void
-
Method Details
-
getVerificationErrorToForceFail
-
resetVerificationStateAfterFailing
public static void resetVerificationStateAfterFailing() -
attachVerificationSummary
public static void attachVerificationSummary()Writes an end-of-test Allure step summarizing every accumulated soft (verify) failure, in the order they occurred, before the test is force-failed. This gives a single place to see all verification failures instead of scanning the step list. No-op when there were no soft failures. Must be called beforeresetVerificationStateAfterFailing()clears the list. -
recordVerificationFailure
Records a soft verification failure so it can be reported at the end of the test.- Parameters:
failureMessage- the verification failure message to accumulate
-
reportValidationState
public static void reportValidationState(ValidationEnums.ValidationCategory validationCategory, boolean validationState, Object expected, Object actual, List<List<Object>> attachments) Reports a validation outcome that was evaluated by a non-WebDriver backend while preserving the same checkpoint, attachment, and failure-reporting semantics used by WebDriver validations.- Parameters:
validationCategory- the validation categoryvalidationState- true when the validation passedexpected- the reported expected valueactual- the reported actual valueattachments- report attachments prepared by the backend
-
reportValidationState
public static void reportValidationState(ValidationEnums.ValidationCategory validationCategory, boolean validationState, Object expected, Object actual, List<List<Object>> attachments, long validationStartTime) Same asreportValidationState(ValidationEnums.ValidationCategory, boolean, Object, Object, List)with an explicit validation start timestamp so the reported outcome step carries the real validation duration.- Parameters:
validationCategory- the validation categoryvalidationState- true when the validation passedexpected- the reported expected valueactual- the reported actual valueattachments- report attachments prepared by the backendvalidationStartTime- epoch milliseconds at which the validation started
-
reportValidationState
public static void reportValidationState(ValidationEnums.ValidationCategory validationCategory, boolean validationState, Object expected, Object actual, List<List<Object>> attachments, long validationStartTime, boolean richEvidenceAlreadyAttached) Same asreportValidationState(ValidationEnums.ValidationCategory, boolean, Object, Object, List, long)for callers that already attached authoritative comparison evidence through a different channel before invoking this method (e.g. a Playwright visual-diff image attached directly viaAllure.addAttachment). WhenrichEvidenceAlreadyAttachedistrue, the generic "Validation Test Data" Expected/Actual text attachments and the "Assertion evidence" card are skipped, since they would otherwise redundantly restate a boolean/opaque comparison result that carries no information beyond what the rich evidence already shows (issue #3804).- Parameters:
validationCategory- the validation categoryvalidationState- true when the validation passedexpected- the reported expected valueactual- the reported actual valueattachments- report attachments prepared by the backendvalidationStartTime- epoch milliseconds at which the validation startedrichEvidenceAlreadyAttached- true to skip the generic supplementary evidence attachments
-