assertImageAgainstGolden
Captures the matched component and asserts it matches the stored golden image identified by goldenIdentifier, failing the test on a visual difference.
The golden image is loaded from the test resources at golden/<goldenIdentifier>.png and compared by structural similarity at threshold. On a mismatch the captured, expected and difference images are written to the build results directory for inspection, and an AssertionError is thrown describing the difference and the file locations.
When record mode is enabled, the captured image is written as the golden whenever no golden exists yet or the captured image already matches the stored one, and the assertion passes. On a mismatch record mode does not overwrite the golden; the diff is dumped and the assertion still fails, so a regression is never silently accepted as the new baseline.
Parameters
identifies the golden image; allowed characters are letters, digits, '_' and '-'.
the structural-similarity acceptance floor, where higher is stricter.
Throws
if the captured image differs from the golden beyond the threshold, or if the golden is missing while record mode is disabled.
if goldenIdentifier contains forbidden characters.
Captures the whole composition root and asserts it matches the stored golden image identified by goldenIdentifier.
Behaves identically to SwingNodeInteraction.assertImageAgainstGolden for missing goldens, record mode, mismatch output and naming rules.
Parameters
identifies the golden image; allowed characters are letters, digits, '_' and '-'.
the structural-similarity acceptance floor, where higher is stricter.
Throws
if the captured image differs from the golden beyond the threshold, or if the golden is missing while record mode is disabled.
if goldenIdentifier contains forbidden characters.
Asserts an already-captured image against the golden image identified by goldenIdentifier. Use this when the image was produced by captureToImage and possibly post-processed before comparing.
Behaves identically to SwingNodeInteraction.assertImageAgainstGolden for missing goldens, record mode, mismatch output and naming rules.
Parameters
the captured image to compare.
identifies the golden image; allowed characters are letters, digits, '_' and '-'.
the structural-similarity acceptance floor, where higher is stricter.
Throws
if image differs from the golden beyond the threshold, or if the golden is missing while record mode is disabled.
if goldenIdentifier contains forbidden characters.