Skip to content

[BUG] repeat with while: visible: executes only once instead of looping until element disappears #23

@7ammer

Description

@7ammer

Description

repeat with while: visible: only executes once, even when the element remains visible. When deleting items from a list, only one item is removed. Using times: X works correctly.

Steps to Reproduce

  1. Run command maestro test my-flow.yaml
  2. With flow file (see below)
  3. Observe that only one item is deleted and the assertion fails

Expected Behavior

The flow should continue tapping "Delete" while the element is visible, removing all matching items until none remain.

Actual Behavior

The repeat block runs only once. One item is removed, but remaining "Delete" elements are still visible. The final assertion fails.

Environment

  • OS: macOS 14.0
  • Go version: go1.21.0
  • maestro-runner version: 1.0.7
  • Executor: UIAutomator2
  • Device/Simulator: Pixel 6 API 34 Emulator

Flow File

appId: abc
---
- repeat:
    while:
      visible: "Delete"
    commands:
      - tapOn: "Delete"
- assertNotVisible: "Delete"

Error Output

✓ tapOn (672ms)
✓ repeat (222ms)
  ✓ tapOn (189ms)
✗ assertNotVisible (5.6s)
  ╰─ Element should not be visible but was found

Additional Context

If the same flow uses:

- repeat:
    times: 5
    commands:
      - tapOn: "Delete"

it repeats correctly. The issue appears specific to while: visible:.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions