Commit d2954f6
fix: missing long-press on iOS simulator (#26)
* feat: for self-healing e2e tests; assertions
* fix: support long-press on iOS simulators via XCTest runner
The long-press command was failing on iOS simulators because dispatch.ts
called interactor.longPress() which mapped to a stub in ios/index.ts
that always threw UNSUPPORTED_OPERATION. Unlike press, type, fill, etc.,
the long-press case was missing the iOS simulator routing through the
XCTest runner.
Rather than adding yet another platform branch in dispatch.ts, this
refactors the Interactor abstraction to absorb runner routing internally.
getInteractor() now accepts an optional RunnerContext; when the device is
an iOS simulator, it returns an interactor whose tap/longPress/focus/
type/fill/scroll/scrollIntoView methods route through
runIosRunnerCommand. This removes 7 scattered if-ios-simulator branches
from dispatch.ts, making it impossible to forget runner routing for
future commands.
Changes:
- Swift runner: add longPress command type + longPressAt helper using
XCUICoordinate.press(forDuration:)
- runner-client.ts: add longPress to RunnerCommand type + durationMs field
- interactors.ts: add RunnerContext type, createIosSimulatorInteractor()
that routes through the XCTest runner, move invertScrollDirection here
- dispatch.ts: pass RunnerContext to getInteractor, remove all iOS sim
branching for interactor commands (-90 lines)
Co-authored-by: Cursor <cursoragent@cursor.com>
* restore attempts
* refactor: unify iOS interactor, remove dead input stubs
Since runnerContext is always passed and the capability matrix ensures
iOS only runs on simulators in v1, the two iOS interactor code paths
collapse into one: shared methods (open, close, screenshot) plus runner
overrides spread on top. No branch needed.
This deletes 7 dead iOS input stubs from ios/index.ts (pressIos,
longPressIos, focusIos, typeIos, fillIos, scrollIos, scrollIntoViewIos)
that only ever threw UNSUPPORTED_OPERATION errors.
Co-authored-by: Cursor <cursoragent@cursor.com>
* cleanup
* fixup save-script
* update
---------
Co-authored-by: Cursor <cursoragent@cursor.com>1 parent 1ecbec9 commit d2954f6
5 files changed
Lines changed: 134 additions & 168 deletions
File tree
- ios-runner/AgentDeviceRunner/AgentDeviceRunnerUITests
- src
- core
- platforms/ios
- utils
Lines changed: 15 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
232 | 232 | | |
233 | 233 | | |
234 | 234 | | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
235 | 242 | | |
236 | 243 | | |
237 | 244 | | |
| |||
411 | 418 | | |
412 | 419 | | |
413 | 420 | | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
414 | 427 | | |
415 | 428 | | |
416 | 429 | | |
| |||
792 | 805 | | |
793 | 806 | | |
794 | 807 | | |
| 808 | + | |
795 | 809 | | |
796 | 810 | | |
797 | 811 | | |
| |||
820 | 834 | | |
821 | 835 | | |
822 | 836 | | |
| 837 | + | |
823 | 838 | | |
824 | 839 | | |
825 | 840 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
| 15 | + | |
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| |||
92 | 92 | | |
93 | 93 | | |
94 | 94 | | |
95 | | - | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
96 | 102 | | |
97 | 103 | | |
98 | 104 | | |
| |||
114 | 120 | | |
115 | 121 | | |
116 | 122 | | |
117 | | - | |
118 | | - | |
119 | | - | |
120 | | - | |
121 | | - | |
122 | | - | |
123 | | - | |
124 | | - | |
125 | | - | |
| 123 | + | |
126 | 124 | | |
127 | 125 | | |
128 | 126 | | |
| |||
138 | 136 | | |
139 | 137 | | |
140 | 138 | | |
141 | | - | |
142 | | - | |
143 | | - | |
144 | | - | |
145 | | - | |
146 | | - | |
147 | | - | |
148 | | - | |
149 | | - | |
| 139 | + | |
150 | 140 | | |
151 | 141 | | |
152 | 142 | | |
153 | 143 | | |
154 | 144 | | |
155 | | - | |
156 | | - | |
157 | | - | |
158 | | - | |
159 | | - | |
160 | | - | |
161 | | - | |
162 | | - | |
163 | | - | |
| 145 | + | |
164 | 146 | | |
165 | 147 | | |
166 | 148 | | |
| |||
170 | 152 | | |
171 | 153 | | |
172 | 154 | | |
173 | | - | |
174 | | - | |
175 | | - | |
176 | | - | |
177 | | - | |
178 | | - | |
179 | | - | |
180 | | - | |
181 | | - | |
182 | | - | |
183 | | - | |
184 | | - | |
185 | | - | |
186 | | - | |
| 155 | + | |
187 | 156 | | |
188 | 157 | | |
189 | 158 | | |
190 | 159 | | |
191 | 160 | | |
192 | 161 | | |
193 | | - | |
194 | | - | |
195 | | - | |
196 | | - | |
197 | | - | |
198 | | - | |
199 | | - | |
200 | | - | |
201 | | - | |
202 | | - | |
203 | | - | |
204 | | - | |
205 | | - | |
| 162 | + | |
206 | 163 | | |
207 | 164 | | |
208 | 165 | | |
209 | 166 | | |
210 | 167 | | |
211 | | - | |
212 | | - | |
213 | | - | |
214 | | - | |
215 | | - | |
216 | | - | |
217 | | - | |
218 | | - | |
219 | | - | |
220 | | - | |
221 | | - | |
222 | | - | |
223 | | - | |
224 | | - | |
225 | | - | |
226 | | - | |
227 | | - | |
228 | | - | |
229 | | - | |
| 168 | + | |
| 169 | + | |
230 | 170 | | |
231 | 171 | | |
232 | 172 | | |
| |||
339 | 279 | | |
340 | 280 | | |
341 | 281 | | |
342 | | - | |
343 | | - | |
344 | | - | |
345 | | - | |
346 | | - | |
347 | | - | |
348 | | - | |
349 | | - | |
350 | | - | |
351 | | - | |
352 | | - | |
353 | | - | |
354 | | - | |
355 | | - | |
356 | | - | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
83 | 83 | | |
84 | 84 | | |
85 | 85 | | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | | - | |
99 | | - | |
100 | | - | |
101 | | - | |
102 | | - | |
103 | | - | |
104 | | - | |
105 | | - | |
106 | | - | |
107 | | - | |
108 | | - | |
109 | | - | |
110 | | - | |
111 | | - | |
112 | | - | |
113 | | - | |
114 | | - | |
115 | | - | |
116 | | - | |
117 | | - | |
118 | | - | |
119 | | - | |
120 | | - | |
121 | | - | |
122 | | - | |
123 | | - | |
124 | | - | |
125 | | - | |
126 | | - | |
127 | | - | |
128 | | - | |
129 | | - | |
130 | | - | |
131 | | - | |
132 | | - | |
133 | | - | |
134 | | - | |
135 | | - | |
136 | | - | |
137 | | - | |
138 | | - | |
139 | | - | |
140 | | - | |
141 | | - | |
142 | | - | |
143 | | - | |
144 | | - | |
145 | | - | |
146 | | - | |
147 | | - | |
148 | 86 | | |
149 | 87 | | |
150 | 88 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
14 | 15 | | |
15 | 16 | | |
16 | 17 | | |
| |||
27 | 28 | | |
28 | 29 | | |
29 | 30 | | |
| 31 | + | |
30 | 32 | | |
31 | 33 | | |
32 | 34 | | |
| |||
0 commit comments