Skip to content

Feature request: native absence assertion (is absent / wait gone) #2236

Description

@Procopis-QG

There's currently no in-script way to assert that an element is not present. Every selector-taking primitive — including is hidden — fails with Selector did not match when the selector resolves to nothing, so is hidden can only distinguish "resolvable but hidden" from "visible", not "gone". (#1515 improved the error taxonomy around this for wait, but there's still no positive assertion for absence.)

On React Native this bites hard: RN typically unmounts hidden UI rather than hiding it, so "the modal closed", "the spinner went away", "the badge is no longer shown" are all non-existence checks — and none of them can be expressed inside a test/replay script today.

Our workaround

We lift these assertions out of the replay script and run them as separate is hidden probes between agent-device test segments, treating Selector did not match on the probe's exit as a pass (polled for the wait-style variant). It works, but it splits one logical script into several invocations and loses the single-run reporter timeline.

Suggested shapes

Either of these would remove the workaround:

  • is absent <selector> — passes when the selector resolves to nothing (or only to a hidden element), fails when a matching element is visible.
  • wait gone <selector> [timeoutMs] — polls until the selector no longer matches, symmetrical with the existing wait <selector>.

Happy to provide more detail on the RN unmount semantics or scripts that reproduce the gap.

Activity

  1. thymikee commented on Sep 2, 2026

    @thymikee
    Member

    Confirmed as a valid command-surface gap. This stays needs-triage rather than ready-for-agent until a maintainer chooses the contract: whether absence means no selector match or no visible match, whether the canonical surface is an is predicate or a polling wait form, and how timeout/error reporting and replay recording should behave. The RN unmount example is sufficient motivation; no additional reporter evidence is needed right now.

  2. thymikee commented on Sep 3, 2026

    @thymikee
    Member

    Resolved by #2245 and #2264. The native surface now supports strict zero-match is absent <selector> and wait absent <selector> [timeoutMs], including typed failure reporting, replay/recording behavior, CLI/MCP/client contracts, documentation, and iOS/Android validation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions