uiplane for idiots — the 60-second version
The problem in one picture
The old matrix tested each button alone in a room:
[ render the Sverige button by itself ] → ✅ "it renders!"
…but in the real running app, that button lived on a screen you could never get to:
[ Home ] --click--> [ Bench ] (the app)
[ Sverige ] ← no door leads here. The button is stranded.
Green test, broken app. uiplane fixes this: it maps the app as rooms (planes) with doors (transitions), then walks the real app room by room and checks each button is there AND it actually did something.
The three words
- Plane = a screen / tab / dialog. A room.
- Transition = the click that moves you between rooms. A door.
- Surface = a button / pane on a room. The thing you check.
A plan is the whole map: rooms + doors + where you start.
What "RED" means (4 ways to fail)
- Unreachable — there's no door to the room. (The Sverige bug.)
- Absent — you got to the room, but the button isn't there. (Shipped build dropped it.)
- NotRan — the button is there, but clicking it did nothing / the pane is blank. (Empty data = RAGNARÖK.)
- (anything that isn't "got there + button present + it ran") → RED.
Only ReachableAndRan is green.
The 4 lines you actually write
let plan = UiPlan::new("Home")
.plane(UiPlane::new("Bench").surface(UiSurface::new("bench_chart")))
.edge("Home", "Bench", "click_tab:Bench");
let report = RobotPlan::walk(&plan, &mut my_driver);
assert!(report.is_green(), "{}", report.summary());
my_driver is a tiny thing that knows how to (a) tell which room it's in, (b) click a door, (c) list what buttons are present + which ones ran — all read from your app's state_json, never from looking at pixels.
Don't have a real app handy? Use the fake one
let mut driver = MockDriver::new("Home")
.with_transition("click_tab:Bench", "Bench")
.with_plane_state("Bench", ["bench_chart"], ["bench_chart"]); // present, ran
Flip ["bench_chart"] (ran) to [] and watch the SAME test go RED — that's how you prove the test can actually catch the bug ("sensitivity"). If it can't go red, it's testing nothing.
Why you should care
A green uiplane row means: a robot started the real app, walked to this screen through the actual doors, found this button, and saw it do real work — with no human looking at anything. That's the only kind of green worth trusting.