You can't guard a value that doesn't exist yet
Описание и применение
В WebDriverAgent на iOS 18.5 при выполнении жеста перетаскивания после переключения приложений возникала зависимость и ошибка из‑за бесконечного значения точки. Исправление реализовано через новый метод, который сразу вычисляет координаты, проверяет их и синтезирует событие, устраняя зависимость и возвращая понятный код ошибки 400.
Задача
Drag gestures in WebDriverAgent hang and fail with an infinite-point assertion when the target app is busy after a switch.
Результат
The new implementation removes the hang, provides a clear 400 error for invalid parameters, and aligns WDA’s drag behavior with W3C actions.
Рабочий процесс
- 1. Resolve start and end coordinates immediately using screenPoint.
- 2. Validate that both points are finite; if not, return a 400 error with a clear message.
- 3. Map velocity to XCTest’s pixels-per-second values (default 500, slow 250, fast 750).
- 4. Build the touch event path: press, hold, drag, hold, lift.
- 5. Send the event directly to FBXCTestDaemonsProxy, bypassing XCTest’s snapshot and idle wait.
- 6. Wait up to animationCoolOffTimeout after the gesture, mirroring W3C actions.
- 7. Return success or a 400 error based on validation.
- 8. Update /wda/dragfromtoforduration and /wda/pressAndDragWithVelocity to use the new method.
Доказательства
unknown error: Invalid parameter not satisfying: point.x != INFINITY && point.y != INFINITY
Both endpoints called -[XCUICoordinate pressForDuration:thenDragToCoordinate:(withVelocity:thenHoldForDuration:)]
A new -[XCUIApplication fb_pressAtCoordinate:forDuration:thenDragToCoordinate:withVelocity:thenHoldForDuration:error:]
- Дата записи: 2026-10-14T13:41:20.101Z