Class AssertionEvidenceReporter
Assert/Verify
validation, redacting secrets and diffing expected/actual values, so Allure attachments can show
exactly what a validation compared without leaking sensitive data or exceeding a bounded size.-
Method Summary
Modifier and TypeMethodDescriptionstatic StringrenderAccessibilityCard(boolean passed, Object expectedYaml, Object actualYaml) Renders a domain-consistent evidence card for an accessibility (aria snapshot) validation.static StringrenderCard(String categoryLabel, boolean passed, Object expected, Object actual) Renders a self-contained HTML "assertion evidence" card for one validation.static StringrenderVisualCard(boolean passed, long diffPixels, Integer maxDiffPixels, double diffRatio, Double maxDiffRatio) Renders a domain-consistent evidence card for a visual (screenshot) validation.
-
Method Details
-
renderCard
public static String renderCard(String categoryLabel, boolean passed, Object expected, Object actual) Renders a self-contained HTML "assertion evidence" card for one validation.- Parameters:
categoryLabel- "Assert" (hard) or "Verify" (soft) — as passed by ValidationsHelperpassed- true when the validation passedexpected- the reported expected value (may be null)actual- the reported actual value (may be null)- Returns:
- a complete self-contained HTML document string, or "" when there is nothing meaningful to show (both expected and actual are null/blank)
-
renderAccessibilityCard
public static String renderAccessibilityCard(boolean passed, Object expectedYaml, Object actualYaml) Renders a domain-consistent evidence card for an accessibility (aria snapshot) validation.Accessibility validations report their outcome as a pass/fail boolean, which
renderCard(String, boolean, Object, Object)deliberately skips because a "true vs false" flag carries no comparable content. This overload instead takes the expected/actual aria-snapshot YAML so the card can show the same bounded, redacted line diff assertion cards use — a summary line plus a deep attachment, rather than a full YAML dump in the step name (issue #3532 E).- Parameters:
passed- true when the aria snapshot matched its baselineexpectedYaml- the baseline aria-snapshot YAML (may be null/blank on first capture)actualYaml- the captured aria-snapshot YAML- Returns:
- a complete self-contained HTML document string, or "" when there is nothing meaningful to show (both sides are null/blank)
-
renderVisualCard
public static String renderVisualCard(boolean passed, long diffPixels, Integer maxDiffPixels, double diffRatio, Double maxDiffRatio) Renders a domain-consistent evidence card for a visual (screenshot) validation.Visual validations also report their outcome as a pass/fail boolean, so
renderCard(String, boolean, Object, Object)skips them; the pixel diff is attached separately as a native Allure image-diff viewer. This overload surfaces the numeric comparison metadata — diff pixels and diff ratio against their budgets — as a compact summary card, so the report answers "how far off was it?" in text without a full dump, and points at the attached image diff (issue #3532 E).- Parameters:
passed- true when the screenshot matched its baseline within budgetdiffPixels- number of differing pixels reported by the comparisonmaxDiffPixels- the pixel-count budget, ornullwhen none was configureddiffRatio- the differing-pixel ratio reported by the comparisonmaxDiffRatio- the ratio budget, ornullwhen none was configured- Returns:
- a complete self-contained HTML document string
-