appium-uiautomator2-driver 3.10.0 → 4.0.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 +69 -0
- package/README.md +19 -1
- package/build/lib/commands/actions.d.ts +13 -7
- package/build/lib/commands/actions.d.ts.map +1 -1
- package/build/lib/commands/actions.js +24 -10
- package/build/lib/commands/actions.js.map +1 -1
- package/build/lib/commands/alert.d.ts +8 -4
- package/build/lib/commands/alert.d.ts.map +1 -1
- package/build/lib/commands/alert.js +10 -6
- package/build/lib/commands/alert.js.map +1 -1
- package/build/lib/commands/app-management.d.ts +10 -6
- package/build/lib/commands/app-management.d.ts.map +1 -1
- package/build/lib/commands/app-management.js +13 -10
- package/build/lib/commands/app-management.js.map +1 -1
- package/build/lib/commands/clipboard.d.ts +0 -12
- package/build/lib/commands/clipboard.d.ts.map +1 -1
- package/build/lib/commands/clipboard.js +0 -18
- package/build/lib/commands/clipboard.js.map +1 -1
- package/build/lib/commands/element.d.ts +3 -2
- package/build/lib/commands/element.d.ts.map +1 -1
- package/build/lib/commands/element.js +3 -4
- package/build/lib/commands/element.js.map +1 -1
- package/build/lib/commands/gestures.d.ts +130 -22
- package/build/lib/commands/gestures.d.ts.map +1 -1
- package/build/lib/commands/gestures.js +130 -33
- package/build/lib/commands/gestures.js.map +1 -1
- package/build/lib/commands/keyboard.d.ts +11 -4
- package/build/lib/commands/keyboard.d.ts.map +1 -1
- package/build/lib/commands/keyboard.js +13 -7
- package/build/lib/commands/keyboard.js.map +1 -1
- package/build/lib/commands/navigation.d.ts +5 -2
- package/build/lib/commands/navigation.d.ts.map +1 -1
- package/build/lib/commands/navigation.js +5 -3
- package/build/lib/commands/navigation.js.map +1 -1
- package/build/lib/commands/screenshot.d.ts +4 -2
- package/build/lib/commands/screenshot.d.ts.map +1 -1
- package/build/lib/commands/screenshot.js +4 -3
- package/build/lib/commands/screenshot.js.map +1 -1
- package/build/lib/commands/types.d.ts +0 -387
- package/build/lib/commands/types.d.ts.map +1 -1
- package/build/lib/driver.d.ts +540 -8
- package/build/lib/driver.d.ts.map +1 -1
- package/build/lib/driver.js +2 -7
- package/build/lib/driver.js.map +1 -1
- package/build/lib/execute-method-map.d.ts +540 -0
- package/build/lib/execute-method-map.d.ts.map +1 -0
- package/build/lib/execute-method-map.js +257 -0
- package/build/lib/execute-method-map.js.map +1 -0
- package/build/tsconfig.tsbuildinfo +1 -1
- package/lib/commands/actions.js +32 -10
- package/lib/commands/alert.js +10 -6
- package/lib/commands/app-management.js +14 -11
- package/lib/commands/clipboard.js +0 -18
- package/lib/commands/element.js +3 -4
- package/lib/commands/gestures.js +184 -38
- package/lib/commands/keyboard.js +13 -8
- package/lib/commands/navigation.js +5 -3
- package/lib/commands/screenshot.js +4 -3
- package/lib/commands/types.ts +0 -406
- package/lib/driver.ts +2 -16
- package/lib/execute-method-map.ts +269 -0
- package/npm-shrinkwrap.json +41 -48
- package/package.json +3 -3
- package/build/lib/commands/app-strings.d.ts +0 -12
- package/build/lib/commands/app-strings.d.ts.map +0 -1
- package/build/lib/commands/app-strings.js +0 -19
- package/build/lib/commands/app-strings.js.map +0 -1
- package/build/lib/commands/execute.d.ts +0 -15
- package/build/lib/commands/execute.d.ts.map +0 -1
- package/build/lib/commands/execute.js +0 -83
- package/build/lib/commands/execute.js.map +0 -1
- package/lib/commands/app-strings.js +0 -16
- package/lib/commands/execute.js +0 -93
package/lib/commands/execute.js
DELETED
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
import _ from 'lodash';
|
|
2
|
-
import {AndroidDriver} from 'appium-android-driver';
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* @this {AndroidUiautomator2Driver}
|
|
6
|
-
* @returns {import('@appium/types').StringRecord<string>}
|
|
7
|
-
*/
|
|
8
|
-
export function mobileCommandsMapping() {
|
|
9
|
-
const commonMapping = new AndroidDriver().mobileCommandsMapping.call(this);
|
|
10
|
-
return {
|
|
11
|
-
...commonMapping,
|
|
12
|
-
dragGesture: 'mobileDragGesture',
|
|
13
|
-
flingGesture: 'mobileFlingGesture',
|
|
14
|
-
doubleClickGesture: 'mobileDoubleClickGesture',
|
|
15
|
-
clickGesture: 'mobileClickGesture',
|
|
16
|
-
longClickGesture: 'mobileLongClickGesture',
|
|
17
|
-
pinchCloseGesture: 'mobilePinchCloseGesture',
|
|
18
|
-
pinchOpenGesture: 'mobilePinchOpenGesture',
|
|
19
|
-
swipeGesture: 'mobileSwipeGesture',
|
|
20
|
-
scrollGesture: 'mobileScrollGesture',
|
|
21
|
-
scrollBackTo: 'mobileScrollBackTo',
|
|
22
|
-
scroll: 'mobileScroll',
|
|
23
|
-
viewportScreenshot: 'mobileViewportScreenshot',
|
|
24
|
-
viewportRect: 'mobileViewPortRect',
|
|
25
|
-
|
|
26
|
-
deepLink: 'mobileDeepLink',
|
|
27
|
-
|
|
28
|
-
acceptAlert: 'mobileAcceptAlert',
|
|
29
|
-
dismissAlert: 'mobileDismissAlert',
|
|
30
|
-
|
|
31
|
-
batteryInfo: 'mobileGetBatteryInfo',
|
|
32
|
-
|
|
33
|
-
deviceInfo: 'mobileGetDeviceInfo',
|
|
34
|
-
|
|
35
|
-
openNotifications: 'openNotifications',
|
|
36
|
-
|
|
37
|
-
type: 'mobileType',
|
|
38
|
-
replaceElementValue: 'mobileReplaceElementValue',
|
|
39
|
-
|
|
40
|
-
getAppStrings: 'mobileGetAppStrings',
|
|
41
|
-
|
|
42
|
-
installMultipleApks: 'mobileInstallMultipleApks',
|
|
43
|
-
backgroundApp: 'mobileBackgroundApp',
|
|
44
|
-
|
|
45
|
-
pressKey: 'mobilePressKey',
|
|
46
|
-
|
|
47
|
-
screenshots: 'mobileScreenshots',
|
|
48
|
-
|
|
49
|
-
scheduleAction: 'mobileScheduleAction',
|
|
50
|
-
getActionHistory: 'mobileGetActionHistory',
|
|
51
|
-
unscheduleAction: 'mobileUnscheduleAction',
|
|
52
|
-
|
|
53
|
-
setClipboard: 'mobileSetClipboard',
|
|
54
|
-
getClipboard: 'mobileGetClipboard',
|
|
55
|
-
};
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
/**
|
|
59
|
-
* @override
|
|
60
|
-
* @this {AndroidUiautomator2Driver}
|
|
61
|
-
* @param {string} mobileCommand
|
|
62
|
-
* @param {import('@appium/types').StringRecord} [opts={}]
|
|
63
|
-
* @returns {Promise<any>}
|
|
64
|
-
*/
|
|
65
|
-
export async function executeMobile(mobileCommand, opts = {}) {
|
|
66
|
-
return await new AndroidDriver().executeMobile.call(this, mobileCommand, preprocessOptions(opts));
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
// #region Internal Helpers
|
|
70
|
-
|
|
71
|
-
/**
|
|
72
|
-
* Renames the deprecated `element` key to `elementId`. Historically,
|
|
73
|
-
* all of the pre-Execute-Method-Map execute methods accepted an `element` _or_ and `elementId` param.
|
|
74
|
-
* This assigns the `element` value to `elementId` if `elementId` is not already present.
|
|
75
|
-
*
|
|
76
|
-
* @param {import('@appium/types').StringRecord} [opts={}]
|
|
77
|
-
* @internal
|
|
78
|
-
* @returns {import('@appium/types').StringRecord|undefined}
|
|
79
|
-
*/
|
|
80
|
-
function preprocessOptions(opts = {}) {
|
|
81
|
-
if (_.isPlainObject(opts) && !('elementId' in opts) && 'element' in opts) {
|
|
82
|
-
opts.elementId = opts.element;
|
|
83
|
-
delete opts.element;
|
|
84
|
-
this.log.debug(`Replaced the obsolete 'element' key with 'elementId'`);
|
|
85
|
-
}
|
|
86
|
-
return opts;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
// #endregion
|
|
90
|
-
|
|
91
|
-
/**
|
|
92
|
-
* @typedef {import('../driver').AndroidUiautomator2Driver} AndroidUiautomator2Driver
|
|
93
|
-
*/
|