Skip to content

expect_visible_by_testid

Assert that an element with a given testID is (or is not) currently rendered in the device accessibility tree. Snapshot-based — re-resolves on each retry. Pass exists=false to assert NOT visible. Pass timeoutMs to wait through animations / late mounts. Convenience wrapper over device_snapshot + manual scan.

NameTypeRequiredDefaultConstraintsDescription
testIDstringYesThe testID to look for in the accessibility tree.
existsbooleanNoDefault true (assert visible). Pass false to assert NOT visible.
timeoutMsnumberNomin: 0, integerPolling timeout in ms (default 0). Use 1000-3000 for late-mounted elements.
expect_visible_by_testid(testID: <string>)