[Testing/Medium] testPerPagePrint: stage-2 scroll uses inert finger drags — use scroll gesture #215

Closed
opened 2026-09-18 08:15:47 +01:00 by gronod · 0 comments
Owner

Summary

Milestone3UITests.testPerPagePrint (Tests/ICCeryUITests/Milestone3UITests.swift:242-269) is the only UI test that must scroll stage 2 before pressing a Print button — btnPrintPage-0 sits at the window's bottom edge (originally #132).

Its helper scrollStage2UntilHittable (Milestone3UITests.swift:130-168) scrolls by synthesizing press(forDuration:thenDragTo:) finger-drags on the galleryPage-0 cell, falling back to the stage-2 scroll view. A macOS ScrollView/LazyVGrid does not scroll in response to a click-drag — observed runs show ~3 drag attempts while the gallery frame never moves, so the loop burns its 20 s budget and the button may never become hittable.

The helper's comment claims a synthesized scroll wheel is "inert on this LazyVGrid". That assumption is backwards: the finger drag is the inert gesture on macOS, and the scroll-wheel gesture is the mechanism the platform actually supports — which was also the fix originally proposed in #132.

Proposed Fix

  • Replace both press(forDuration:thenDragTo:) calls in scrollStage2UntilHittable with the XCUI scroll-wheel gesture — scroll(byDeltaX:deltaY:) on a coordinate inside app.scrollViews["stage-2"] (verify deltaY sign so content moves up, off the Dock zone).
  • Keep the poll-until-hittable loop, the windowBottom - 80 Dock-zone guard, and the "never coordinate-click a stale frame" contract unchanged.
  • Update the helper's doc comment to drop the "scroll wheel is inert" claim.
  • Sweep: thenDragTo/press(forDuration exists only in Milestone3UITests.swift — no other test needs changing.

Acceptance Criteria

  • scrollStage2UntilHittable uses scroll(byDeltaX:deltaY:) (or the element-level scroll API); no press(forDuration:thenDragTo:) remains.
  • testPerPagePrint passes with btnPrintPage-0 becoming hittable via the scroll gesture.
  • Full Milestone3UITests leg green (xcodebuild test -scheme ICCery -destination 'platform=macOS').

Dependencies

None — standalone test fix.

References

  • #132 — original btnPrintPage-0 not-hittable bug (XCUI auto scroll-to-visible ran 3× and never moved the frame); proposed fix was scroll(byDeltaX:deltaY:).
  • Tests/ICCeryUITests/Milestone3UITests.swift:130-168 — scrollStage2UntilHittable.
  • Tests/ICCeryUITests/Milestone3UITests.swift:242-269 — testPerPagePrint.
## Summary `Milestone3UITests.testPerPagePrint` (`Tests/ICCeryUITests/Milestone3UITests.swift:242-269`) is the only UI test that must scroll stage 2 before pressing a Print button — `btnPrintPage-0` sits at the window's bottom edge (originally #132). Its helper `scrollStage2UntilHittable` (`Milestone3UITests.swift:130-168`) scrolls by synthesizing `press(forDuration:thenDragTo:)` finger-drags on the `galleryPage-0` cell, falling back to the `stage-2` scroll view. A macOS `ScrollView`/`LazyVGrid` does not scroll in response to a click-drag — observed runs show ~3 drag attempts while the gallery frame never moves, so the loop burns its 20 s budget and the button may never become hittable. The helper's comment claims a synthesized scroll wheel is "inert on this LazyVGrid". That assumption is backwards: the finger drag is the inert gesture on macOS, and the scroll-wheel gesture is the mechanism the platform actually supports — which was also the fix originally proposed in #132. ## Proposed Fix - Replace both `press(forDuration:thenDragTo:)` calls in `scrollStage2UntilHittable` with the XCUI scroll-wheel gesture — `scroll(byDeltaX:deltaY:)` on a coordinate inside `app.scrollViews["stage-2"]` (verify deltaY sign so content moves up, off the Dock zone). - Keep the poll-until-hittable loop, the `windowBottom - 80` Dock-zone guard, and the "never coordinate-click a stale frame" contract unchanged. - Update the helper's doc comment to drop the "scroll wheel is inert" claim. - Sweep: `thenDragTo`/`press(forDuration` exists only in `Milestone3UITests.swift` — no other test needs changing. ## Acceptance Criteria - [ ] `scrollStage2UntilHittable` uses `scroll(byDeltaX:deltaY:)` (or the element-level scroll API); no `press(forDuration:thenDragTo:)` remains. - [ ] `testPerPagePrint` passes with `btnPrintPage-0` becoming hittable via the scroll gesture. - [ ] Full `Milestone3UITests` leg green (`xcodebuild test -scheme ICCery -destination 'platform=macOS'`). ## Dependencies None — standalone test fix. ## References - #132 — original `btnPrintPage-0` not-hittable bug (XCUI auto scroll-to-visible ran 3× and never moved the frame); proposed fix was `scroll(byDeltaX:deltaY:)`. - `Tests/ICCeryUITests/Milestone3UITests.swift:130-168` — `scrollStage2UntilHittable`. - `Tests/ICCeryUITests/Milestone3UITests.swift:242-269` — `testPerPagePrint`.
gronod added the Kind/Testing
Priority
Medium
3
Project/ICCery-v2Feature/UI
labels 2026-09-18 08:15:47 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: gronod/iccery-v2-mac#215