Skip to content

expect_text

Assert that visible text is (or is not) currently rendered in the device accessibility tree. Default substring match; pass exact=true for full-string match. Pass exists=false to assert NOT visible. Convenience wrapper over device_snapshot + label scan; equivalent to Maestro’s assertVisible: ”…” but callable mid-batch and during interactive walks without leaving the LLM context.

NameTypeRequiredDefaultConstraintsDescription
textstringYesThe visible text to look for.
exactbooleanNoDefault false (substring match). Pass true to require exact label equality.
existsbooleanNoDefault true (assert visible). Pass false to assert NOT visible.
timeoutMsnumberNomin: 0, integerPolling timeout in ms (default 0).
expect_text(text: <string>)