Skip to content

Commit 2fd2bf5

Browse files
authored
chore: remove dead ios runner command paths (#88)
1 parent 8eea063 commit 2fd2bf5

2 files changed

Lines changed: 2 additions & 17 deletions

File tree

ios-runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests.swift

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ final class RunnerTests: XCTestCase {
2626

2727
private static let springboardBundleId = "com.apple.springboard"
2828
private var listener: NWListener?
29-
private var port: UInt16 = 0
3029
private var doneExpectation: XCTestExpectation?
3130
private let app = XCUIApplication()
3231
private lazy var springboard = XCUIApplication(bundleIdentifier: Self.springboardBundleId)
@@ -351,7 +350,6 @@ final class RunnerTests: XCTestCase {
351350
case .ready:
352351
NSLog("AGENT_DEVICE_RUNNER_LISTENER_READY")
353352
if let listenerPort = self?.listener?.port {
354-
self?.port = listenerPort.rawValue
355353
NSLog("AGENT_DEVICE_RUNNER_PORT=%d", listenerPort.rawValue)
356354
} else {
357355
NSLog("AGENT_DEVICE_RUNNER_PORT_NOT_SET")
@@ -764,17 +762,6 @@ final class RunnerTests: XCTestCase {
764762
}
765763
let found = findElement(app: activeApp, text: text) != nil
766764
return Response(ok: true, data: DataPayload(found: found))
767-
case .listTappables:
768-
let elements = activeApp.descendants(matching: .any).allElementsBoundByIndex
769-
let labels = elements.compactMap { element -> String? in
770-
guard element.isHittable else { return nil }
771-
let label = element.label.trimmingCharacters(in: .whitespacesAndNewlines)
772-
if label.isEmpty { return nil }
773-
let identifier = element.identifier.trimmingCharacters(in: .whitespacesAndNewlines)
774-
return identifier.isEmpty ? label : "\(label) [\(identifier)]"
775-
}
776-
let unique = Array(Set(labels)).sorted()
777-
return Response(ok: true, data: DataPayload(items: unique))
778765
case .snapshot:
779766
let options = SnapshotOptions(
780767
interactiveOnly: command.interactiveOnly ?? false,
@@ -908,7 +895,7 @@ final class RunnerTests: XCTestCase {
908895

909896
private func isReadOnlyCommand(_ command: Command) -> Bool {
910897
switch command.command {
911-
case .findText, .listTappables, .snapshot:
898+
case .findText, .snapshot:
912899
return true
913900
case .alert:
914901
let action = (command.action ?? "get").lowercased()
@@ -1714,7 +1701,6 @@ enum CommandType: String, Codable {
17141701
case type
17151702
case swipe
17161703
case findText
1717-
case listTappables
17181704
case snapshot
17191705
case back
17201706
case home

src/platforms/ios/runner-client.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ export type RunnerCommand = {
2323
| 'type'
2424
| 'swipe'
2525
| 'findText'
26-
| 'listTappables'
2726
| 'snapshot'
2827
| 'back'
2928
| 'home'
@@ -664,7 +663,7 @@ export function isRetryableRunnerError(err: unknown): boolean {
664663
}
665664

666665
function isReadOnlyRunnerCommand(command: RunnerCommand['command']): boolean {
667-
return command === 'snapshot' || command === 'findText' || command === 'listTappables' || command === 'alert';
666+
return command === 'snapshot' || command === 'findText' || command === 'alert';
668667
}
669668

670669
function assertRunnerRequestActive(requestId: string | undefined): void {

0 commit comments

Comments
 (0)