You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 55d02e9
Browse filesBrowse the repository at this point in the historyBrowse files
fix(runner): bound XCTest's idle wait around alert activation (#2610)
* fix(runner): bound XCTest's idle wait around alert activation
An alert button is read as hittable before it is tapped, so XCTest's own wait for the app to
idle before synthesizing that tap adds nothing the runner has not already checked. Its default
outlives the command, so the tap lands after the caller was told the alert timed out (#2546).
The helper that bounds that wait was named for the scroll path that owned it; gesture, type and
swipe already went through it, and alert activation now does too, so it is named for the wait it
bounds. Each caller states which of XCTest's two waits it gives up: the gesture, type and swipe
paths skip both, because their next step is a poll of their own, while alert activation drops only
the pre-event wait. Its verification reads the alert this tap replaced, and an alert that dismisses
in order to present an identical replacement passes through a moment with no alert at all — a first
read landing in that moment reported a dismissal nothing had proved.
* test(ios-runner): cover alert activation against an app that never idles
Reverting the alert path to a plain `activateElement` kept every test green, so the #2546 failure had
no guard: the deadline tests returned before activation, and the ones that reached it used a 10 s
timeout on a fixture that had already settled.
The fixture now animates without end until an alert button is answered, which is the state that made
XCTest hold the event past the caller's deadline in the field. A test that reaches activation there
and is given 6 s reports what actually happens: the response comes back in well under a second of
activation, and if it ever reports `ALERT_DEADLINE_EXCEEDED` again the fixture says whether a button
was activated behind that answer. Reverting the seam costs the run 18 s and produces exactly the
original defect — `ALERT_DEADLINE_EXCEEDED` alongside `First actions: 1`.
Only a `UIView` animation counts here: a repeating main-thread timer and a `CABasicAnimation` both
left the app looking idle and the reverted path still passed.
* test(ios-runner): branch the busy-app assertion on what the command answered
The label check ran twice over the same response: it always expected `First actions: 1`, and the block
after it expected `First actions: 0` only when the answer was a deadline failure, so the second could
never pass and a correct refusal failed anyway. Now the assertion follows the answer — an accepted
alert must show the button press, a refused one must not — and the comment said "main thread busy"
where the fixture runs a repeating animation with the main thread free.
The test also joins the targeted list in `.github/workflows/ios.yml`, which is where the alert
regressions it guards are selected.
0 commit comments