/biloba-go:realistic-modefrom biloba-go
Activates Biloba's realistic interaction track (b.Realistic()) in Go Ginkgo/Gomega tests for occlusion, CSS :hover, scroll-into-view, pointer drag, wheel scrolling, and touch. Covers fast-vs-realistic capability matrix, inline/per-spec/per-suite patterns, and BeClickable() as a cheaper occlusion guard.
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.
Two interaction tracks on the same tab:
b) — atomic JS simulations: a click is element.click() after synchronous visibility/enabled checks. No scroll, no occlusion test, no real :hover. What you want for the bulk of specs.b.Realistic()) — a *Biloba view of the same tab whose interactions run through real Chrome DevTools Protocol input. The default b is untouched.rb := b.Realistic()
rb.Click("#submit") // scrolls into view, waits for stability, refuses to click through an overlay, real mouse click
Eventually(".menu").Should(rb.Hover()) // moves the real pointer → CSS :hover activates
Docs: https://onsi.github.io/biloba/#realistic-interactions. Sibling skills are named here without a prefix; invoke one with the same plugin prefix you loaded this skill under.
Quarantine it to a handful of smoke tests. It costs real round-trips and can reintroduce the timing flake the atomic model avoids — that's the deliberate, opt-in cost.
| You need to test | Why the fast track misses it |
|---|---|
| A click must route around an occluding overlay | fast Click is el.click() — it clicks straight through |
A menu/tooltip opens on CSS :hover | fast Hover fires JS pointer events; CSS :hover never activates |
| Element is off-screen / below the fold and must scroll in | the fast track never scrolls |
| A pointer drag (@dnd-kit, Sortable, custom DnD) | needs real pointerdown/move/up |
| Real wheel scrolling of the page, or touch | needs trusted CDP input |
To merely assert an element isn't occluded, use the cheaper deterministic matcher Eventually(sel).Should(b.BeClickable()) (visible + enabled + topmost-at-its-center) — no realistic round-trips.
Realistic mode works inside a cross-origin iframe through its frame handle — b.Frame(...).Realistic().Click(...) translates the point into the tab and fails (keeps polling) if the embedding page covers the frame there; an out-of-process frame (full Chrome, cross-site) gets real input but no embedding-page occlusion check. Geolocation, locale, permissions, and network conditions are emulation, not interaction: b.SetGeolocation, b.SetLocale, b.SetPermissions, b.SetOffline (api).
"Topmost at its center". Biloba takes the center of the element's visible part (the part inside the viewport) and calls document.elementFromPoint there. The element is topmost when the hit is the element or something inside it (shadow DOM included). A sticky header, modal backdrop, banner, or tooltip covering that point means it isn't: Biloba scrolls the element to the viewport center and re-checks, and a target still covered there keeps polling and fails "obscured by another element". It tests one point, not the whole box (a covered edge with a clear center passes), and pointer-events: none overlays don't count.
Selection is track-agnostic (CSS, >>>, locators, XPath all work through either handle). The interactions differ:
| Interaction | Fast (b) | Realistic (b.Realistic()) |
|---|---|---|
Click | el.click(), no scroll/occlusion test | scroll to center (skipped when already fully on screen and topmost), wait for stability, verify enabled + topmost (no click-through), real mouse press/release. Coords inside same-origin >>> iframes are translated |
DblClick/RightClick/MiddleClick | synthetic dblclick/contextmenu/auxclick | scroll + stability + occlusion + real button input (native context menu fires) |
ClickEachImmediately | clicks all visible+enabled matches | real input, scrolling and re-measuring each in turn; skips hidden/disabled/off-screen/obscured |
Hover | JS pointer/mouse events; no CSS :hover | real pointer → CSS :hover activates |
SetValue | sets value, fires input/change (no typing) | text inputs: real click → clear → real keystrokes → blur; checkboxes: real click. Native pickers (radio/<select>/multi) fall back to fast JS |
Type | real CDP key events already | additionally scrolls the element into view first |
SendKeysToWindowImmediately | real CDP key events already | no target element — nothing to scroll |
pointer options b.At(x,y)/b.Shift()… | any option switches a click off native el.click() to a synthetic event carrying coords + modifier flags | real CDP input honoring the offset (translated, bounds-checked) + modifier bitmask |
DragTo | pointerdown/move/up events, both centers measured in one atomic read | real CDP mouse drag; both endpoints measured at one scroll position, and it fails if no position shows both |
ScrollWheel | synthetic wheel + manual ancestor scroll | real CDP wheel — trusted input, scrolls the page |
Tap | synthetic touch/pointer + click | real CDP touchStart/touchEnd |
Focus | plain JS .focus() | same — real engines focus without a side-effecting click |
Full vocabulary (DblClick, RightClick, MiddleClick, b.At/b.Shift/b.Ctrl/b.Alt/b.Meta, DragTo, ScrollWheel, Tap, Type) → write-tests, api.
Realistic interactions poll by default too. b.Realistic() is the same shallow *Biloba-clone as the poll-config handles, so it composes with them: b.Realistic().WithTimeout(5*time.Second).Click("#submit"). A fully-applied rb.Click(sel) polls (scroll + stability + occlusion + click) until it succeeds — no Eventually wrapper needed. The matcher form is still there when you want to own the poll.
Scroll-into-view lives only on this track (plus the focus-bearing SetValue/Type, whose .focus() scrolls). A fast Click/Tap never moves the page — so if a scroll/layout spec needs the viewport held still, stay fast; and if scroll position shifts around a fast click, the cause is app-side (flaky-specs §8).
There is deliberately no per-call decorator — the handle is the one seam, and it flows through helpers and Eventually exactly like b.
// 1. Inline — the handle is cheap to make
b.Realistic().DragTo("#card", "#done-column")
// 2. Per-spec
It("opens the hover menu", func() {
rb := b.Realistic()
Eventually(".nav-item").Should(rb.Hover())
Eventually(".nav-item .submenu").Should(b.BeVisible())
Eventually(b.ByRole("menuitem").WithName("Settings")).Should(rb.Click())
})
// 3. Per-suite, gated on a Ginkgo Label
var _ = Describe("checkout (realistic smoke)", Label("realistic"), func() {
var rb *biloba.Biloba
BeforeEach(func() { rb = b.Realistic() })
// ...use rb throughout; rb.Click fails while an overlay covers the target — the guard we want
})
ginkgo --label-filter='realistic' runs only that lane; --label-filter='!realistic' keeps it out of the fast inner loop.
rb.WithTimeout(d) for a slow scroll/settle; don't drop to Immediate().position: fixed footer is invisible to the fast track and solid to this one. el.click() does no hit-testing, so the fast track reaches an element the footer sits on top of; real pointer input lands on the footer. A spec that passes fast can fail once it switches to b.Realistic(), because a row near the bottom of a short list is genuinely underneath the footer. Both tracks are behaving correctly — a user couldn't reach that element either. Scroll it clear (b.ScrollIntoView(sel, b.AtTopOffset(px))) instead of suspecting your interaction code.DragTo drives pointer-based DnD (@dnd-kit, Sortable), not native HTML5 draggable (a separate drag-event model).overflow: auto list and endpoints in two separate panes. When no position shows both (rows further apart than their pane is tall) it fails and names both endpoints rather than pressing and releasing in the same place, which the page would receive as a click on the target. Widen the window with b.SetWindowSize, drag to a nearer target, or drive the scroll yourself through b.Context.DragTo is the whole gesture — press, moves and release in one call. There is no seam to assert in, so a spec whose subject is the mid-drag state (a tree row that auto-expands on a hover dwell, a drop-target highlight, a spring-loaded folder) drives the pointer itself with b.Pointer(). It does not scroll, so both endpoints must already be on screen; measure both before the press, for the same reason DragTo does (b.GetBoundingBox reports in the viewport CSS px MoveTo takes):
src, tgt := b.GetBoundingBox("#row"), b.GetBoundingBox("#folder")
p := b.Pointer()
p.MoveTo(src.CenterX, src.CenterY)
p.Down()
p.MoveTo(tgt.CenterX, tgt.CenterY)
Eventually("#folder").Should(b.HaveAttribute("aria-expanded", "true")) // button still down
p.Up()
b.Pointer() (a mouse) or b.Pointer(b.Pen()) (every event has pointerType: "pen", pressure 0.5 while down) returns a *Pointer for custom gestures — drawing strokes, scrubbing a slider, mid-drag assertions. It is independent of Realistic(): always real CDP input, but no scroll-into-view, stability wait, or occlusion check, and each call dispatches at once, so the caller owns the timing (time.Sleep/time.Ticker between moves).
p.MoveTo(x, y) — viewport CSS px (the frame's viewport on a frame handle). One round trip on a tab.p.MoveToElement(sel) / p.MoveToElement(sel, b.At(dx, dy)) — the element's center, or an offset from its top-left. Polls until the element exists and is visible, with the knobs of the view the pointer came from (b.WithTimeout(d).Pointer()); a point outside the viewport fails (scroll it in first with b.ScrollIntoView).p.Down() / p.Up() — press/release the primary button where the pointer is; moves in between carry buttons: 1. Pressing twice or releasing an unpressed pointer fails the spec. A pointer left pressed is released when the spec ends.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
12 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.npx claudepluginhub onsi/biloba --plugin biloba-goOther plugins' skills for the same job