mirror of
https://github.com/priyanshujain/sanderling.git
synced 2026-10-04 20:17:09 +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)) }
|
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
|
// The second tap request is already queued at the XCTest runner while the
|
||||||
// XCTest transport adds hundreds of milliseconds per round trip, so any
|
// first executes, so the on-device gap collapses to the runner's
|
||||||
// client-side composition spreads the taps wide enough for the app to
|
// turnaround instead of a full transport round trip. Sequential requests
|
||||||
// navigate between them.
|
// leave a gap wide enough for the app to navigate between the taps.
|
||||||
override fun doubleTap(x: Int, y: Int) = withReconnect {
|
override fun doubleTap(x: Int, y: Int): Unit = withReconnect {
|
||||||
driver.tap(maestro.Point(x, y))
|
val point = maestro.Point(x, y)
|
||||||
driver.tap(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)) }
|
override fun longPress(x: Int, y: Int) = withReconnect { driver.longPress(maestro.Point(x, y)) }
|
||||||
|
|||||||
Reference in new issue
Block a user