Assert a transition or page state
browser_assertAssert web page changes and verify exact transitions using stored diff evidence or live page checks, including element changes, existence, and visibility.
Instructions
Assert the EXACT transition already read from browser_verify by passing its diffId: immutable, full diff evidence; no new observation and no baseline or id-epoch advance. Stored results return diffId, beforeObservationId, afterObservationId, observationId (the historical after observation), baselineAdvanced: false and evidenceSource: stored. Historical evidence survives later navigation; its element ids are historical, not actionable — find again before acting. Stored diffs support ONLY changed, mustInclude, mustNotInclude, only, maxChanges, becameVisible and becameCovered. Mixing diffId with exists, notCovered, url/urlIncludes, ignore, settleMs, retry or keepBaseline (even false) is pass:false; use a separate live assertion for current page predicates. Unknown, expired, evicted, foreign-session or privacy-invalidated ids return pass:false with error {code: DIFF_UNAVAILABLE, message}, never a live fallback. Without diffId, the existing LIVE assertion mode checks the diff since the last observation and consumes its baseline at the END unless keepBaseline:true; calling it after verify therefore checks a NEW interval. Checks any combination of: url (substring of the current URL), changed (expect the diff since the last observation to be true/false — the faithful negative makes "my action did nothing" ASSERTABLE), mustInclude ([{kind, role, name}] entries that must appear in the diff; kind ∈ added/removed/content/state/style/moved/resized — a framework re-render that REPLACES a node reports kind possible-replacement, and added/removed matchers accept it with STRICT side reading: an added matcher matches the after-side name/role, a removed matcher matches ONLY the before-side name/role (never the after side; selector specs never match through the alias), and the check result says "found (via possible-replacement — identity ambiguous)" instead of a plain green), exists (text findable anywhere on the page), notCovered (text whose best match must not be occluded). FAIL-LOUD CONTRACT: unknown spec keys, empty specs and missing baselines are hard pass:false with a reason — confusion never looks green. Returns structured {pass, hasBaseline, attempts, checks[], changes[]}; the diff evidence (with state from/to) travels with every result. Also: mustNotInclude (assert side-effect ABSENCE), maxChanges, becameVisible/becameCovered (actionability deltas), mustInclude entries accept selector and to:{state:value} (directional state — assert the menu IS open), settleMs and retry:{budgetMs} re-walk against the SAME baseline until pass or budget (CSS transitions land mid-flight). exists searches accessible names AND page text. SPA soft navs: results with a baseline include navigated:true + baselineUrl when the URL moved since the baseline was taken — that diff spans two pages of one document; re-observe on settled content (non-zero, stable actionables) before trusting change-based checks.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | No | live mode only: substring the current URL must contain | |
| only | No | change scoping: EVERY change must match one of these matchers; this does not establish causality | |
| retry | No | live mode only: re-walk against the SAME baseline until pass or budget | |
| diffId | No | opaque evidence id from browser_verify: assert that stored full transition without observing; accepts only diff predicates, never live page checks or retry/ignore/baseline options | |
| exists | No | live mode only: text that must be findable on the current page | |
| ignore | No | live mode only: CSS selectors whose subtree changes are excluded (e.g. the agent toolbar) | |
| changed | No | expected changed value for the stored diffId, or for the diff since the last observation in live mode | |
| settleMs | No | live mode only: wait before the first walk | |
| sessionId | No | optional: the session this call belongs to (from browser_session_open). Omitted uses the shared default session. | |
| maxChanges | No | full diff must contain at most N changes (after ignore in live mode) | |
| notCovered | No | live mode only: text whose best match must not be occluded on the current page | |
| mustInclude | No | changes that must appear in the diff (selector = exact; to = expected state after, e.g. {expanded:true}) | |
| keepBaseline | No | live mode only: do not consume the diff baseline (peek mode — safe to retry); incompatible with diffId even when false | |
| becameCovered | No | an actionable matching this text must have become covered | |
| becameVisible | No | an actionable matching this text must have become visible | |
| mustNotInclude | No | changes that must NOT appear (assert absence of side-effects) |