Expand description
Visual regression testing for TUI applications
Provides comprehensive visual testing including color, style, and layout comparison. Unlike simple text snapshots, visual tests capture the full rendered appearance.
§Features
| Feature | Description |
|---|---|
| Full Render Capture | Colors, styles, and text |
| Diff Visualization | See exactly what changed |
| Threshold Testing | Allow minor variations |
| CI Integration | GitHub Actions, GitLab CI |
§Example
ⓘ
use revue::testing::{VisualTest, VisualTestConfig};
#[test]
fn test_button_styles() {
let mut test = VisualTest::new("button_styles");
// Render your widget
let buffer = render_button();
// Compare against golden file
test.assert_matches(&buffer);
}§Updating Golden Files
# Update all visual tests
REVUE_UPDATE_VISUALS=1 cargo test
# Update specific test
REVUE_UPDATE_VISUALS=1 cargo test test_button_stylesStructs§
- Captured
Cell - Captured cell data
- Cell
Diff - Difference in a single cell
- Visual
Capture - Captured visual state of a buffer
- Visual
Diff - Difference between two captures
- Visual
Test - Visual regression test instance
- Visual
Test Config - Configuration for visual regression tests
Enums§
- Visual
Test Result - Result of a visual test