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.
Parameters
Section titled “Parameters”| Name | Type | Required | Default | Constraints | Description |
|---|---|---|---|---|---|
testID | string | Yes | The testID to look for in the accessibility tree. | ||
exists | boolean | No | Default true (assert visible). Pass false to assert NOT visible. | ||
timeoutMs | number | No | min: 0, integer | Polling timeout in ms (default 0). Use 1000-3000 for late-mounted elements. |
expect_visible_by_testid(testID: <string>)