assert (that,
timeout, iframe, saveAs, retries, skipped), but the agent reasons over
a screenshot of the current viewport rather than the DOM (web) or
accessibility/XML hierarchy (mobile).
Use assertVisually when the condition is visual and fully inside the current
viewport, for example an event block sitting in the 11:30-12:00 row of a
calendar grid, or a detail inside a video frame or canvas drawing. Scroll the
target into view if necessary before calling it; otherwise use assert.
Parameters
Shorthand
Assertion text as a single string.Examples
assertVisually evaluates the assertion from the screenshot only and
skips capturing the accessibility/XML hierarchy. Reach for it when the screen is
rendered in a way the hierarchy cannot describe (for example a WebView with
multiple pages) or the condition is purely visual.
Related
In browser tests,softAssertVisually accepts the same parameters but records
an assertion failure and continues. It isn’t available on mobile. See the
soft assertions guide
for version requirements and stopping behavior.