Class ValidationsHelper

java.lang.Object
com.shaft.validation.internal.ValidationsHelper

public class ValidationsHelper extends Object
  • Method Details

    • getVerificationErrorToForceFail

      public static AssertionError 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 before resetVerificationStateAfterFailing() clears the list.
    • recordVerificationFailure

      public static void recordVerificationFailure(String failureMessage)
      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 category
      validationState - true when the validation passed
      expected - the reported expected value
      actual - the reported actual value
      attachments - 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 as reportValidationState(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 category
      validationState - true when the validation passed
      expected - the reported expected value
      actual - the reported actual value
      attachments - report attachments prepared by the backend
      validationStartTime - 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 as reportValidationState(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 via Allure.addAttachment). When richEvidenceAlreadyAttached is true, 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 category
      validationState - true when the validation passed
      expected - the reported expected value
      actual - the reported actual value
      attachments - report attachments prepared by the backend
      validationStartTime - epoch milliseconds at which the validation started
      richEvidenceAlreadyAttached - true to skip the generic supplementary evidence attachments