From caecdc6d5b8e6e9799528891a5c0d8a0965d4c1a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Pierzcha=C5=82a?= Date: Fri, 7 Aug 2026 16:20:59 +0200 Subject: [PATCH 1/4] fix(test): wait for typed text to settle in the hidden-keyboard runner test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit testBareTypeUsesTappedInputWhenSoftwareKeyboardIsHidden read textField.value in one shot right after executeTypeCommand returned. The simulator commits synthesized keystrokes after the command responds, so on a loaded CI machine the read landed mid-word — observed failures reported ("h") and ("hardware-ke"). It failed on 3 of 5 runs of a branch carrying zero Swift changes and passed on re-run. Poll the value until it holds the expected text (10s ceiling) and assert on the last value read, so a real regression still fails with what the field actually held. Both reads in the test use the same helper; the assertions are unchanged. --- .../RunnerTests+CommandExecution.swift | 28 +++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+CommandExecution.swift b/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+CommandExecution.swift index f6cbf3831..4ef891c0b 100644 --- a/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+CommandExecution.swift +++ b/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+CommandExecution.swift @@ -393,7 +393,10 @@ extension RunnerTests { XCTAssertTrue(typeResponse.ok, String(describing: typeResponse.error)) XCTAssertFalse(didRecordXCTestFailure(since: failureCountBefore)) XCTAssertEqual(typeResponse.data?.textEntryRoute, "synthesized-first-responder") - XCTAssertEqual(String(describing: textField.value ?? ""), "hardware-keyboard") + XCTAssertEqual( + textFieldValue(of: textField, settlingAt: "hardware-keyboard"), + "hardware-keyboard" + ) let secondFailureCountBefore = currentXCTestFailureCount() let secondTypeCommand = try runnerCommandFixture( @@ -404,7 +407,10 @@ extension RunnerTests { XCTAssertFalse(secondTypeResponse.ok) XCTAssertEqual(secondTypeResponse.error?.code, "TEXT_INPUT_NOT_FOCUSED") XCTAssertFalse(didRecordXCTestFailure(since: secondFailureCountBefore)) - XCTAssertEqual(String(describing: textField.value ?? ""), "hardware-keyboard") + XCTAssertEqual( + textFieldValue(of: textField, settlingAt: "hardware-keyboard"), + "hardware-keyboard" + ) } func testBareDelayedTypeFailsWhenTappedInputDisappearsMidCommand() throws { @@ -438,6 +444,24 @@ extension RunnerTests { XCTAssertEqual(typeResponse.error?.code, "TEXT_INPUT_NOT_FOCUSED") XCTAssertFalse(textField.exists) } + + // The simulator commits synthesized keystrokes after the type command returns, so a one-shot + // read of `value` can land mid-word ("h", "hardware-ke") on a loaded machine. Poll until the + // field holds the expected text, then hand the caller the last value read so a real mismatch + // still fails with what the field actually held. + private func textFieldValue( + of element: XCUIElement, + settlingAt expected: String, + timeout: TimeInterval = 10 + ) -> String { + let deadline = Date().addingTimeInterval(timeout) + var observed = String(describing: element.value ?? "") + while observed != expected, Date() < deadline { + sleepFor(0.05) + observed = String(describing: element.value ?? "") + } + return observed + } #endif func testInjectedTapRecordedFailureGateIsTapOnlyAndCountGated() { From f91c0e8b18aa77f2a6713d0c7c5e48a4b42fd929 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Pierzcha=C5=82a?= Date: Fri, 7 Aug 2026 16:44:10 +0200 Subject: [PATCH 2/4] Revert "fix(test): wait for typed text to settle in the hidden-keyboard runner test" This reverts commit caecdc6d5b8e6e9799528891a5c0d8a0965d4c1a. --- .../RunnerTests+CommandExecution.swift | 28 ++----------------- 1 file changed, 2 insertions(+), 26 deletions(-) diff --git a/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+CommandExecution.swift b/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+CommandExecution.swift index 4ef891c0b..f6cbf3831 100644 --- a/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+CommandExecution.swift +++ b/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+CommandExecution.swift @@ -393,10 +393,7 @@ extension RunnerTests { XCTAssertTrue(typeResponse.ok, String(describing: typeResponse.error)) XCTAssertFalse(didRecordXCTestFailure(since: failureCountBefore)) XCTAssertEqual(typeResponse.data?.textEntryRoute, "synthesized-first-responder") - XCTAssertEqual( - textFieldValue(of: textField, settlingAt: "hardware-keyboard"), - "hardware-keyboard" - ) + XCTAssertEqual(String(describing: textField.value ?? ""), "hardware-keyboard") let secondFailureCountBefore = currentXCTestFailureCount() let secondTypeCommand = try runnerCommandFixture( @@ -407,10 +404,7 @@ extension RunnerTests { XCTAssertFalse(secondTypeResponse.ok) XCTAssertEqual(secondTypeResponse.error?.code, "TEXT_INPUT_NOT_FOCUSED") XCTAssertFalse(didRecordXCTestFailure(since: secondFailureCountBefore)) - XCTAssertEqual( - textFieldValue(of: textField, settlingAt: "hardware-keyboard"), - "hardware-keyboard" - ) + XCTAssertEqual(String(describing: textField.value ?? ""), "hardware-keyboard") } func testBareDelayedTypeFailsWhenTappedInputDisappearsMidCommand() throws { @@ -444,24 +438,6 @@ extension RunnerTests { XCTAssertEqual(typeResponse.error?.code, "TEXT_INPUT_NOT_FOCUSED") XCTAssertFalse(textField.exists) } - - // The simulator commits synthesized keystrokes after the type command returns, so a one-shot - // read of `value` can land mid-word ("h", "hardware-ke") on a loaded machine. Poll until the - // field holds the expected text, then hand the caller the last value read so a real mismatch - // still fails with what the field actually held. - private func textFieldValue( - of element: XCUIElement, - settlingAt expected: String, - timeout: TimeInterval = 10 - ) -> String { - let deadline = Date().addingTimeInterval(timeout) - var observed = String(describing: element.value ?? "") - while observed != expected, Date() < deadline { - sleepFor(0.05) - observed = String(describing: element.value ?? "") - } - return observed - } #endif func testInjectedTapRecordedFailureGateIsTapOnlyAndCountGated() { From 5de68266ecdfc8433226ac28d50b345d6f7df57a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Pierzcha=C5=82a?= Date: Fri, 7 Aug 2026 14:27:53 +0200 Subject: [PATCH 3/4] fix(ios): wait for hidden-keyboard synthesized text to commit before responding The synthesized-first-responder bare-type route returned ok as soon as the private XCTest event record was posted, while the target app was still committing characters. On slow CI simulators the trailing characters landed after the response, so agents (and the smoke test) observed a truncated field value through the public type path. After dispatch, poll the tapped element until its value reaches textBefore + typedText, exit immediately when the app transforms the input (formatter, mid-text caret, autocomplete), and if progress stalls as a strict prefix, re-synthesize the missing tail once. Submit-suffixed text keeps the old immediate return so a repair can never double-submit. Validated on a booted iPhone 17 Pro simulator: 5/5 passes of testBareTypeUsesTappedInputWhenSoftwareKeyboardIsHidden under full-core CPU load, with the commit wait absorbing up to ~390ms of post-dispatch lag that the previous code ignored (uniform ~494ms dispatch-only before); the tail repair never had to fire, consistent with commit lag rather than true drops. --- .../RunnerTests+SynthesizedTextEntry.swift | 100 ++++++++++++++++++ .../RunnerTests+TextEntry.swift | 2 + .../RunnerTests+TextEntryPolicyTests.swift | 50 +++++++++ .../RunnerTests+TextTyping.swift | 15 +++ 4 files changed, 167 insertions(+) diff --git a/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+SynthesizedTextEntry.swift b/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+SynthesizedTextEntry.swift index 44ae40896..26da64df9 100644 --- a/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+SynthesizedTextEntry.swift +++ b/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+SynthesizedTextEntry.swift @@ -159,6 +159,106 @@ extension RunnerTests { repairMode == .none && fromTapWitness && !softwareKeyboardVisible } + enum SynthesizedTextCommitProgress: Equatable { + case committed + case pending + case diverged + } + + // The private synthesize call returns once the event record is posted, not once the target + // app has committed the characters, so intermediate reads walk prefix-by-prefix toward the + // expected value. Anything off that prefix path means the app transformed the input + // (formatter, mid-text caret, autocomplete) and the runner must not second-guess it. + static func synthesizedTextCommitProgress( + observedText: String?, + expectedText: String + ) -> SynthesizedTextCommitProgress { + guard let observedText else { + return .diverged + } + if observedText == expectedText { + return .committed + } + return expectedText.hasPrefix(observedText) ? .pending : .diverged + } + + static func synthesizedTextCommitRepairTail( + observedText: String, + expectedText: String + ) -> String? { + guard expectedText.hasPrefix(observedText), observedText.count < expectedText.count else { + return nil + } + let tail = String(expectedText.dropFirst(observedText.count)) + guard !tail.contains("\n"), !tail.contains("\r") else { + return nil + } + return tail + } + + /// Blocks until the synthesized bare-type text is observable in the target field, so `type` + /// cannot report ok while trailing characters are still uncommitted (or dropped) on a slow + /// simulator. Exits fast when the app transforms the input; re-synthesizes the missing tail + /// once if commit progress stalls as a strict prefix of the expected value. + func awaitSynthesizedFirstResponderCommit( + app: XCUIApplication, + target: TextEntryTarget, + textBefore: String?, + typedText: String, + synthesizer: any TextEntrySynthesizing + ) { + guard let textBefore, !typedText.contains("\n"), !typedText.contains("\r") else { + return + } + let expectedText = textBefore + typedText + var repaired = false + var lastObservedText: String? + var lastChangeAt = Date() + let deadline = Date().addingTimeInterval(TextEntryTiming.synthesizedCommitTimeout) + while Date() < deadline { + guard let observedText = editableTextValue( + for: resolveTextEntryElement(app: app, target: target), + treatingPlaceholderAsEmpty: true + ) else { + return + } + switch Self.synthesizedTextCommitProgress(observedText: observedText, expectedText: expectedText) { + case .committed, .diverged: + return + case .pending: + break + } + if lastObservedText != observedText { + lastObservedText = observedText + lastChangeAt = Date() + } else if Date().timeIntervalSince(lastChangeAt) >= TextEntryTiming.synthesizedCommitQuietWindow { + guard !repaired, + let tail = Self.synthesizedTextCommitRepairTail( + observedText: observedText, + expectedText: expectedText + ) + else { + return + } + NSLog( + "AGENT_DEVICE_RUNNER_REPAIR_TEXT_ENTRY route=synthesized-first-responder expectedLength=%d observedLength=%d", + expectedText.count, + observedText.count + ) + guard case .continueTyping = synthesizer.enterText( + app: app, + text: tail, + replacingExistingText: false + ) else { + return + } + repaired = true + lastChangeAt = Date() + } + sleepFor(TextEntryTiming.pollInterval) + } + } + static func shouldUseResolvedCoordinateTextEntryRoute( repairMode: TextTypingRepairMode, hasX: Bool, diff --git a/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+TextEntry.swift b/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+TextEntry.swift index cd200ccb8..6cc987ba9 100644 --- a/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+TextEntry.swift +++ b/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+TextEntry.swift @@ -40,6 +40,8 @@ extension RunnerTests { static let pollInterval: TimeInterval = 0.02 static let warmupValueTimeout: TimeInterval = 0.4 static let verificationStabilityWindow: TimeInterval = 0.2 + static let synthesizedCommitTimeout: TimeInterval = 3.0 + static let synthesizedCommitQuietWindow: TimeInterval = 0.6 } struct TextEntryResult { diff --git a/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+TextEntryPolicyTests.swift b/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+TextEntryPolicyTests.swift index 12f7a9414..71063891a 100644 --- a/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+TextEntryPolicyTests.swift +++ b/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+TextEntryPolicyTests.swift @@ -61,6 +61,56 @@ extension RunnerTests { } } + func testSynthesizedTextCommitProgressWalksExpectedPrefixOnly() { + let expected = "hardware-keyboard" + XCTAssertEqual( + Self.synthesizedTextCommitProgress(observedText: "hardware-keyboard", expectedText: expected), + .committed + ) + XCTAssertEqual( + Self.synthesizedTextCommitProgress(observedText: "", expectedText: expected), + .pending + ) + XCTAssertEqual( + Self.synthesizedTextCommitProgress(observedText: "hardware-keyboa", expectedText: expected), + .pending + ) + // Transformed input (formatter, mid-text caret, autocomplete) must stop the wait. + XCTAssertEqual( + Self.synthesizedTextCommitProgress(observedText: "hardwarX", expectedText: expected), + .diverged + ) + XCTAssertEqual( + Self.synthesizedTextCommitProgress(observedText: "hardware-keyboards", expectedText: expected), + .diverged + ) + XCTAssertEqual( + Self.synthesizedTextCommitProgress(observedText: nil, expectedText: expected), + .diverged + ) + } + + func testSynthesizedTextCommitRepairTailOnlyForStrictPrefixWithoutSubmitKeys() { + XCTAssertEqual( + Self.synthesizedTextCommitRepairTail(observedText: "hardware-keyboa", expectedText: "hardware-keyboard"), + "rd" + ) + XCTAssertEqual( + Self.synthesizedTextCommitRepairTail(observedText: "", expectedText: "abc"), + "abc" + ) + XCTAssertNil( + Self.synthesizedTextCommitRepairTail(observedText: "hardware-keyboard", expectedText: "hardware-keyboard") + ) + XCTAssertNil( + Self.synthesizedTextCommitRepairTail(observedText: "hardwarX", expectedText: "hardware-keyboard") + ) + // Never re-synthesize a tail that would submit. + XCTAssertNil( + Self.synthesizedTextCommitRepairTail(observedText: "ab", expectedText: "abc\n") + ) + } + #if os(iOS) func testSynthesizedTextEntryFallsBackOnlyWhenPrivateSynthesisIsUnavailable() { XCTAssertEqual( diff --git a/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+TextTyping.swift b/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+TextTyping.swift index 06c47b17a..8ac31afa0 100644 --- a/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+TextTyping.swift +++ b/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+TextTyping.swift @@ -111,8 +111,23 @@ extension RunnerTests { { textEntryRoute = "synthesized-first-responder" NSLog("AGENT_DEVICE_RUNNER_TEXT_ENTRY_ROUTE route=synthesized-first-responder") + let textBefore = editableTextValue(for: currentTarget, treatingPlaceholderAsEmpty: true) switch synthesizer.enterText(app: app, text: value, replacingExistingText: false) { case .continueTyping: + // No refresh point: like the tap-witness target itself, the commit wait must observe + // only the element the tap selected, never rediscover a different field. + awaitSynthesizedFirstResponderCommit( + app: app, + target: TextEntryTarget( + element: currentTarget, + refreshPoint: nil, + prefersFocusedElement: false, + fromTapWitness: true + ), + textBefore: textBefore, + typedText: value, + synthesizer: synthesizer + ) return (currentTarget, true, nil) case .fallback: return (nil, false, .synthesisUnavailable) From 54c0979b20f68028611123cff092d8ad84fa65c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Pierzcha=C5=82a?= Date: Fri, 7 Aug 2026 17:13:58 +0200 Subject: [PATCH 4/4] fix(ios): make the synthesized commit wait observation-only MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Addresses the P1 on #1673: a 600 ms quiet prefix cannot distinguish delayed app-side commit from a genuinely dropped suffix, so re-synthesizing the tail could post it while the original was still queued and commit the text twice after the command had already reported ok. Drop the repair path entirely — the tail builder, the quiet-window constant, the stall tracking, and the synthesizer dependency the wait only needed in order to repair. What remains is a bounded observation: poll the tapped element until the value commits, the app transforms it, the value becomes unreadable, or the 3s ceiling expires. A dropped suffix still reports ok, exactly as before this change; only the false truncation from commit lag is removed. The submit-key skip stays, for its own reason: the app may clear or rewrite the field on submit, so textBefore + typedText is not the value to wait for. Also wire testSynthesizedTextCommitProgressWalksExpectedPrefixOnly into the iOS smoke lane — that workflow enumerates its tests by hand with -only-testing, so a new test that is not listed never runs. --- .github/workflows/ios.yml | 1 + .../RunnerTests+SynthesizedTextEntry.swift | 69 ++++--------------- .../RunnerTests+TextEntry.swift | 1 - .../RunnerTests+TextEntryPolicyTests.swift | 21 ------ .../RunnerTests+TextTyping.swift | 3 +- 5 files changed, 15 insertions(+), 80 deletions(-) diff --git a/.github/workflows/ios.yml b/.github/workflows/ios.yml index e20b95d54..6c11670e0 100644 --- a/.github/workflows/ios.yml +++ b/.github/workflows/ios.yml @@ -95,6 +95,7 @@ jobs: -only-testing:AgentDeviceRunnerUITests/RunnerTests/testTypeWithoutResolvedInputReturnsTypedFailureBeforeDispatchingText \ -only-testing:AgentDeviceRunnerUITests/RunnerTests/testBareTypeUsesTappedInputWhenSoftwareKeyboardIsHidden \ -only-testing:AgentDeviceRunnerUITests/RunnerTests/testBareDelayedTypeFailsWhenTappedInputDisappearsMidCommand \ + -only-testing:AgentDeviceRunnerUITests/RunnerTests/testSynthesizedTextCommitProgressWalksExpectedPrefixOnly \ -only-testing:AgentDeviceRunnerUITests/RunnerTests/testTextEntryTapWitnessIsBoundToTargetIdentity \ -only-testing:AgentDeviceRunnerUITests/RunnerTests/testActivateTargetSkipsForegroundAndActivatesNonForegroundApplication \ -only-testing:AgentDeviceRunnerUITests/RunnerTests/testMissingBundleCommandInvalidatesCompleteCachedTargetState \ diff --git a/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+SynthesizedTextEntry.swift b/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+SynthesizedTextEntry.swift index 26da64df9..272101752 100644 --- a/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+SynthesizedTextEntry.swift +++ b/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+SynthesizedTextEntry.swift @@ -168,7 +168,9 @@ extension RunnerTests { // The private synthesize call returns once the event record is posted, not once the target // app has committed the characters, so intermediate reads walk prefix-by-prefix toward the // expected value. Anything off that prefix path means the app transformed the input - // (formatter, mid-text caret, autocomplete) and the runner must not second-guess it. + // (formatter, mid-text caret, autocomplete) and the runner must not second-guess it. An + // unreadable value — secure field, or the element stopped resolving — ends the wait the + // same way. static func synthesizedTextCommitProgress( observedText: String?, expectedText: String @@ -182,80 +184,35 @@ extension RunnerTests { return expectedText.hasPrefix(observedText) ? .pending : .diverged } - static func synthesizedTextCommitRepairTail( - observedText: String, - expectedText: String - ) -> String? { - guard expectedText.hasPrefix(observedText), observedText.count < expectedText.count else { - return nil - } - let tail = String(expectedText.dropFirst(observedText.count)) - guard !tail.contains("\n"), !tail.contains("\r") else { - return nil - } - return tail - } - /// Blocks until the synthesized bare-type text is observable in the target field, so `type` - /// cannot report ok while trailing characters are still uncommitted (or dropped) on a slow - /// simulator. Exits fast when the app transforms the input; re-synthesizes the missing tail - /// once if commit progress stalls as a strict prefix of the expected value. + /// cannot report ok while trailing characters are still uncommitted on a slow simulator. + /// + /// Observation only. A stalled prefix cannot be told apart from a suffix still queued in the + /// event stream, so re-synthesizing the difference risks committing it twice after the command + /// already reported success. Text carrying a submit key is skipped outright: the app may clear + /// or rewrite the field on submit, so `textBefore + typedText` is not the value to wait for. func awaitSynthesizedFirstResponderCommit( app: XCUIApplication, target: TextEntryTarget, textBefore: String?, - typedText: String, - synthesizer: any TextEntrySynthesizing + typedText: String ) { guard let textBefore, !typedText.contains("\n"), !typedText.contains("\r") else { return } let expectedText = textBefore + typedText - var repaired = false - var lastObservedText: String? - var lastChangeAt = Date() let deadline = Date().addingTimeInterval(TextEntryTiming.synthesizedCommitTimeout) while Date() < deadline { - guard let observedText = editableTextValue( + let observedText = editableTextValue( for: resolveTextEntryElement(app: app, target: target), treatingPlaceholderAsEmpty: true - ) else { - return - } + ) switch Self.synthesizedTextCommitProgress(observedText: observedText, expectedText: expectedText) { case .committed, .diverged: return case .pending: - break - } - if lastObservedText != observedText { - lastObservedText = observedText - lastChangeAt = Date() - } else if Date().timeIntervalSince(lastChangeAt) >= TextEntryTiming.synthesizedCommitQuietWindow { - guard !repaired, - let tail = Self.synthesizedTextCommitRepairTail( - observedText: observedText, - expectedText: expectedText - ) - else { - return - } - NSLog( - "AGENT_DEVICE_RUNNER_REPAIR_TEXT_ENTRY route=synthesized-first-responder expectedLength=%d observedLength=%d", - expectedText.count, - observedText.count - ) - guard case .continueTyping = synthesizer.enterText( - app: app, - text: tail, - replacingExistingText: false - ) else { - return - } - repaired = true - lastChangeAt = Date() + sleepFor(TextEntryTiming.pollInterval) } - sleepFor(TextEntryTiming.pollInterval) } } diff --git a/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+TextEntry.swift b/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+TextEntry.swift index 6cc987ba9..2de0dc186 100644 --- a/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+TextEntry.swift +++ b/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+TextEntry.swift @@ -41,7 +41,6 @@ extension RunnerTests { static let warmupValueTimeout: TimeInterval = 0.4 static let verificationStabilityWindow: TimeInterval = 0.2 static let synthesizedCommitTimeout: TimeInterval = 3.0 - static let synthesizedCommitQuietWindow: TimeInterval = 0.6 } struct TextEntryResult { diff --git a/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+TextEntryPolicyTests.swift b/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+TextEntryPolicyTests.swift index 71063891a..464f0ad93 100644 --- a/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+TextEntryPolicyTests.swift +++ b/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+TextEntryPolicyTests.swift @@ -90,27 +90,6 @@ extension RunnerTests { ) } - func testSynthesizedTextCommitRepairTailOnlyForStrictPrefixWithoutSubmitKeys() { - XCTAssertEqual( - Self.synthesizedTextCommitRepairTail(observedText: "hardware-keyboa", expectedText: "hardware-keyboard"), - "rd" - ) - XCTAssertEqual( - Self.synthesizedTextCommitRepairTail(observedText: "", expectedText: "abc"), - "abc" - ) - XCTAssertNil( - Self.synthesizedTextCommitRepairTail(observedText: "hardware-keyboard", expectedText: "hardware-keyboard") - ) - XCTAssertNil( - Self.synthesizedTextCommitRepairTail(observedText: "hardwarX", expectedText: "hardware-keyboard") - ) - // Never re-synthesize a tail that would submit. - XCTAssertNil( - Self.synthesizedTextCommitRepairTail(observedText: "ab", expectedText: "abc\n") - ) - } - #if os(iOS) func testSynthesizedTextEntryFallsBackOnlyWhenPrivateSynthesisIsUnavailable() { XCTAssertEqual( diff --git a/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+TextTyping.swift b/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+TextTyping.swift index 8ac31afa0..fde9ad91c 100644 --- a/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+TextTyping.swift +++ b/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+TextTyping.swift @@ -125,8 +125,7 @@ extension RunnerTests { fromTapWitness: true ), textBefore: textBefore, - typedText: value, - synthesizer: synthesizer + typedText: value ) return (currentTarget, true, nil) case .fallback: