@midscene/ios 0.30.6-beta-20251021121032.0 → 0.30.6-beta-20251022061854.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/es/bin.mjs CHANGED
@@ -12003,17 +12003,60 @@ class IOSWebDriverClient extends WebDriverClient {
12003
12003
  async swipe(fromX, fromY, toX, toY, duration = 500) {
12004
12004
  this.ensureSession();
12005
12005
  try {
12006
- await this.makeRequest('POST', `/session/${this.sessionId}/wda/dragfromtoforduration`, {
12007
- fromX,
12008
- fromY,
12009
- toX,
12010
- toY,
12011
- duration: duration / 1000
12012
- });
12013
- debugIOS(`Swiped from (${fromX}, ${fromY}) to (${toX}, ${toY}) in ${duration}ms`);
12006
+ const actions = {
12007
+ actions: [
12008
+ {
12009
+ type: 'pointer',
12010
+ id: 'finger1',
12011
+ parameters: {
12012
+ pointerType: 'touch'
12013
+ },
12014
+ actions: [
12015
+ {
12016
+ type: 'pointerMove',
12017
+ duration: 0,
12018
+ x: fromX,
12019
+ y: fromY
12020
+ },
12021
+ {
12022
+ type: 'pointerDown',
12023
+ button: 0
12024
+ },
12025
+ {
12026
+ type: 'pause',
12027
+ duration: 100
12028
+ },
12029
+ {
12030
+ type: 'pointerMove',
12031
+ duration,
12032
+ x: toX,
12033
+ y: toY
12034
+ },
12035
+ {
12036
+ type: 'pointerUp',
12037
+ button: 0
12038
+ }
12039
+ ]
12040
+ }
12041
+ ]
12042
+ };
12043
+ await this.makeRequest('POST', `/session/${this.sessionId}/actions`, actions);
12044
+ debugIOS(`Swiped using W3C Actions from (${fromX}, ${fromY}) to (${toX}, ${toY}) in ${duration}ms`);
12014
12045
  } catch (error) {
12015
- debugIOS(`Failed to swipe from (${fromX}, ${fromY}) to (${toX}, ${toY}): ${error}`);
12016
- throw new Error(`Failed to swipe: ${error}`);
12046
+ debugIOS(`W3C Actions failed, falling back to dragfromtoforduration: ${error}`);
12047
+ try {
12048
+ await this.makeRequest('POST', `/session/${this.sessionId}/wda/dragfromtoforduration`, {
12049
+ fromX,
12050
+ fromY,
12051
+ toX,
12052
+ toY,
12053
+ duration: duration / 1000
12054
+ });
12055
+ debugIOS(`Swiped from (${fromX}, ${fromY}) to (${toX}, ${toY}) in ${duration}ms`);
12056
+ } catch (error2) {
12057
+ debugIOS(`Failed to swipe from (${fromX}, ${fromY}) to (${toX}, ${toY}): ${error2}`);
12058
+ throw new Error(`Failed to swipe: ${error2}`);
12059
+ }
12017
12060
  }
12018
12061
  }
12019
12062
  async longPress(x, y, duration = 1000) {
@@ -12161,11 +12204,7 @@ class device_IOSDevice {
12161
12204
  }),
12162
12205
  defineActionKeyboardPress(async (param)=>{
12163
12206
  const key = param.keyName;
12164
- if (Array.isArray(key)) {
12165
- const keyToPress = key[key.length - 1];
12166
- console.warn(`[iOS] Key combinations are not supported. Using last key: "${keyToPress}"`, 'Original input:', key);
12167
- await this.pressKey(keyToPress);
12168
- } else await this.pressKey(key);
12207
+ await this.pressKey(key);
12169
12208
  }),
12170
12209
  defineAction({
12171
12210
  name: 'IOSHomeButton',
@@ -12390,7 +12429,7 @@ ScreenSize: ${size.width}x${size.height} (DPR: ${size.scale})
12390
12429
  x: width / 2,
12391
12430
  y: height / 2
12392
12431
  };
12393
- const scrollDistance = distance || width / 3;
12432
+ const scrollDistance = distance || 0.7 * width;
12394
12433
  await this.swipe(start.x, start.y, start.x + scrollDistance, start.y);
12395
12434
  }
12396
12435
  async scrollRight(distance, startPoint) {
@@ -12402,7 +12441,7 @@ ScreenSize: ${size.width}x${size.height} (DPR: ${size.scale})
12402
12441
  x: width / 2,
12403
12442
  y: height / 2
12404
12443
  };
12405
- const scrollDistance = distance || width / 3;
12444
+ const scrollDistance = distance || 0.7 * width;
12406
12445
  await this.swipe(start.x, start.y, start.x - scrollDistance, start.y);
12407
12446
  }
12408
12447
  async scrollUntilTop(startPoint) {
package/dist/es/index.mjs CHANGED
@@ -197,17 +197,60 @@ class IOSWebDriverClient extends WebDriverClient {
197
197
  async swipe(fromX, fromY, toX, toY, duration = 500) {
198
198
  this.ensureSession();
199
199
  try {
200
- await this.makeRequest('POST', `/session/${this.sessionId}/wda/dragfromtoforduration`, {
201
- fromX,
202
- fromY,
203
- toX,
204
- toY,
205
- duration: duration / 1000
206
- });
207
- debugIOS(`Swiped from (${fromX}, ${fromY}) to (${toX}, ${toY}) in ${duration}ms`);
200
+ const actions = {
201
+ actions: [
202
+ {
203
+ type: 'pointer',
204
+ id: 'finger1',
205
+ parameters: {
206
+ pointerType: 'touch'
207
+ },
208
+ actions: [
209
+ {
210
+ type: 'pointerMove',
211
+ duration: 0,
212
+ x: fromX,
213
+ y: fromY
214
+ },
215
+ {
216
+ type: 'pointerDown',
217
+ button: 0
218
+ },
219
+ {
220
+ type: 'pause',
221
+ duration: 100
222
+ },
223
+ {
224
+ type: 'pointerMove',
225
+ duration,
226
+ x: toX,
227
+ y: toY
228
+ },
229
+ {
230
+ type: 'pointerUp',
231
+ button: 0
232
+ }
233
+ ]
234
+ }
235
+ ]
236
+ };
237
+ await this.makeRequest('POST', `/session/${this.sessionId}/actions`, actions);
238
+ debugIOS(`Swiped using W3C Actions from (${fromX}, ${fromY}) to (${toX}, ${toY}) in ${duration}ms`);
208
239
  } catch (error) {
209
- debugIOS(`Failed to swipe from (${fromX}, ${fromY}) to (${toX}, ${toY}): ${error}`);
210
- throw new Error(`Failed to swipe: ${error}`);
240
+ debugIOS(`W3C Actions failed, falling back to dragfromtoforduration: ${error}`);
241
+ try {
242
+ await this.makeRequest('POST', `/session/${this.sessionId}/wda/dragfromtoforduration`, {
243
+ fromX,
244
+ fromY,
245
+ toX,
246
+ toY,
247
+ duration: duration / 1000
248
+ });
249
+ debugIOS(`Swiped from (${fromX}, ${fromY}) to (${toX}, ${toY}) in ${duration}ms`);
250
+ } catch (error2) {
251
+ debugIOS(`Failed to swipe from (${fromX}, ${fromY}) to (${toX}, ${toY}): ${error2}`);
252
+ throw new Error(`Failed to swipe: ${error2}`);
253
+ }
211
254
  }
212
255
  }
213
256
  async longPress(x, y, duration = 1000) {
@@ -355,11 +398,7 @@ class IOSDevice {
355
398
  }),
356
399
  defineActionKeyboardPress(async (param)=>{
357
400
  const key = param.keyName;
358
- if (Array.isArray(key)) {
359
- const keyToPress = key[key.length - 1];
360
- console.warn(`[iOS] Key combinations are not supported. Using last key: "${keyToPress}"`, 'Original input:', key);
361
- await this.pressKey(keyToPress);
362
- } else await this.pressKey(key);
401
+ await this.pressKey(key);
363
402
  }),
364
403
  defineAction({
365
404
  name: 'IOSHomeButton',
@@ -584,7 +623,7 @@ ScreenSize: ${size.width}x${size.height} (DPR: ${size.scale})
584
623
  x: width / 2,
585
624
  y: height / 2
586
625
  };
587
- const scrollDistance = distance || width / 3;
626
+ const scrollDistance = distance || 0.7 * width;
588
627
  await this.swipe(start.x, start.y, start.x + scrollDistance, start.y);
589
628
  }
590
629
  async scrollRight(distance, startPoint) {
@@ -596,7 +635,7 @@ ScreenSize: ${size.width}x${size.height} (DPR: ${size.scale})
596
635
  x: width / 2,
597
636
  y: height / 2
598
637
  };
599
- const scrollDistance = distance || width / 3;
638
+ const scrollDistance = distance || 0.7 * width;
600
639
  await this.swipe(start.x, start.y, start.x - scrollDistance, start.y);
601
640
  }
602
641
  async scrollUntilTop(startPoint) {
package/dist/lib/bin.js CHANGED
@@ -12141,17 +12141,60 @@ var __webpack_exports__ = {};
12141
12141
  async swipe(fromX, fromY, toX, toY, duration = 500) {
12142
12142
  this.ensureSession();
12143
12143
  try {
12144
- await this.makeRequest('POST', `/session/${this.sessionId}/wda/dragfromtoforduration`, {
12145
- fromX,
12146
- fromY,
12147
- toX,
12148
- toY,
12149
- duration: duration / 1000
12150
- });
12151
- debugIOS(`Swiped from (${fromX}, ${fromY}) to (${toX}, ${toY}) in ${duration}ms`);
12144
+ const actions = {
12145
+ actions: [
12146
+ {
12147
+ type: 'pointer',
12148
+ id: 'finger1',
12149
+ parameters: {
12150
+ pointerType: 'touch'
12151
+ },
12152
+ actions: [
12153
+ {
12154
+ type: 'pointerMove',
12155
+ duration: 0,
12156
+ x: fromX,
12157
+ y: fromY
12158
+ },
12159
+ {
12160
+ type: 'pointerDown',
12161
+ button: 0
12162
+ },
12163
+ {
12164
+ type: 'pause',
12165
+ duration: 100
12166
+ },
12167
+ {
12168
+ type: 'pointerMove',
12169
+ duration,
12170
+ x: toX,
12171
+ y: toY
12172
+ },
12173
+ {
12174
+ type: 'pointerUp',
12175
+ button: 0
12176
+ }
12177
+ ]
12178
+ }
12179
+ ]
12180
+ };
12181
+ await this.makeRequest('POST', `/session/${this.sessionId}/actions`, actions);
12182
+ debugIOS(`Swiped using W3C Actions from (${fromX}, ${fromY}) to (${toX}, ${toY}) in ${duration}ms`);
12152
12183
  } catch (error) {
12153
- debugIOS(`Failed to swipe from (${fromX}, ${fromY}) to (${toX}, ${toY}): ${error}`);
12154
- throw new Error(`Failed to swipe: ${error}`);
12184
+ debugIOS(`W3C Actions failed, falling back to dragfromtoforduration: ${error}`);
12185
+ try {
12186
+ await this.makeRequest('POST', `/session/${this.sessionId}/wda/dragfromtoforduration`, {
12187
+ fromX,
12188
+ fromY,
12189
+ toX,
12190
+ toY,
12191
+ duration: duration / 1000
12192
+ });
12193
+ debugIOS(`Swiped from (${fromX}, ${fromY}) to (${toX}, ${toY}) in ${duration}ms`);
12194
+ } catch (error2) {
12195
+ debugIOS(`Failed to swipe from (${fromX}, ${fromY}) to (${toX}, ${toY}): ${error2}`);
12196
+ throw new Error(`Failed to swipe: ${error2}`);
12197
+ }
12155
12198
  }
12156
12199
  }
12157
12200
  async longPress(x, y, duration = 1000) {
@@ -12299,11 +12342,7 @@ var __webpack_exports__ = {};
12299
12342
  }),
12300
12343
  (0, device_namespaceObject.defineActionKeyboardPress)(async (param)=>{
12301
12344
  const key = param.keyName;
12302
- if (Array.isArray(key)) {
12303
- const keyToPress = key[key.length - 1];
12304
- console.warn(`[iOS] Key combinations are not supported. Using last key: "${keyToPress}"`, 'Original input:', key);
12305
- await this.pressKey(keyToPress);
12306
- } else await this.pressKey(key);
12345
+ await this.pressKey(key);
12307
12346
  }),
12308
12347
  (0, device_namespaceObject.defineAction)({
12309
12348
  name: 'IOSHomeButton',
@@ -12528,7 +12567,7 @@ ScreenSize: ${size.width}x${size.height} (DPR: ${size.scale})
12528
12567
  x: width / 2,
12529
12568
  y: height / 2
12530
12569
  };
12531
- const scrollDistance = distance || width / 3;
12570
+ const scrollDistance = distance || 0.7 * width;
12532
12571
  await this.swipe(start.x, start.y, start.x + scrollDistance, start.y);
12533
12572
  }
12534
12573
  async scrollRight(distance, startPoint) {
@@ -12540,7 +12579,7 @@ ScreenSize: ${size.width}x${size.height} (DPR: ${size.scale})
12540
12579
  x: width / 2,
12541
12580
  y: height / 2
12542
12581
  };
12543
- const scrollDistance = distance || width / 3;
12582
+ const scrollDistance = distance || 0.7 * width;
12544
12583
  await this.swipe(start.x, start.y, start.x - scrollDistance, start.y);
12545
12584
  }
12546
12585
  async scrollUntilTop(startPoint) {
package/dist/lib/index.js CHANGED
@@ -235,17 +235,60 @@ class IOSWebDriverClient extends webdriver_namespaceObject.WebDriverClient {
235
235
  async swipe(fromX, fromY, toX, toY, duration = 500) {
236
236
  this.ensureSession();
237
237
  try {
238
- await this.makeRequest('POST', `/session/${this.sessionId}/wda/dragfromtoforduration`, {
239
- fromX,
240
- fromY,
241
- toX,
242
- toY,
243
- duration: duration / 1000
244
- });
245
- debugIOS(`Swiped from (${fromX}, ${fromY}) to (${toX}, ${toY}) in ${duration}ms`);
238
+ const actions = {
239
+ actions: [
240
+ {
241
+ type: 'pointer',
242
+ id: 'finger1',
243
+ parameters: {
244
+ pointerType: 'touch'
245
+ },
246
+ actions: [
247
+ {
248
+ type: 'pointerMove',
249
+ duration: 0,
250
+ x: fromX,
251
+ y: fromY
252
+ },
253
+ {
254
+ type: 'pointerDown',
255
+ button: 0
256
+ },
257
+ {
258
+ type: 'pause',
259
+ duration: 100
260
+ },
261
+ {
262
+ type: 'pointerMove',
263
+ duration,
264
+ x: toX,
265
+ y: toY
266
+ },
267
+ {
268
+ type: 'pointerUp',
269
+ button: 0
270
+ }
271
+ ]
272
+ }
273
+ ]
274
+ };
275
+ await this.makeRequest('POST', `/session/${this.sessionId}/actions`, actions);
276
+ debugIOS(`Swiped using W3C Actions from (${fromX}, ${fromY}) to (${toX}, ${toY}) in ${duration}ms`);
246
277
  } catch (error) {
247
- debugIOS(`Failed to swipe from (${fromX}, ${fromY}) to (${toX}, ${toY}): ${error}`);
248
- throw new Error(`Failed to swipe: ${error}`);
278
+ debugIOS(`W3C Actions failed, falling back to dragfromtoforduration: ${error}`);
279
+ try {
280
+ await this.makeRequest('POST', `/session/${this.sessionId}/wda/dragfromtoforduration`, {
281
+ fromX,
282
+ fromY,
283
+ toX,
284
+ toY,
285
+ duration: duration / 1000
286
+ });
287
+ debugIOS(`Swiped from (${fromX}, ${fromY}) to (${toX}, ${toY}) in ${duration}ms`);
288
+ } catch (error2) {
289
+ debugIOS(`Failed to swipe from (${fromX}, ${fromY}) to (${toX}, ${toY}): ${error2}`);
290
+ throw new Error(`Failed to swipe: ${error2}`);
291
+ }
249
292
  }
250
293
  }
251
294
  async longPress(x, y, duration = 1000) {
@@ -393,11 +436,7 @@ class IOSDevice {
393
436
  }),
394
437
  (0, device_namespaceObject.defineActionKeyboardPress)(async (param)=>{
395
438
  const key = param.keyName;
396
- if (Array.isArray(key)) {
397
- const keyToPress = key[key.length - 1];
398
- console.warn(`[iOS] Key combinations are not supported. Using last key: "${keyToPress}"`, 'Original input:', key);
399
- await this.pressKey(keyToPress);
400
- } else await this.pressKey(key);
439
+ await this.pressKey(key);
401
440
  }),
402
441
  (0, device_namespaceObject.defineAction)({
403
442
  name: 'IOSHomeButton',
@@ -622,7 +661,7 @@ ScreenSize: ${size.width}x${size.height} (DPR: ${size.scale})
622
661
  x: width / 2,
623
662
  y: height / 2
624
663
  };
625
- const scrollDistance = distance || width / 3;
664
+ const scrollDistance = distance || 0.7 * width;
626
665
  await this.swipe(start.x, start.y, start.x + scrollDistance, start.y);
627
666
  }
628
667
  async scrollRight(distance, startPoint) {
@@ -634,7 +673,7 @@ ScreenSize: ${size.width}x${size.height} (DPR: ${size.scale})
634
673
  x: width / 2,
635
674
  y: height / 2
636
675
  };
637
- const scrollDistance = distance || width / 3;
676
+ const scrollDistance = distance || 0.7 * width;
638
677
  await this.swipe(start.x, start.y, start.x - scrollDistance, start.y);
639
678
  }
640
679
  async scrollUntilTop(startPoint) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@midscene/ios",
3
- "version": "0.30.6-beta-20251021121032.0",
3
+ "version": "0.30.6-beta-20251022061854.0",
4
4
  "description": "iOS automation library for Midscene",
5
5
  "keywords": [
6
6
  "iOS UI automation",
@@ -38,9 +38,9 @@
38
38
  "dependencies": {
39
39
  "@inquirer/prompts": "^7.8.6",
40
40
  "open": "10.1.0",
41
- "@midscene/core": "0.30.6-beta-20251021121032.0",
42
- "@midscene/webdriver": "0.30.6-beta-20251021121032.0",
43
- "@midscene/shared": "0.30.6-beta-20251021121032.0"
41
+ "@midscene/core": "0.30.6-beta-20251022061854.0",
42
+ "@midscene/shared": "0.30.6-beta-20251022061854.0",
43
+ "@midscene/webdriver": "0.30.6-beta-20251022061854.0"
44
44
  },
45
45
  "devDependencies": {
46
46
  "@rslib/core": "^0.11.2",
@@ -49,7 +49,7 @@
49
49
  "typescript": "^5.8.3",
50
50
  "tsx": "^4.19.2",
51
51
  "vitest": "3.0.5",
52
- "@midscene/playground": "0.30.6-beta-20251021121032.0"
52
+ "@midscene/playground": "0.30.6-beta-20251022061854.0"
53
53
  },
54
54
  "license": "MIT",
55
55
  "scripts": {
package/static/index.html CHANGED
@@ -1 +1 @@
1
- <!doctype html><html><head><link rel="icon" href="/favicon.ico"><title>Midscene Playground</title><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><script defer src="/static/js/lib-react.f566a9ed.js"></script><script defer src="/static/js/657.5a5fe47b.js"></script><script defer src="/static/js/index.b9367b66.js"></script><link href="/static/css/index.44466eb4.css" rel="stylesheet"></head><body><div id="root"></div></body></html>
1
+ <!doctype html><html><head><link rel="icon" href="/favicon.ico"><title>Midscene Playground</title><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><script defer src="/static/js/lib-react.f566a9ed.js"></script><script defer src="/static/js/657.5a5fe47b.js"></script><script defer src="/static/js/index.694f8c4a.js"></script><link href="/static/css/index.44466eb4.css" rel="stylesheet"></head><body><div id="root"></div></body></html>