/biloba-go:flaky-specsfrom biloba-go
Diagnoses and prevents flaky Go/Ginkgo Biloba browser specs that pass locally but fail in CI, under load, or intermittently. Covers poll-based fixes, common anti-patterns like Immediate(), and timer-driven UI issues.
Ships in biloba-go. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Biloba polls by default: b.Click(sel), b.SetValue(sel, v), b.GetProperty(sel, name) already wait for readiness, act once, then stop. So the residual flake sources are (a) reads you take yourself, (b) the few verbs that can't poll, (c) signals that don't mean what they look like, (d) assertions that can never fail.
Master rule: never assert on a value you read exactly once. Poll it.
Failure artifacts (outlines, screenshots, poll trajectory) → debug-failures. Measuring a flake's rate, or confirming a fix → flake-hunt. Authoring baseline → write-tests. Method surfaces → api. Sibling skills are named here without a prefix; invoke one with the same plugin prefix you loaded this skill under.
| Symptom | Cause | Fix | § |
|---|---|---|---|
| Passes focused, fails when run with the suite | Network handlers accumulated across an Ordered container | assert hold.Count(); own b.NewTab() | 6 |
Fails only under -p / load | Single-shot b.Run read racing an async settle | Eventually(b.Run).WithArguments(expr) | 1 |
| Fails at an assertion, not at the interaction before it | b.Immediate() acted a frame early | delete the Immediate() | 2 |
| Times out consistently, not intermittently | Value is stably wrong — product bug, not a short timeout | read the poll trajectory; fix product-side | 4 |
| Spec on a countdown, debounce, "x minutes ago", or expiry is slow or timing-sensitive | It waits on the page's real timers | b.InstallClock + PauseAt, then RunFor/FastForward | 9 |
Durations of many specs or By steps sit at one value across a hunt (say, all near 2.5s) | Each waits out a timer of that length instead of observing what it guards | poll for the guarded fact, or put the timer on the page clock | 9 |
| Poll times out with "This tab's page clock is paused at …" | Polling doesn't advance a paused page clock | clock.RunFor/FastForward/Resume before the assertion | 9 |
| Getter times out on an element that's plainly there | Property is never defined on that element type | b.AllowMissing("name") | 5 |
| Green forever, even against a broken page | Vacuous assertion (empty scope / empty slice / t=0 idle) | anchor the subject first | 7 |
| Green in test, broken against a real server | Asserted the optimistic DOM, or a Go-side HTTP read | barrier on app state | 3 |
| "I ran it 30× and it was green" | The ordering was never forced | b.HoldResponse | 3 |
| Click appears to do nothing | Overlay swallowed it (fast Click is occlusion-blind) | b.BeClickable() gate, or b.Realistic() | 2 |
| Intermittent "could not find DOM element" on the line after a capture | The capture expanded the viewport; the page re-rendered on its breakpoint and unmounted the subject | capture something already in view (scroll, gate on b.BeInViewport(b.Fully())) | 7 |
| Assertion passes but asserts the opposite of your intent | Inverted BePrecededBy/BeFollowedBy | also assert the inverse doesn't hold | 4 |
Suite ends on Ginkgo's --timeout with no failing spec | A CDP call blocked with no deadline — Gomega can't preempt a blocked callback, so no poll deadline fires | Biloba's own commands are bounded and fail with deadline_exceeded/page_crashed/tab_closed/browser_gone; a hang is your own chromedp call on b.Context — give it a context.WithTimeout | debug-failures |
Single-shot b.Run read — the #1 flake source. b.Run is func(string, ...any) any, so it drops straight into Eventually:
// WRONG — reads the world once
var centered bool
b.Run(`isCentered()`, ¢ered)
Expect(centered).To(BeTrue())
// RIGHT — no wrapper closure needed for a scalar expr
Eventually(b.Run).WithArguments(`isCentered()`).Should(BeTrue())
Eventually(b.Run).WithArguments(`document.querySelector("#card").getBoundingClientRect().top`).
Should(BeNumerically("~", 40, 1)) // JSON numbers decode to float64 — never Equal(intLiteral)
WithArguments needs a pre-built string. For an interpolated or multi-line expr, build it first (expr := fmt.Sprintf(...)) or poll a closure that returns the decoded value. A poll that spans a navigation (a click that loads a new page, say) polls b.RunErr instead: b.Run fails the spec on any error, including the transient Inspected target navigated or closed, while Eventually(b.RunErr).WithArguments(expr) retries it.
Grep detector. Anchor on the decode target, not on b.Run( — multi-line scripts put , &x) lines away from the call and slip the obvious regex:
rg ', &(\w+)\)' -n # then check whether Expect(x)/Ω(x) follows within a few lines
Gate-then-re-read (TOCTOU). A matcher assertion followed by a getter is two reads; the page can re-render between them.
// WRONG
Eventually(".figure-frame").Should(b.HaveAttribute("data-block-id", Not(BeEmpty())))
id := b.GetAttribute(".figure-frame", "data-block-id") // …of what?
// RIGHT — .Capture writes the value from the read that satisfied the assertion
var blockID string
Eventually(".figure-frame").Should(b.HaveAttribute("data-block-id", Not(BeEmpty())).Capture(&blockID))
.Capture decodes into your Go type and writes only on a match (so ShouldNot captures nothing). Decoding is à la encoding/json — an impossible mismatch (a string into *int) fails immediately rather than waiting out the timeout. It returns a new matcher and leaves the receiver alone, so a matcher held in a variable is reusable with different targets (m.Capture(&idA), then m.Capture(&idB)). A JS object narrows into a struct naming a subset of its fields; Biloba's own structs (Box, ScrollOffset, BoxDelta, Cookie) only decode into the matching type or an any — a different struct is rejected, not half-filled. Absent-vs-zero decoding (**T) is the same rule as AllowMissing, below (§5). The any-returning getters take the same optional trailing pointer: b.GetProperty("#row", "offsetWidth", &n).
Don't null-guard against a remount in a matcher. A matcher poll re-resolves the selector from scratch every tick, so it retries straight through a portal migration or list re-key. document.querySelector(sel)?.x ?? '' guards belong only inside your own b.Run closure, where you hold a node reference.
Eventually(sel).Should(b.HaveProperty("dataset.side", "left")) // no guard needed
Prefer native geometry getters to b.Run — see §4.
Don't reach for b.Immediate(). It acts once and fails fast; fire a frame early and the spec fails downstream (a timed-out Eventually, or the app's own null is not an object) with nothing pointing back. If the default wait is short, widen it — don't drop to Immediate.
b.Click("#go") // polls until clickable, clicks once, stops
b.WithTimeout(5*time.Second).Click("#go") // tune the wait
Eventually("#out").Should(b.HaveClass("open"))// assert the observable outcome
Exists isn't interactive. A page that hydrates (React, Astro islands, anything that renders server HTML first) shows a clickable button before its handlers are attached, so an early click lands on dead HTML. A component that reads state after mounting (auth, say) first renders a default twin with the same label. Wait on a marker the app sets when it's ready (a data-ready from the mount effect, or a state-specific attribute), not on the element or its text.
The matcher form (Eventually(sel).Should(b.Click())) is for when you want to own the poll (custom Consistently, .And() composition). It dispatches once on first success and never re-fires, so it's safe on a toggle.
The one sanctioned Immediate(): set-and-confirm. Inside a polling closure the action must be Immediate(), or you get a poll inside a poll (wasteful, and the inner timeout muddies the failure output):
Eventually(func(g Gomega) {
b.Immediate().SetValue("#qty", 3) // acts once per iteration…
g.Expect("#qty").To(b.HaveValue("3")) // …until the value sticks against an optimistic revert
}).Should(Succeed())
Rule: action inside a polling closure ⇒ Immediate(); action outside one ⇒ neither closure nor Immediate().
A conditional interaction is a spec smell. if collapsed { click }, a HasElement branch before an action — it means the spec doesn't know its own state, and a check-then-act loop re-clicks every tick and oscillates a toggle. Fix determinism upstream: create your own element in a known state instead of inheriting one from an earlier Ordered spec, or barrier on app state (§3) before interacting. (Idempotence corollary: set-and-confirm re-fires its action, so it's correct for SetValue and a flake for a toggle click. There is deliberately no ClickWhen primitive.) A cycling control you must drive to a target state is the one exception, and its loop waits between clicks: outside any polling closure, read the state, click once, Eventually until the state changes, and repeat until it is the one you want.
Fast Click is occlusion-blind by design. It polls on visible + enabled, then calls element.click() — it will click straight through a modal scrim. When an overlay is possible:
Eventually("#submit").Should(b.BeClickable()) // + topmost-at-center
b.Click("#submit")
// or: b.Realistic().Click("#submit") // refuses to click through
The click records a hit-test and names the occluder in the failure artifacts, but only after a spec fails — it never changes whether one passes.
Two verbs genuinely can't poll — gate them by hand. b.SendKeysToWindowImmediately(...) (focus-free; only you know what should be focused) and the *Immediately plural verbs (ClickEachImmediately, SetPropertyForEachImmediately):
Eventually("input.search").Should(b.BeFocused())
b.SendKeysToWindowImmediately(biloba.Keys.Enter)
To send keys into a specific element use b.Type(sel, ...) — it focuses first and polls.
If the app renders optimistically and a later server frame reconciles, both obvious signals lie:
| Signal | What it actually proves |
|---|---|
| The DOM | The click handler ran. It's the optimistic copy — Eventually just re-reads it, and under load it can settle stably wrong. |
A Go-side HTTP read (GET /sessions/{id}) | The server persisted something. It bypasses the browser's event loop entirely — the tab may have done nothing with the response. |
b.GetJSValue("window.__x") — app state | The renderer itself applied the response. Use this. |
b.Run(`app.store.on("update", () => { window.__storeLog ??= []; window.__storeLog.push(app.store.state) })`)
b.Click("#save")
var log []string
b.GetJSValue("window.__storeLog", &log) // polls until defined; retries through undefined AND a thrown ReferenceError
Ω(log).Should(HaveExactElements("saving", "saved"))
Trap inside the fix: GetJSValue gates on definedness and nothing else. The ??= above is what makes "defined" and "an update landed" the same event. Point it at a log the app creates eagerly (this.__log = [] in the constructor — the natural implementation for anything shipped as product) and it returns [] on the first tick, gating nothing. Vacuous, permanently, and it never flakes so nothing draws attention. Against an eagerly-created path, poll the predicate:
var log []SaveEntry
Eventually(`window.__storeLog`).Should(b.EvaluateTo(ContainElement(HaveKeyWithValue("state", "saved"))).Capture(&log))
(Asymmetry: EvaluateTo's sub-matcher sees the raw JSON-decoded value — []any of map[string]any, so HaveKeyWithValue, not HaveField. .Capture gives you the typed []SaveEntry.) If you didn't write the ??= yourself, check how the path is created before trusting the barrier.
GetJSValue is the wrong tool wherever absence is meaningful — a ledger missing on about:blank (missing = quiet), window.__renderErrors missing (= no errors), a flag that must have survived a JS-only tab switch, a baseline count taken before the action. Those stay b.Run("window.__ledger ?? null"). That's correct, not a smell.
b.HoldResponseReconciliation bugs are ordering bugs (a stale response landing after a newer local write). They reproduce at ~1%, so "I ran it 30 times" proves nothing.
hold := b.HoldResponse(ContainSubstring("/api/settings"))
b.Click("#refresh") // fires the request…
hold.Await() // …blocks until its response is genuinely held in flight
b.Click("#rename") // drive the app into the racy window
hold.Release() // let the stale response land, on your schedule, every run
Ω(hold.Count()).Should(Equal(1))
var log []string
b.GetJSValue("window.__storeLog", &log)
Ω(log).Should(HaveExactElements("renamed")) // the stale response must not have clobbered it
Count/Release are facts about the network, not the page. Count says the response reached the tab's interceptor; Release returns when the release is signalled. Neither says the renderer has done anything with it — the barrier that actually proves that is the GetJSValue read above, not the Release() call. When the assertion is about what the app did with a response, pair the network fact with an app-state barrier (or the DOM the response produces) — never a sleep.
Release() frees them all and disarms the hold. So "response #1 is still in flight while #2 lands" is not expressible with the default — cap it:
hold := b.HoldResponse(ContainSubstring("/api/save")).Limit(1)
b.Click("#save"); hold.Await() // #1 held…
b.Click("#save"); Eventually(hold.PassedThrough).Should(Equal(1)) // …#2 passes straight through
hold.Release() // now #1 lands, last
Assert PassedThrough, not Count — the fixture under test is "#2 was NOT held," and Count()==2 only says that by inference from the limit. A regression that raises the limit to 2 keeps Count()==2 green while quietly destroying the ordering you pinned. hold.Held() is the other half — Held()+PassedThrough()==Count() always, and both are snapshots safe to poll.hold.ReleaseNext() releases the oldest still held and stays armed (fails loudly with nothing held — that means your sequencing is off). Await() always returns the oldest still held, so Await/ReleaseNext/Await walks arrival order.hold.Release(r) releases just the response Await() gave you and keeps the hold armed; releasing a response this hold isn't holding fails the spec. A bare hold.Release() is idempotent.Limit(n) is consulted only as each response arrives — set it when you build the hold; lowering it later releases nothing, raising it retro-holds nothing. Responses that passed through at the limit were never held, so Await() skips them; after a bare Release(), Await() returns the first response the hold intercepted rather than blocking.Await honors WithTimeout/WithContext set on the tab you built the hold from (b.WithTimeout(d).HoldResponse(url)); otherwise 30s. Count()/Held()/PassedThrough() are snapshots but safe to poll. Holds are force-released at spec end and by Prepare().b.NewTab() or assert Count(). And handlers are first-match-wins, so a second HoldResponse for a URL an earlier one already claims is dead code — re-arm the one you have with ReleaseNext (§6).getBoundingClientRect, scrollHeight/clientHeight, getComputedStyle, and compareDocumentPosition on rAF-injected nodes all settle after the element exists. Gating on "element exists" then reading geometry races the measure.
Use the native, layout-aware expressions — they poll until the element is present and has a non-degenerate box:
Eventually("#card").Should(b.HaveBoundingBox(HaveField("Height", BeNumerically("<=", 0.8*viewportH))))
Eventually(".hero .sec").Should(b.HaveOffsetTopWithin(".scroller", BeNumerically("<", 120)))
Eventually(".scroller").Should(b.HaveScrollOffset(HaveField("Top", BeNumerically("==", 0))))
Eventually("#tab").Should(b.BeAbove("#tile")) // pairwise: both boxes read in one atomic frame
Eventually("#note").Should(b.BeInViewport(b.Fully())) // wholly on screen, not merely laid out
hex := b.GetComputedStyle(".rail", "--stage") // resolves custom properties
box := b.GetBoundingBox("#card") // Box{Top,Left,Width,Height,…,ClientWidth,ClientHeight}
Box.Width/Height are border-box; ClientWidth/ClientHeight are the scrollbar-excluded content box. Also: b.GetScrollOffset, b.GetOffsetTopWithin/GetOffsetLeftWithin, b.BeBelow/BeLeftOf/BeRightOf/Encloses/Overlaps, b.GetGapBetween/HaveGapBetween. Drop to Eventually(b.Run) only for what these don't cover (per-line getClientRects wrap detection, SVG path points, atomic act-then-measure, WebGL gl.readPixels, elementFromPoint hit-testing).
A backwards document-order assertion goes green, it doesn't flake. Eventually(X).Should(b.BePrecededBy(Y)) ⇔ X comes AFTER Y; b.BeFollowedBy(Y) ⇔ X comes BEFORE Y. These read backwards to most people, and on a fixture that happens to satisfy the inversion the spec silently tests the opposite of what you meant. Pin the direction from both sides:
Eventually(noteSel).Should(b.BePrecededBy(sectionSel)) // the note comes AFTER the section
Ω(noteSel).ShouldNot(b.BeFollowedBy(sectionSel)) // …and not before it
("Anywhere after" includes inside — scope with Locator.NotWithin when you mean "after Y but not nested in Y". On failure the message reports the order actually observed.)
A geometry poll that times out consistently is a product bug, not a short timeout. The DOM is real, but if the page computed the position once and never reconciled, the value is stably wrong and Eventually can't save you. Fix product-side (rAF-settle until the value holds, plus a bounded ResizeObserver), not with a wider timeout. The poll trajectory tells you which: flat = product bug, monotone = latency, dip-then-rebound = a late reflow (debug-failures).
GetProperty/GetProperties/GetAttribute/GetAttributes poll until the element is present and every named property/attribute is defined. That bites when the name doesn't exist on that element type — b.GetProperty("div.card", "disabled") polls to timeout even though the element was there all along.
b.GetProperty("div.card", b.AllowMissing("disabled")) // nil instead of a timeout
b.GetProperties("#user", "dataset.firstName", b.AllowMissing("dataset.middleName"))
The timeout message self-explains: it says the element was present, names the undefined property, and prints the exact b.AllowMissing(...) to paste. Read it before investigating.
AllowMissing only pays off if the decode target can hold "absent." A JS null/undefined decodes to the Go zero value, so a plain *string flattens "absent" and "present but empty" into the same "". Decode into a **T instead — absent leaves it nil, present allocates:
var key *string
b.GetAttribute(".mark", b.AllowMissing("data-key"), &key) // key == nil while the attribute is absent
Works for every decode target (.Capture and the getters' trailing pointer), and is re-evaluated on every observation, so a poll watching an absent → present transition stays honest.
GetValue/GetInnerText/GetTextContent have no "defined" axis (empty string is a valid value) — they poll on presence only and never need AllowMissing.
Ordered containerHandlers (StubRequest/AbortRequest/ModifyRequest/ModifyResponse/HoldResponse) are first-match-wins in registration order, and Prepare() is what clears them. With BeforeEach(func(){ b.Prepare() }, OncePerOrdered), Prepare() does not run between the Its — so handlers accumulate and a later identical handler is silent dead code.
There are two lists, one per stage: StubRequest/AbortRequest/ModifyRequest compete when a request pauses, and ModifyResponse/HoldResponse compete when its response does. A handler only shadows handlers in its own list. Across the two:
StubRequest or AbortRequest never reaches the network, so a response handler on the same URL never runs.ModifyRequest composes with a HoldResponse or ModifyResponse, in either registration order: both counts reach 1. When it rewrites the URL, the response handler may match either the URL the page requested or the one the request was sent to.No shadowed-handler note explains the cross-list cases, so assert each handler's Count().
Detector: an interception gate that times out only when the spec runs with the rest of the suite, and passes when focused alone. Check what ran before it in the same process before diagnosing anything else.
Shadowing is silent in both directions, and the green direction is worse. A leftover stateful handler — one keeping a counter — claims the response, and because its counter has moved on, passes it through untouched. The app behaves normally; the later spec's own counter stays 0; nothing hangs.
b.ModifyResponse(url).Using(func(r biloba.InterceptedResponse) biloba.StubResponse {
if atomic.AddInt32(&intercepted, 1) == 1 { /* mangle only the first */ }
return passthrough
})
Assert on your own interception state in every spec that installs a handler it depends on — the app's behavior can't tell you. Every registration returns a handle with its own Count() (stub.Count()/abort.Count()/mod.Count()/hold.Count()) — reach for that before hand-rolling a counter; only a Using() callback needing logic beyond counting still needs one:
Eventually(hold.Count).Should(Equal(1))
Eventually(func() int32 { return atomic.LoadInt32(&intercepted) }).Should(Equal(int32(1)))
On failure Biloba names both registration sites of a handler that never ran and was shadowed (debug-failures) — but that's a failure artifact, so the silently-green case still needs your own Count assertion.
Fixes: drive both orderings from a single It (usually reads better anyway), or give the holding spec its own b.NewTab() (handler lists are per-tab).
These pass every time, forever, against a completely broken page — and are usually written as the guard against exactly that breakage. The tell: the subject can be empty or absent, and the form treats empty-or-absent as success. Ask "what would make this fail?"
An unresolved locator scope matches nothing, so every negative assertion on it is satisfied instantly:
// WRONG — passes forever if #published-list never renders (the white screen this guard exists to catch)
Consistently(b.ByTextContains("Draft").Within("#published-list")).ShouldNot(b.Exist())
// RIGHT
Eventually("#published-list").Should(b.Exist())
Consistently(b.ByTextContains("Draft").Within("#published-list")).ShouldNot(b.Exist())
BeNetworkIdle means "zero in flight right now" — no quiet period — so it passes at t=0, before your click's fetch has left the page. When it times out, its failure message names each request still in flight (method, URL, resource type, and how long it has been in flight) as of the last attempt — read that before guessing. A request the page abandoned by navigating away no longer counts, so a stuck idle means a request of the current page. Anchor on the request first:
b.Click("#refresh")
Eventually(b).Should(b.HaveMadeRequest(ContainSubstring("/api/refresh")))
Eventually(b).Should(b.BeNetworkIdle())
A Current*ForEach snapshot returns an empty slice, which satisfies a negated collection assertion. These don't poll, so gate presence — the same gate keeps the negative honest:
Eventually(".row").Should(b.HaveCount(3))
Ω(b.CurrentInnerTextForEach(".row")).ShouldNot(ContainElement("Draft"))
Positive collection assertions are safer: Gomega's HaveEach errors on an empty slice, and the Each* matchers fail on zero matches (EachBeVisible/EachBeEnabled/EachHaveClass/EachHaveInnerText/EachHaveProperty/…): "≥1 match AND all satisfy", so they wait for elements to appear instead of passing vacuously. To assert nothing matches, use Eventually(sel).Should(b.HaveCount(0)) or ShouldNot(b.Exist()) — not the no-arg EachHaveInnerText()/EachHaveTextContent(), which assert the property is defined on every match (and capture the slice).
Two vacuous negations Biloba makes loud — both would otherwise be satisfied by an element that wasn't there:
ShouldNot(b.BeChecked()) on the wrapping <label>/<div> instead of the <input>: an element with no checked property is an error.ShouldNot(b.BeInViewport()) and the other geometry matchers on an element that never rendered: a missing element is an error (the pairwise/offset probes name which selector went missing).That costs the wait-for-teardown idiom. Gomega counts an assertion satisfied only when the matcher gives the desired answer and doesn't error, in either direction:
Eventually("#toast").ShouldNot(b.BeInViewport()) // WRONG — now times out
Eventually("#toast").ShouldNot(b.Exist()) // RIGHT
Eventually("#toast").Should(b.HaveCount(0)) // RIGHT
Same for HaveBoundingBox, HaveScrollOffset, HaveOffsetTopWithin/HaveOffsetLeftWithin, HaveGapBetween, the pairwise matchers, and any Consistently(sel).ShouldNot(...) on a conditionally-rendered sel. Exist/HaveCount answer "is it there?"; geometry matchers answer "where is it?" and presuppose it's there — same as BeVisible/BeEnabled/BeClickable always have.
Visual assertions have their own vacuous shapes (workflow and fixes → visual-assertions):
.actual.png so that someone looks at it before BILOBA_UPDATE_SCREENSHOTS=1 writes the baseline. Scripting "update until green", or committing the first run's output unopened, certifies whatever the page drew, a broken page included.BILOBA_UPDATE_SCREENSHOTS set in CI. Update mode captures, writes, and passes with no comparison, so the whole visual suite goes green. It tends to get added during one legitimate refresh and stay. Grep the CI config for it before trusting a green visual run, and keep it to local --focus-scoped runs.b.Tolerance(0.05) on a small element can absorb a whole component; b.ChannelTolerance(60) absorbs a colour change. Set the suite-wide default (BilobaConfigScreenshotTolerance / BilobaConfigScreenshotChannelTolerance) once against real evidence. A per-assertion tolerance that keeps growing means the subject is nondeterministic: b.Mask the region instead.overflow: auto pane's visible band was never painted, and a blank capture is a stable one. Biloba refuses the comparison and names the clipping ancestor; scroll the pane first (b.ScrollIntoView(sel, b.WithinScroller(pane)), then gate on b.BeInViewport(b.Fully())). Structural gates ([data-rendered] present, svg present) pass while the capture is blank.b.InColorSchemes("light","dark") drives prefers-color-scheme; an app whose theme was pinned (directly, via a helper, or by a leftover stored preference) ignores it and writes the same pixels to both baselines. Biloba warns when two schemes capture byte-identical images. Treat the warning as a finding.A capture that expands the viewport can destroy its own subject. Reaching content outside the viewport means expanding it; a responsive page re-renders on its breakpoint and can unmount the subtree being captured, so the spec fails on the line after the capture. Biloba expands only when it has to (a subject outside the viewport, or a document bigger than it) and reports the element matching X was present before this capture and gone after it. On that message, or an intermittent "could not find DOM element" right after a capture, capture something already in view: b.ScrollIntoView(sel), gate on b.BeInViewport(b.Fully()), then capture.
Three more vacuous shapes live with their smell and are covered above: the eagerly-created app-state barrier (§3), the inverted document-order assertion (§4), the shadowed stateful handler (§6).
Gate on a DOM readiness anchor, not on the URL. The URL flips the instant the router pushes it — the weakest available proof, and the one signal that races a live target swap.
b.Click("#submit")
Eventually("#dashboard-root").Should(b.Exist()) // the destination actually rendered
Ω(b.GetLocation()).Should(HaveSuffix("/dashboard")) // …now a formality
b.GetLocation()/b.GetTitle() are polling getters honoring all four knobs, and they treat a transient Inspected target navigated or closed (-32000) as a retryable miss. So Eventually(b.GetLocation) is safe; it's just still the weaker assertion.
Fast interactions act in place. b.Click/b.Tap do not scrollIntoView and do not move focus. If a scroll position changes around a fast click, the cause is app-side. Scroll-into-view comes only from b.Realistic() and from focus-bearing ops (b.Focus, b.SetValue, b.Type) whose .focus() scrolls its target. If a spec asserts on scroll position, keep focus-bearing ops off the element under test.
Never wait out a clock for a fact you can observe. A time.Sleep, or a timeout sized to outlast some timer, spends real time on a fact the spec could check directly. If the spec needs something observable (a request went out, a response arrived, an element rendered, an app-state flag flipped), poll for it. If it needs the timer itself to fire, take the timer off real time with the page clock, below. Specs that wait out a timer show up in a hunt's timing data: their durations cluster at the timer's period (flake-hunt).
A spec that waits for a real setTimeout (a debounce, a toast that hides after 3s, a countdown, a "5 minutes ago" label refreshed every 30s, a session expiry) is slow when it works and flaky under load when the timer and the poll deadline race. Don't widen the timeout — take the timers away from real time:
clock := b.InstallClock(t0) // before Navigate, so every timer the page creates is fake
clock.PauseAt(t0)
b.Navigate(appURL)
b.Click("#save")
clock.RunFor(300 * time.Millisecond) // the debounce fires now, deterministically
Ω(b.GetInnerText("#status")).Should(Equal("saved"))
RunFor runs every due timer and animation frame in order with promise callbacks in between, then returns; FastForward jumps and fires each due timer once. Three traps:
Eventually waiting for a timer-driven change times out, and the failure ends with This tab's page clock is paused at <t>; timers and animation frames won't run until you call RunFor, FastForward, or Resume. (for your own Eventually, it's the "Page clock paused" report entry). Advance the clock, then assert.Navigate, the clock misses timers the page already scheduled — those keep running on real time. Install first.InstallClock alone doesn't stop time. It flows from t0 at the real rate, so a chain of timers can finish before your first Eventually looks. PauseAt right after installing, as above, then step with RunFor.A trailing debounce never fires on a page that never goes quiet. An observer behind clearTimeout(t); t = setTimeout(sync, 120) is reset by every DOM change, so on a page that streams or animates (a live feed, a ticker) the derived UI never updates and the poll times out. Whether a quiet gap appears depends on load, so the spec can pass alone and fail in every full run. It's a product bug: throttle instead (if (!t) t = setTimeout(() => { t = 0; sync() }, 120)), and add a spec that churns the DOM while it acts.
CSS animations and transitions aren't on the clock (the screenshot freeze handles those); frames in another process (full Chrome's cross-site iframes) run on real time.
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub onsi/biloba --plugin biloba-go12 skills in this plugin
/apiOne-line reference for every Biloba Go method and matcher, grouped by area — selectors/locators, lifecycle, poll-config (WithTimeout/WithPolling/WithContext/Immediate), capturing a matcher's observed value (.Capture), navigation (GetLocation/GetTitle), cookies/storage, tabs, cross-origin iframes (b.Frame frame handles), DOM existence/visibility/contents/properties/forms, clicking and interactions (incl. drag/scroll/tap/modifiers/text-selection), realistic mode, keyboard, uploads, element JS, dialogs, downloads, arbitrary JS (incl. the GetJSValue app-state barrier), network stubbing/aborting/modifying/observing/holding (HoldResponse + Limit/ReleaseNext), screenshots/screencasts/outline/window, the page clock (InstallClock/Clock + PauseAt/Resume/RunFor/FastForward/SetFixedTime/SetSystemTime), and visual regression (HaveScreenshot + Mask/Tolerance/ChannelTolerance/Animated/InColorSchemes). Use to look up the exact Go method or matcher name and shape. Methods marked (dual) poll until they succeed when fully applied and return a pollable matcher when under-applied./debug-failuresSee why a Go/Ginkgo Biloba spec failed or flaked — the on-failure artifacts (DOM outline + screenshots + poll trajectory of the timed-out read + the visual-regression diagnosis with its .actual.png/.diff.png, the "never settled" warning an update run prints + the detached-node "matched then stopped matching" signal + the occluded-click diagnosis naming what covered the target), how Biloba auto-adapts to humans vs CI vs AI agents, the env vars and config knobs that surface them (BILOBA_SCREENSHOTS_DIR, BILOBA_SCREENSHOT_BASELINES_DIR, BILOBA_UPDATE_SCREENSHOTS, BILOBA_INLINE_SCREENSHOTS, BILOBA_OUTLINE_MAX, BILOBA_INTERACTIVE, BilobaConfig*), attaching app/store state to a failure, headless quirks (stale innerText, unscheduled requestAnimationFrame), and using b.Outline()/b.A11yOutline() to understand why a selector did not match. Use when a browser spec is failing or flaky and you need visibility, or to configure failure output for CI/agents. For *preventing* flakes (single-shot reads, avoiding b.Immediate(), optimistic-UI) see this plugin's flaky-specs skill./explore-unfamiliar-pageOrient to an unfamiliar page, then draft a starter Go/Ginkgo Biloba spec from its DOM outline, accessibility tree, and screenshot. Use when writing browser tests against a URL or fixture you have not seen. Covers the orient-author-cleanup loop and accepts a URL or fixture argument when invoked explicitly./flake-huntRun a flake hunt on a Biloba Ginkgo suite — run the whole browser suite many times (60 by default), every run to completion with its own JSON report, then read each spec's failure rate, the seeds, and Biloba's failure evidence out of those reports instead of re-running. Covers the hunt script (compile once, --procs at the measured knee, --randomize-all, --poll-progress-after, a per-run BILOBA_SCREENSHOTS_DIR), why --repeat and --until-it-fails can't measure a rate, what keeps a hunt a valid measurement (one hunt at a time on an idle machine, nothing editing the tree, focused hunts for iterating only, stale visual baselines), how many clean runs it takes to call a flake dead, reading the results (one systemic race behind many names, wedges, a long tail that clusters by run), and the performance record a hunt produces (spec timing, parallel efficiency, per-spec cost, drift between hunts). Use before declaring a flake fixed, after changing shared test helpers or fixtures, at the end of a batch of work, or to measure a suite's performance./look-at-pagesLook at your own UI while you iterate on it, with Go/Ginkgo Biloba — a throwaway spec that screenshots a page across colour schemes (light/dark via b.SetMedia) and viewport sizes (phone via b.SetWindowSize + b.Mobile()/b.TouchScreen()), plus the text views an agent can read without an image (b.Outline, b.A11yOutline, GetBoundingBox, GetComputedStyle, AllConsoleMessages/AllPageErrors), the states worth capturing (focus, open menus, dialogs, CSS :hover via b.Realistic(), error states via StubResponse, long content), and turning what you saw into assertions (Encloses and the other layout matchers, HaveScreenshot with InColorSchemes). Use when asked to look at, review, or screenshot a page or design (light/dark, phone/desktop) rather than to test it. For drafting a first spec against a page you haven't seen, see explore-unfamiliar-page./overviewThe Biloba mental model for writing browser tests in a Go Ginkgo/Gomega suite — pragmatic simulation, poll-by-default, dropping to chromedp, and visual regression against committed baselines. Use first when starting with Biloba or deciding whether it fits a Go browser-testing task. Routes to the other skills in this plugin.Other plugins' skills for the same job