Skip to content

Keep a Maestro tap on its element when the list moves first - #1813

Merged
robertying merged 2 commits into
mainfrom
claude/project-thread-c0k917
Nov 24, 2026
Merged

robertying merged 2 commits into
mainfrom
claude/project-thread-c0k917

Conversation

@robertying

@robertying robertying commented Nov 24, 2026 •

Copy link
Copy Markdown
Owner

Requested by Rui · project thread

What

Adds scripts/e2e/maestro/maestro-look-alike-elements.patch to the patched Maestro build.

Why

When a tap comes right after a scroll, Maestro waits for its element to stop moving and finds it again in each new hierarchy by its attributes (bounds aside). Elements that look alike match more than once. The settings switches the flows tap with text: '0|1' inside a row's id all read 1 or 0, so the element counted as gone, and after 3 s Maestro tapped where it had been before the list settled. On the open iPhone Duo, 08-settings scrolled back to the Calendar Alert row, found its switch while the list was still moving, and the tap landed one row up on Event Length.

The patch:

  • tells look-alikes apart by the ids of the elements that hold them, taken from the hierarchy the element was found in (a scroll doesn't change them);
  • gives an element found with childOf the whole screen it was found on, as one found without childOf already has, rather than a hierarchy of the element alone.

This applies to every childOf tap and every look-alike element, not only this flow.

Testing

  • The patch series applies to the base commit in build.sh and builds.
  • maestro-client ViewHierarchyTest and UiElementTest: 12/12 pass. maestro-orchestra: 457 pass, 3 skipped.
  • 02-reset then 08-settings on the open and half-open iPhone Duo, twice each with this build and once each with the current build. With the current build the log shows "Element is not present in the fresh hierarchy" 28 times (open) and 14 times (half-open), and the open run fails at the Calendar Alert toggle. With this build that line never appears, and every tap after a scroll finds its element. The open run gets through every settings toggle.
  • 08-settings still fails on the Duo for reasons this change doesn't touch: in the half-open layout the Calendar Alert row has no switch element of its own, and on the open Duo the system Calendar app's search doesn't show the synced assignment.

🤖 Generated with Claude Code

https://claude.ai/code/session_01A5JNTkg61zLdbc9SCgGoMd

A tap right after a scroll waits for its element to stop moving, finding it
in each new hierarchy by its attributes. Look-alike elements, such as the
settings switches the flows tap by "0|1" inside a row's id, matched more
than once, so the tap went to where the element had been before the list
settled: on the open iPhone Duo, 08-settings turned the Calendar Alert row's
neighbor instead. A new Maestro patch tells look-alikes apart by the ids of
the elements that hold them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01A5JNTkg61zLdbc9SCgGoMd
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01A5JNTkg61zLdbc9SCgGoMd
@robertying
robertying marked this pull request as ready for review November 24, 2026 06:52
@robertying
robertying merged commit 7824f0d into main Nov 24, 2026
14 checks passed
@robertying
robertying deleted the claude/project-thread-c0k917 branch November 24, 2026 06:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants