appium-xcuitest-driver 5.16.0 → 5.16.1
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/CHANGELOG.md +7 -0
- package/build/lib/commands/gesture.d.ts +24 -19
- package/build/lib/commands/gesture.d.ts.map +1 -1
- package/build/lib/commands/gesture.js +172 -65
- package/build/lib/commands/gesture.js.map +1 -1
- package/build/lib/driver.d.ts +17 -13
- package/build/lib/driver.d.ts.map +1 -1
- package/build/lib/driver.js +1 -0
- package/build/lib/driver.js.map +1 -1
- package/build/lib/execute-method-map.d.ts +2 -3
- package/build/lib/execute-method-map.d.ts.map +1 -1
- package/build/lib/execute-method-map.js +2 -3
- package/build/lib/execute-method-map.js.map +1 -1
- package/lib/commands/gesture.js +186 -65
- package/lib/driver.js +1 -0
- package/lib/execute-method-map.ts +2 -3
- package/npm-shrinkwrap.json +6 -6
- package/package.json +2 -2
package/lib/commands/gesture.js
CHANGED
|
@@ -4,6 +4,37 @@ import _ from 'lodash';
|
|
|
4
4
|
|
|
5
5
|
const SUPPORTED_GESTURE_DIRECTIONS = ['up', 'down', 'left', 'right'];
|
|
6
6
|
|
|
7
|
+
/**
|
|
8
|
+
* @param {any} [opts]
|
|
9
|
+
* @returns {string|undefined}
|
|
10
|
+
*/
|
|
11
|
+
function toElementId(opts) {
|
|
12
|
+
if (_.isUndefined(opts)) {
|
|
13
|
+
return;
|
|
14
|
+
}
|
|
15
|
+
if (_.isString(opts) || _.isNumber(opts)) {
|
|
16
|
+
return String(opts);
|
|
17
|
+
}
|
|
18
|
+
if ('elementId' in opts || 'element' in opts) {
|
|
19
|
+
return util.unwrapElement(opts);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
*
|
|
25
|
+
* @param {XCUITestDriver} driver
|
|
26
|
+
* @param {Element|string} [elementId]
|
|
27
|
+
* @returns {Promise<string>}
|
|
28
|
+
*/
|
|
29
|
+
async function toElementOrApplicationId(driver, elementId) {
|
|
30
|
+
if (!_.isUndefined(elementId)) {
|
|
31
|
+
return util.unwrapElement(elementId);
|
|
32
|
+
}
|
|
33
|
+
return util.unwrapElement(
|
|
34
|
+
await driver.findNativeElementOrElements(`class name`, `XCUIElementTypeApplication`, false),
|
|
35
|
+
);
|
|
36
|
+
}
|
|
37
|
+
|
|
7
38
|
/**
|
|
8
39
|
* Converts the given value to a float number.
|
|
9
40
|
*
|
|
@@ -12,7 +43,7 @@ const SUPPORTED_GESTURE_DIRECTIONS = ['up', 'down', 'left', 'right'];
|
|
|
12
43
|
* @param {string} paramName
|
|
13
44
|
* @returns {number}
|
|
14
45
|
*/
|
|
15
|
-
function
|
|
46
|
+
function asFloat(value, paramName) {
|
|
16
47
|
const num = parseFloat(String(value));
|
|
17
48
|
if (Number.isNaN(num)) {
|
|
18
49
|
throw new errors.InvalidArgumentError(
|
|
@@ -22,6 +53,24 @@ function requireFloat(value, paramName) {
|
|
|
22
53
|
return num;
|
|
23
54
|
}
|
|
24
55
|
|
|
56
|
+
/**
|
|
57
|
+
* Converts the given value to an integer number.
|
|
58
|
+
*
|
|
59
|
+
* @throws If `value` is `NaN`
|
|
60
|
+
* @param {any} value
|
|
61
|
+
* @param {string} paramName
|
|
62
|
+
* @returns {number}
|
|
63
|
+
*/
|
|
64
|
+
function asInt(value, paramName) {
|
|
65
|
+
const num = parseInt(String(value), 10);
|
|
66
|
+
if (Number.isNaN(num)) {
|
|
67
|
+
throw new errors.InvalidArgumentError(
|
|
68
|
+
`"${paramName}" parameter should be a valid integer. "${value}" is given instead`,
|
|
69
|
+
);
|
|
70
|
+
}
|
|
71
|
+
return num;
|
|
72
|
+
}
|
|
73
|
+
|
|
25
74
|
/**
|
|
26
75
|
*
|
|
27
76
|
* @param {any[]} gestures
|
|
@@ -278,8 +327,8 @@ const helpers = {
|
|
|
278
327
|
if (!_.isNil(distance)) {
|
|
279
328
|
params.distance = distance;
|
|
280
329
|
}
|
|
281
|
-
|
|
282
|
-
return await this.proxyCommand(
|
|
330
|
+
elementId = await toElementOrApplicationId(this, elementId);
|
|
331
|
+
return await this.proxyCommand(`/wda/element/${elementId}/scroll`, 'POST', params);
|
|
283
332
|
},
|
|
284
333
|
/**
|
|
285
334
|
* @param {import('./types').Direction} direction
|
|
@@ -297,8 +346,8 @@ const helpers = {
|
|
|
297
346
|
if (!_.isNil(velocity)) {
|
|
298
347
|
params.velocity = velocity;
|
|
299
348
|
}
|
|
300
|
-
|
|
301
|
-
await this.proxyCommand(
|
|
349
|
+
elementId = await toElementOrApplicationId(this, elementId);
|
|
350
|
+
return await this.proxyCommand(`/wda/element/${elementId}/swipe`, 'POST', params);
|
|
302
351
|
},
|
|
303
352
|
/**
|
|
304
353
|
* Performs a pinch gesture on the given element or on the Application element.
|
|
@@ -317,18 +366,18 @@ const helpers = {
|
|
|
317
366
|
*/
|
|
318
367
|
async mobilePinch(scale, velocity, elementId) {
|
|
319
368
|
const params = {
|
|
320
|
-
scale:
|
|
321
|
-
velocity:
|
|
369
|
+
scale: asFloat(scale, 'scale'),
|
|
370
|
+
velocity: asFloat(velocity, 'velocity'),
|
|
322
371
|
};
|
|
323
|
-
|
|
324
|
-
await this.proxyCommand(
|
|
372
|
+
elementId = await toElementOrApplicationId(this, elementId);
|
|
373
|
+
return await this.proxyCommand(`/wda/element/${elementId}/pinch`, 'POST', params);
|
|
325
374
|
},
|
|
326
375
|
/**
|
|
327
376
|
* Performs double tap gesture on the given element or on the screen.
|
|
328
377
|
*
|
|
329
|
-
* @param {Element|string} [elementId] - The internal element identifier (as hexadecimal hash string) to double tap on.
|
|
330
|
-
* @param {number} [x] - The _x_ coordinate (float value) to double tap on.
|
|
331
|
-
* @param {number} [y] - The _y_ coordinate (float value) to double tap on.
|
|
378
|
+
* @param {Element|string} [elementId] - The internal element identifier (as hexadecimal hash string) to double tap on. This is required if `x` and `y` are not provided.
|
|
379
|
+
* @param {number} [x] - The _x_ coordinate (float value) to double tap on. This is required if `elementId` is not provided.
|
|
380
|
+
* @param {number} [y] - The _y_ coordinate (float value) to double tap on. This is required if `elementId` is not provided.
|
|
332
381
|
* @returns {Promise<void>}
|
|
333
382
|
* @this {XCUITestDriver}
|
|
334
383
|
* @example
|
|
@@ -338,8 +387,16 @@ const helpers = {
|
|
|
338
387
|
* ```
|
|
339
388
|
*/
|
|
340
389
|
async mobileDoubleTap(elementId, x, y) {
|
|
341
|
-
|
|
342
|
-
|
|
390
|
+
if (elementId) {
|
|
391
|
+
// Double tap element
|
|
392
|
+
return await this.proxyCommand(`/wda/element/${elementId}/doubleTap`, 'POST');
|
|
393
|
+
}
|
|
394
|
+
// Double tap coordinates
|
|
395
|
+
const params = {
|
|
396
|
+
x: asFloat(x, 'x'),
|
|
397
|
+
y: asFloat(y, 'y'),
|
|
398
|
+
};
|
|
399
|
+
return await this.proxyCommand('/wda/doubleTap', 'POST', params);
|
|
343
400
|
},
|
|
344
401
|
/**
|
|
345
402
|
* Performs two finger tap gesture on the given element or on the application element.
|
|
@@ -356,16 +413,16 @@ const helpers = {
|
|
|
356
413
|
* ```
|
|
357
414
|
*/
|
|
358
415
|
async mobileTwoFingerTap(elementId) {
|
|
359
|
-
|
|
360
|
-
await this.proxyCommand(
|
|
416
|
+
elementId = await toElementOrApplicationId(this, elementId);
|
|
417
|
+
return await this.proxyCommand(`/wda/element/${elementId}/twoFingerTap`, 'POST');
|
|
361
418
|
},
|
|
362
419
|
/**
|
|
363
420
|
* Performs a "long press" gesture on the given element or on the screen.
|
|
364
421
|
*
|
|
365
422
|
* @param {number} duration - The duration (in seconds) of the gesture.
|
|
366
|
-
* @param {number} [y] - The _y_ coordinate (float value) to
|
|
367
|
-
* @param {number} [x] - The _x_ coordinate (float value) to
|
|
368
|
-
* @param {Element|string} [elementId] - The internal element identifier (as hexadecimal hash string) to double tap on.
|
|
423
|
+
* @param {number} [y] - The _y_ coordinate (float value) to double tap on. This is required if `elementId` is not provided.
|
|
424
|
+
* @param {number} [x] - The _x_ coordinate (float value) to double tap on. This is required if `elementId` is not provided.
|
|
425
|
+
* @param {Element|string} [elementId] - The internal element identifier (as hexadecimal hash string) to double tap on. This is required if `x` and `y` are not provided.
|
|
369
426
|
* @this {XCUITestDriver}
|
|
370
427
|
* @see https://developer.apple.com/documentation/xctest/xcuielement/1618663-pressforduration?language=objc
|
|
371
428
|
* @example
|
|
@@ -377,24 +434,33 @@ const helpers = {
|
|
|
377
434
|
* ```
|
|
378
435
|
*/
|
|
379
436
|
async mobileTouchAndHold(duration, x, y, elementId) {
|
|
380
|
-
const
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
437
|
+
const params = {
|
|
438
|
+
duration: asFloat(duration, 'duration'),
|
|
439
|
+
};
|
|
440
|
+
if (elementId) {
|
|
441
|
+
// Long tap element
|
|
442
|
+
return await this.proxyCommand(`/wda/element/${elementId}/touchAndHold`, 'POST', params);
|
|
443
|
+
}
|
|
444
|
+
// Long tap coordinates
|
|
445
|
+
params.x = asFloat(x, 'x');
|
|
446
|
+
params.y = asFloat(y, 'y');
|
|
447
|
+
return await this.proxyCommand('/wda/touchAndHold', 'POST', params);
|
|
385
448
|
},
|
|
386
449
|
/**
|
|
387
450
|
* Performs tap gesture by coordinates on the given element or on the screen.
|
|
388
451
|
*
|
|
389
452
|
* @param {number} x - The _x_ coordinate (float value) to tap on. If `elementId` is provided, this is computed relative to the element; otherwise it is computed relative to the active Application element.
|
|
390
453
|
* @param {number} y - The _y_ coordinate (float value) to tap on. If `elementId` is provided, this is computed relative to the element; otherwise it is computed relative to the active Application element.
|
|
391
|
-
* @param {string|Element} [elementId] - The internal element identifier (as hexadecimal hash string) to tap on.
|
|
454
|
+
* @param {string|Element} [elementId] - The internal element identifier (as hexadecimal hash string) to tap on.
|
|
392
455
|
* @this {XCUITestDriver}
|
|
393
456
|
* @returns {Promise<void>}
|
|
394
457
|
*/
|
|
395
|
-
async mobileTap(x, y, elementId) {
|
|
396
|
-
const
|
|
397
|
-
|
|
458
|
+
async mobileTap(x, y, elementId = '0') {
|
|
459
|
+
const params = {
|
|
460
|
+
x: asFloat(x, 'x'),
|
|
461
|
+
y: asFloat(y, 'y'),
|
|
462
|
+
};
|
|
463
|
+
return await this.proxyCommand(`/wda/tap/${elementId}`, 'POST', params);
|
|
398
464
|
},
|
|
399
465
|
/**
|
|
400
466
|
* Performs drag and drop gesture by coordinates on the given element or on the screen.
|
|
@@ -423,15 +489,16 @@ const helpers = {
|
|
|
423
489
|
*/
|
|
424
490
|
async mobileDragFromToForDuration(duration, fromX, fromY, toX, toY, elementId) {
|
|
425
491
|
const params = {
|
|
426
|
-
duration:
|
|
427
|
-
fromX:
|
|
428
|
-
fromY:
|
|
429
|
-
toX:
|
|
430
|
-
toY:
|
|
492
|
+
duration: asFloat(duration, 'duration'),
|
|
493
|
+
fromX: asFloat(fromX, 'fromX'),
|
|
494
|
+
fromY: asFloat(fromY, 'fromY'),
|
|
495
|
+
toX: asFloat(toX, 'toX'),
|
|
496
|
+
toY: asFloat(toY, 'toY'),
|
|
431
497
|
};
|
|
498
|
+
elementId = toElementId(elementId);
|
|
432
499
|
return elementId
|
|
433
500
|
? // Drag element
|
|
434
|
-
await this.proxyCommand(`/wda/element/${
|
|
501
|
+
await this.proxyCommand(`/wda/element/${elementId}/dragfromtoforduration`, 'POST', params)
|
|
435
502
|
: // Drag coordinates
|
|
436
503
|
await this.proxyCommand('/wda/dragfromtoforduration', 'POST', params);
|
|
437
504
|
},
|
|
@@ -464,9 +531,9 @@ const helpers = {
|
|
|
464
531
|
toY,
|
|
465
532
|
) {
|
|
466
533
|
const params = {
|
|
467
|
-
pressDuration:
|
|
468
|
-
holdDuration:
|
|
469
|
-
velocity:
|
|
534
|
+
pressDuration: asFloat(pressDuration, 'pressDuration'),
|
|
535
|
+
holdDuration: asFloat(holdDuration, 'holdDuration'),
|
|
536
|
+
velocity: asFloat(velocity, 'velocity'),
|
|
470
537
|
};
|
|
471
538
|
fromElementId = fromElementId ? util.unwrapElement(fromElementId) : undefined;
|
|
472
539
|
if (fromElementId) {
|
|
@@ -483,20 +550,19 @@ const helpers = {
|
|
|
483
550
|
params,
|
|
484
551
|
);
|
|
485
552
|
}
|
|
486
|
-
params.fromX =
|
|
487
|
-
params.fromY =
|
|
488
|
-
params.toX =
|
|
489
|
-
params.toY =
|
|
553
|
+
params.fromX = asFloat(fromX, 'fromX');
|
|
554
|
+
params.fromY = asFloat(fromY, 'fromY');
|
|
555
|
+
params.toX = asFloat(toX, 'toX');
|
|
556
|
+
params.toY = asFloat(toY, 'toY');
|
|
490
557
|
return await this.proxyCommand('/wda/pressAndDragWithVelocity', 'POST', params);
|
|
491
558
|
},
|
|
492
559
|
/**
|
|
493
560
|
* Sends one or more taps with one or more touch points.
|
|
494
561
|
*
|
|
495
562
|
* @since 1.17.1
|
|
496
|
-
* @param {
|
|
497
|
-
* @param {number}
|
|
498
|
-
* @param {
|
|
499
|
-
* The Application element will be used if this parameter is not provided.
|
|
563
|
+
* @param {string|Element} elementId - The internal element identifier (as hexadecimal hash string) to perform one or more taps.
|
|
564
|
+
* @param {number} numberOfTaps - Number of taps to perform.
|
|
565
|
+
* @param {number} numberOfTouches - Number of touch points to use.
|
|
500
566
|
* @returns {Promise<void>}
|
|
501
567
|
* @this {XCUITestDriver}
|
|
502
568
|
* @see https://developer.apple.com/documentation/xctest/xcuielement/1618671-tapwithnumberoftaps?language=objc
|
|
@@ -507,14 +573,17 @@ const helpers = {
|
|
|
507
573
|
* @driver.execute_script 'mobile: tapWithNumberOfTaps', {element: e.ref, numberOfTaps: 2, numberOfTouches: 1}
|
|
508
574
|
* ```
|
|
509
575
|
*/
|
|
510
|
-
async mobileTapWithNumberOfTaps(numberOfTouches
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
576
|
+
async mobileTapWithNumberOfTaps(elementId, numberOfTouches, numberOfTaps) {
|
|
577
|
+
if (!elementId) {
|
|
578
|
+
throw new errors.InvalidArgumentError(
|
|
579
|
+
'Element id is expected to be set for tapWithNumberOfTaps method',
|
|
580
|
+
);
|
|
581
|
+
}
|
|
582
|
+
const params = {
|
|
583
|
+
numberOfTaps: asInt(numberOfTaps, 'numberOfTaps'),
|
|
584
|
+
numberOfTouches: asInt(numberOfTouches, 'numberOfTouches'),
|
|
585
|
+
};
|
|
586
|
+
return await this.proxyCommand(`/wda/element/${elementId}/tapWithNumberOfTaps`, 'POST', params);
|
|
518
587
|
},
|
|
519
588
|
/**
|
|
520
589
|
* Performs a "force press" on the given element or coordinates.
|
|
@@ -524,13 +593,13 @@ const helpers = {
|
|
|
524
593
|
* @param {number} [y] - The _y_ coordinate of the gesture. If `elementId` is set, this is calculated relative to its position; otherwise it's calculated relative to the active Application.
|
|
525
594
|
* @param {number} [duration] - The duraiton (in seconds) of the force press. If this is provided, `pressure` must also be provided.
|
|
526
595
|
* @param {number} [pressure] - A float value defining the pressure of the force press. If this is provided, `duration` must also be provided.
|
|
527
|
-
* @param {string|Element} [elementId] - The internal element identifier (as hexadecimal hash string) to perform one or more taps.
|
|
528
|
-
* The Application element will be used if this parameter is not provided.
|
|
596
|
+
* @param {string|Element} [elementId] - The internal element identifier (as hexadecimal hash string) to perform one or more taps. If this is _not_ provided, both `x` and `y` must be provided. If this is provided _and_ `x` and `y` are not provided, the actual touch point will be calculated internally.
|
|
529
597
|
* @returns {Promise<void>}
|
|
530
598
|
* @this {XCUITestDriver}
|
|
531
599
|
*/
|
|
532
600
|
async mobileForcePress(x, y, duration, pressure, elementId) {
|
|
533
|
-
|
|
601
|
+
elementId = toElementId(elementId);
|
|
602
|
+
const endpoint = elementId ? `/wda/element/${elementId}/forceTouch` : `/wda/forceTouch`;
|
|
534
603
|
return await this.proxyCommand(endpoint, 'POST', {x, y, duration, pressure});
|
|
535
604
|
},
|
|
536
605
|
/**
|
|
@@ -556,6 +625,7 @@ const helpers = {
|
|
|
556
625
|
* ```
|
|
557
626
|
*/
|
|
558
627
|
async mobileSelectPickerWheelValue(elementId, order, offset, value, maxAttempts) {
|
|
628
|
+
elementId = /** @type {string} */ (toElementId(elementId));
|
|
559
629
|
if (!elementId) {
|
|
560
630
|
throw new errors.InvalidArgumentError(
|
|
561
631
|
'elementId is expected to be set for selectPickerWheelValue method',
|
|
@@ -569,7 +639,7 @@ const helpers = {
|
|
|
569
639
|
}
|
|
570
640
|
const params = {order};
|
|
571
641
|
if (offset) {
|
|
572
|
-
params.offset =
|
|
642
|
+
params.offset = asFloat(offset, 'offset');
|
|
573
643
|
}
|
|
574
644
|
if (!_.isNil(value)) {
|
|
575
645
|
params.value = value;
|
|
@@ -577,16 +647,15 @@ const helpers = {
|
|
|
577
647
|
if (!_.isNil(maxAttempts)) {
|
|
578
648
|
params.maxAttempts = maxAttempts;
|
|
579
649
|
}
|
|
580
|
-
return await this.proxyCommand(`/wda/pickerwheel/${
|
|
650
|
+
return await this.proxyCommand(`/wda/pickerwheel/${elementId}/select`, 'POST', params);
|
|
581
651
|
},
|
|
582
652
|
/**
|
|
583
653
|
* Performs a rotate gesture on the given element.
|
|
584
654
|
*
|
|
585
655
|
* @see https://developer.apple.com/documentation/xctest/xcuielement/1618665-rotate?language=objc
|
|
656
|
+
* @param {string|Element} elementId - The internal element identifier (as hexadecimal hash string) to perform the gesture on.
|
|
586
657
|
* @param {number} rotation - The rotation gesture (in radians)
|
|
587
658
|
* @param {number} velocity - The velocity (in radians-per-second) of the gesture.
|
|
588
|
-
* @param {string|Element} [elementId] - The internal element identifier (as hexadecimal hash string) to perform the gesture on.
|
|
589
|
-
* The Application element will be used if this parameter is not provided.
|
|
590
659
|
* @returns {Promise<void>}
|
|
591
660
|
* @this {XCUITestDriver}
|
|
592
661
|
* @example
|
|
@@ -601,13 +670,65 @@ const helpers = {
|
|
|
601
670
|
* ));
|
|
602
671
|
* ```
|
|
603
672
|
*/
|
|
604
|
-
async mobileRotateElement(rotation, velocity
|
|
673
|
+
async mobileRotateElement(elementId, rotation, velocity) {
|
|
674
|
+
elementId = /** @type {string} */ (toElementId(elementId));
|
|
675
|
+
if (!elementId) {
|
|
676
|
+
throw new errors.InvalidArgumentError(
|
|
677
|
+
'Element id is expected to be set for rotateElement method',
|
|
678
|
+
);
|
|
679
|
+
}
|
|
605
680
|
const params = {
|
|
606
|
-
rotation:
|
|
607
|
-
velocity:
|
|
681
|
+
rotation: asFloat(rotation, 'rotation'),
|
|
682
|
+
velocity: asFloat(velocity, 'velocity'),
|
|
608
683
|
};
|
|
609
|
-
|
|
610
|
-
|
|
684
|
+
return await this.proxyCommand(`/wda/element/${elementId}/rotate`, 'POST', params);
|
|
685
|
+
},
|
|
686
|
+
/**
|
|
687
|
+
* @this {XCUITestDriver}
|
|
688
|
+
*/
|
|
689
|
+
async getCoordinates(gesture) {
|
|
690
|
+
// defaults
|
|
691
|
+
let coordinates = {x: 0, y: 0, areOffsets: false};
|
|
692
|
+
|
|
693
|
+
let optionX = null;
|
|
694
|
+
if (gesture.options.x) {
|
|
695
|
+
optionX = asFloat(gesture.options.x, 'x');
|
|
696
|
+
}
|
|
697
|
+
let optionY = null;
|
|
698
|
+
if (gesture.options.y) {
|
|
699
|
+
optionY = asFloat(gesture.options.y, 'y');
|
|
700
|
+
}
|
|
701
|
+
|
|
702
|
+
// figure out the element coordinates.
|
|
703
|
+
const elementId = toElementId(gesture.options);
|
|
704
|
+
if (elementId) {
|
|
705
|
+
let rect = await this.getElementRect(elementId);
|
|
706
|
+
let pos = {x: rect.x, y: rect.y};
|
|
707
|
+
let size = {w: rect.width, h: rect.height};
|
|
708
|
+
|
|
709
|
+
// defaults
|
|
710
|
+
let offsetX = 0;
|
|
711
|
+
let offsetY = 0;
|
|
712
|
+
|
|
713
|
+
// get the real offsets
|
|
714
|
+
if (optionX || optionY) {
|
|
715
|
+
offsetX = optionX || 0;
|
|
716
|
+
offsetY = optionY || 0;
|
|
717
|
+
} else {
|
|
718
|
+
offsetX = size.w / 2;
|
|
719
|
+
offsetY = size.h / 2;
|
|
720
|
+
}
|
|
721
|
+
|
|
722
|
+
// apply the offsets
|
|
723
|
+
coordinates.x = pos.x + offsetX;
|
|
724
|
+
coordinates.y = pos.y + offsetY;
|
|
725
|
+
} else {
|
|
726
|
+
// moveTo coordinates are passed in as offsets
|
|
727
|
+
coordinates.areOffsets = gesture.action === 'moveTo';
|
|
728
|
+
coordinates.x = optionX || 0;
|
|
729
|
+
coordinates.y = optionY || 0;
|
|
730
|
+
}
|
|
731
|
+
return coordinates;
|
|
611
732
|
},
|
|
612
733
|
};
|
|
613
734
|
|
package/lib/driver.js
CHANGED
|
@@ -2018,6 +2018,7 @@ class XCUITestDriver extends BaseDriver {
|
|
|
2018
2018
|
mobileForcePress = commands.gestureExtensions.mobileForcePress;
|
|
2019
2019
|
mobileSelectPickerWheelValue = commands.gestureExtensions.mobileSelectPickerWheelValue;
|
|
2020
2020
|
mobileRotateElement = commands.gestureExtensions.mobileRotateElement;
|
|
2021
|
+
getCoordinates = commands.gestureExtensions.getCoordinates;
|
|
2021
2022
|
|
|
2022
2023
|
/*-------+
|
|
2023
2024
|
| IOHID |
|
|
@@ -61,7 +61,7 @@ export const executeMethodMap = {
|
|
|
61
61
|
'mobile: tapWithNumberOfTaps': {
|
|
62
62
|
command: 'mobileTapWithNumberOfTaps',
|
|
63
63
|
params: {
|
|
64
|
-
|
|
64
|
+
required: ['elementId', 'numberOfTouches', 'numberOfTaps'],
|
|
65
65
|
},
|
|
66
66
|
},
|
|
67
67
|
// https://developer.apple.com/documentation/xctest/xcuielement/1618663-pressforduration?language=objc
|
|
@@ -84,8 +84,7 @@ export const executeMethodMap = {
|
|
|
84
84
|
'mobile: rotateElement': {
|
|
85
85
|
command: 'mobileRotateElement',
|
|
86
86
|
params: {
|
|
87
|
-
required: ['rotation', 'velocity'],
|
|
88
|
-
optional: ['elementId'],
|
|
87
|
+
required: ['elementId', 'rotation', 'velocity'],
|
|
89
88
|
},
|
|
90
89
|
},
|
|
91
90
|
// https://developer.apple.com/documentation/xctest/xcuicoordinate/3551692-pressforduration?language=objc
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "appium-xcuitest-driver",
|
|
3
|
-
"version": "5.16.
|
|
3
|
+
"version": "5.16.1",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "appium-xcuitest-driver",
|
|
9
|
-
"version": "5.16.
|
|
9
|
+
"version": "5.16.1",
|
|
10
10
|
"license": "Apache-2.0",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@colors/colors": "^1.6.0",
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"appium-ios-device": "^2.5.4",
|
|
15
15
|
"appium-ios-simulator": "^5.5.1",
|
|
16
16
|
"appium-remote-debugger": "^10.0.0",
|
|
17
|
-
"appium-webdriveragent": "
|
|
17
|
+
"appium-webdriveragent": "~5.15.9",
|
|
18
18
|
"appium-xcode": "^5.1.4",
|
|
19
19
|
"async-lock": "^1.4.0",
|
|
20
20
|
"asyncbox": "^3.0.0",
|
|
@@ -1064,9 +1064,9 @@
|
|
|
1064
1064
|
}
|
|
1065
1065
|
},
|
|
1066
1066
|
"node_modules/appium-webdriveragent": {
|
|
1067
|
-
"version": "
|
|
1068
|
-
"resolved": "https://registry.npmjs.org/appium-webdriveragent/-/appium-webdriveragent-
|
|
1069
|
-
"integrity": "sha512-
|
|
1067
|
+
"version": "5.15.9",
|
|
1068
|
+
"resolved": "https://registry.npmjs.org/appium-webdriveragent/-/appium-webdriveragent-5.15.9.tgz",
|
|
1069
|
+
"integrity": "sha512-03brYer2B68V+Jqjy8VVYNEeDftSzizZaXGazZsAq1ENDhvXgzIErKWjFAswTQWu/ciDmXASt8I96K6ks+Gy0A==",
|
|
1070
1070
|
"dependencies": {
|
|
1071
1071
|
"@appium/base-driver": "^9.0.0",
|
|
1072
1072
|
"@appium/strongbox": "^0.x",
|
package/package.json
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"xcuitest",
|
|
9
9
|
"xctest"
|
|
10
10
|
],
|
|
11
|
-
"version": "5.16.
|
|
11
|
+
"version": "5.16.1",
|
|
12
12
|
"author": "Appium Contributors",
|
|
13
13
|
"license": "Apache-2.0",
|
|
14
14
|
"repository": {
|
|
@@ -81,7 +81,7 @@
|
|
|
81
81
|
"appium-ios-device": "^2.5.4",
|
|
82
82
|
"appium-ios-simulator": "^5.5.1",
|
|
83
83
|
"appium-remote-debugger": "^10.0.0",
|
|
84
|
-
"appium-webdriveragent": "
|
|
84
|
+
"appium-webdriveragent": "~5.15.9",
|
|
85
85
|
"appium-xcode": "^5.1.4",
|
|
86
86
|
"async-lock": "^1.4.0",
|
|
87
87
|
"asyncbox": "^3.0.0",
|