flow_recording_wrap_in_condition
Make a RANGE of already-recorded steps conditional: they run at replay only when a check on screen passes.
Record the steps normally FIRST, then wrap them. That is the order conditionals are actually discovered — you do not know a promo banner is intermittent until you have already recorded dismissing it. The wrapped steps are MOVED into the branch, so a step never exists twice, and the remaining steps are renumbered.
The condition is evaluated against the element at (x,y), which must be on screen NOW so its locators can be recorded — the same binding every other element-bound action uses.
Use it for anything that appears only sometimes: a cookie banner, a first-run tutorial, an occasional interstitial, a rating prompt.
NOTE: at replay a condition that cannot be decided is treated as FALSE (the else branch runs). Set timeoutMs to the realistic worst-case render time of the thing you are checking for — too small a budget judges a slow element absent, runs the wrong branch, and the run still reports success.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| x | Yes | X of the element the CONDITION checks — not the element the wrapped steps act on. | |
| y | Yes | Y of the element the condition checks. | |
| check | Yes | What to check. exists/notExists test presence; textEquals/textContains compare an attribute. visualMatch is deliberately unavailable here — it is fail-safe by design, so as a branch selector it would silently always take the same branch. | |
| branch | No | Which branch the wrapped steps become. Default 'then' — run them when the check passes. | |
| expected | No | Expected value. Required for textEquals and textContains. | |
| attribute | No | Attribute to read for text checks. iOS: label, value, name. Android: text, content-desc, resource-id. | |
| timeoutMs | No | How long to wait for the check to become true before deciding it is false. Default 5000. | |
| recordingId | Yes | Recording ID from flow_recording_start | |
| toStepIndex | Yes | Last step to wrap (1-based, inclusive). | |
| fromStepIndex | Yes | First step to wrap (1-based). Step 1 is the appLaunch that seeds the start state and cannot be wrapped. |