mirror of
https://github.com/priyanshujain/sanderling.git
synced 2026-10-02 11:07:10 +00:00
feat(sidecar): pipeline iOS double-tap requests
Queue the second tap at the XCTest runner while the first executes. The runner serializes handlers, so this is the tightest gap the transport allows (~350ms per tap round trip); recorded here with measurements for the iOS double-tap limitation.
This commit is contained in:
1 parent
4f579d2a0b
commit
ae764f1036
1 file changed
+11
-7
@@ -744,13 +744,17 @@ class IosDriverBackend(private val udid: String) : DriverBackend {
|
||||
|
||||
override fun tap(x: Int, y: Int) = withReconnect { driver.tap(maestro.Point(x, y)) }
|
||||
|
||||
// Both taps inside one reconnect scope, with nothing between them: the
|
||||
// XCTest transport adds hundreds of milliseconds per round trip, so any
|
||||
// client-side composition spreads the taps wide enough for the app to
|
||||
// navigate between them.
|
||||
override fun doubleTap(x: Int, y: Int) = withReconnect {
|
||||
driver.tap(maestro.Point(x, y))
|
||||
driver.tap(maestro.Point(x, y))
|
||||
// The second tap request is already queued at the XCTest runner while the
|
||||
// first executes, so the on-device gap collapses to the runner's
|
||||
// turnaround instead of a full transport round trip. Sequential requests
|
||||
// leave a gap wide enough for the app to navigate between the taps.
|
||||
override fun doubleTap(x: Int, y: Int): Unit = withReconnect {
|
||||
val point = maestro.Point(x, y)
|
||||
val firstTap = java.util.concurrent.CompletableFuture.runAsync { driver.tap(point) }
|
||||
Thread.sleep(40)
|
||||
driver.tap(point)
|
||||
firstTap.join()
|
||||
Unit
|
||||
}
|
||||
|
||||
override fun longPress(x: Int, y: Int) = withReconnect { driver.longPress(maestro.Point(x, y)) }
|
||||
|
||||
Reference in new issue
Block a user