Skip to content

fix(wda): settle before an action that follows a check - #269

Merged
omnarayan merged 1 commit into
devicelab-dev:mainfrom
luka-vladika-happening-xyz:fix/wda-settle-after-check
Nov 9, 2026
Merged

omnarayan merged 1 commit into
devicelab-dev:mainfrom
luka-vladika-happening-xyz:fix/wda-settle-after-check

Conversation

@luka-vladika-happening-xyz

@luka-vladika-happening-xyz luka-vladika-happening-xyz commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

The WDA driver settles before an action when the step before it may have moved the screen (two identical screenshots in a row, capped at 3 s). Any other step cleared that flag, so a check or a script between two taps made the second tap skip the settle.

A common shape: a tap opens a sheet, a check finds a field on it (WebDriverAgent reports the sheet's final frame while the sheet is still sliding up, so the check passes at once), and the next tap on the sheet goes out mid-slide and is lost. In our suite tapOn: "LOGARE", runScript, assertVisible of the username field, then tapOn the register button: the last tap went out 460 ms after the first, while the sheet still moved, and the flow then waited for the register screen in vain.

The change: in Execute, a step that neither acts on the screen nor moves it (actsOnScreen and movesScreen both false: an assert, a script, a flow's condition) leaves screenMayMove as it was. An action still sets it from movesScreen, so a step that acts and moves nothing (a copyTextFrom, say) clears it as before.

Cost: two screenshots before an action that follows a check after a moving step, when the screen is already still: about 70 ms each on a simulator, 110-150 ms each on a real iPhone. When the screen is still moving, the settle waits for it, which is the point.

Tests: TestExecuteSettlesAfterACheckBetweenTaps (a tap, a check, a script, a tap: the last tap settles) and TestExecuteSettlesOnlyAfterMovingStep extended (the flag is kept over a non-acting step and cleared by an action that moves nothing); both fail without the change. go test -race ./pkg/driver/wda/ ./pkg/executor/ ./pkg/flow/ passes; golangci-lint v2.13.2: 0 issues.

On devices: before the change the flow above failed nearly every time with the WDA driver: on simulators 43 of 46 runs with six simulators at once (iOS 27.0) and 3 of 3 alone (iOS 27.2), and on five real iPhones (iOS 18.3, 18.4, 26.2, 27.0, 27.2) 13 of 15. With it, it passed every run at six simulators, 3 of 3 alone and 15 of 15 on the phones. On the phones a tap that follows a check took 0.34 s longer at the median (two more screenshots; p25 0.11 s, p75 0.79 s where the screen was still moving).

A step that neither acts nor moves the screen (an assert, a script, a
flow's condition) no longer clears the settle the action before it asked
for, so the next action still waits for two identical screenshots. A tap
opened a sheet, a check of a field on it answered while the sheet was still
sliding up (WebDriverAgent reports the sheet's final frame while it moves),
and the next tap on the sheet went out mid-slide and was lost.
@codecov

codecov Bot commented Nov 8, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@omnarayan
omnarayan merged commit 3243e5c into devicelab-dev:main Nov 9, 2026
5 checks passed
omnarayan added a commit that referenced this pull request Nov 12, 2026
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.

3 participants