Golden image testing

Golden tests catch visual regressions that semantic tests cannot see: spacing drift, wrong colors, clipped text, broken gradients, font fallback, and target-specific rendering changes.
Use them after unit, reducer, and semantic tests. They are not a substitute for behavior tests.

Capture then compare

use fission_test_driver::{GoldenOptions, LiveTestClient};

let client = LiveTestClient::connect(control_port);
client.wait_for_ready(15_000)?;
client.simulate_resize(390, 844)?;
client.wait_for_idle(2_000, false)?;

client.compare_golden(
    "tests/goldens/settings-phone.png",
    Some(".artifacts/diffs/settings-phone.png"),
    GoldenOptions {
        channel_tolerance: 8,
        max_changed_percent: 0.2,
    },
)?;
compare_golden fails the test when the configured threshold is exceeded and writes the optional heatmap before returning. Keep golden images in the app repository. Review diffs manually when a design change is intentional.

Good golden scenarios

Scenario
Why it matters
Phone and desktop shell
Proves responsive layout branches.
Light and dark theme
Proves token usage.
Long translated strings
Proves text wrapping and i18n.
Modal/menu/popover
Proves portal geometry.
Charts and media surfaces
Proves renderer-specific output.
Release screenshots
Proves store assets before publishing.
Fission
A cross-platform, GPU-accelerated user interface framework for Rust. MIT licensed.
Copyright (c) 2026 Fission
Ready to use today. Widget APIs are expected to remain stable; some runtime and shell APIs may change before 1.0.0.
Fission 0.9.2