appium-uiautomator2-driver 2.29.11 → 2.30.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/CHANGELOG.md +7 -0
- package/build/index.d.ts +4 -0
- package/build/index.d.ts.map +1 -0
- package/build/index.js +8 -15
- package/build/index.js.map +1 -0
- package/build/lib/commands/actions.d.ts +2 -0
- package/build/lib/commands/actions.d.ts.map +1 -0
- package/build/lib/commands/actions.js +67 -62
- package/build/lib/commands/actions.js.map +1 -1
- package/build/lib/commands/alert.d.ts +2 -0
- package/build/lib/commands/alert.d.ts.map +1 -0
- package/build/lib/commands/alert.js +28 -26
- package/build/lib/commands/alert.js.map +1 -1
- package/build/lib/commands/app-strings.d.ts +3 -0
- package/build/lib/commands/app-strings.d.ts.map +1 -0
- package/build/lib/commands/app-strings.js +86 -57
- package/build/lib/commands/app-strings.js.map +1 -1
- package/build/lib/commands/battery.d.ts +2 -0
- package/build/lib/commands/battery.d.ts.map +1 -0
- package/build/lib/commands/battery.js +26 -16
- package/build/lib/commands/battery.js.map +1 -1
- package/build/lib/commands/element.d.ts +2 -0
- package/build/lib/commands/element.d.ts.map +1 -0
- package/build/lib/commands/element.js +140 -159
- package/build/lib/commands/element.js.map +1 -1
- package/build/lib/commands/find.d.ts +2 -0
- package/build/lib/commands/find.d.ts.map +1 -0
- package/build/lib/commands/find.js +39 -25
- package/build/lib/commands/find.js.map +1 -1
- package/build/lib/commands/general.d.ts +4 -0
- package/build/lib/commands/general.d.ts.map +1 -0
- package/build/lib/commands/general.js +217 -215
- package/build/lib/commands/general.js.map +1 -1
- package/build/lib/commands/gestures.d.ts +2 -0
- package/build/lib/commands/gestures.d.ts.map +1 -0
- package/build/lib/commands/gestures.js +206 -193
- package/build/lib/commands/gestures.js.map +1 -1
- package/build/lib/commands/index.d.ts +2 -0
- package/build/lib/commands/index.d.ts.map +1 -0
- package/build/lib/commands/index.js +13 -22
- package/build/lib/commands/index.js.map +1 -1
- package/build/lib/commands/mixins.d.ts +84 -0
- package/build/lib/commands/mixins.d.ts.map +1 -0
- package/build/lib/commands/mixins.js +23 -0
- package/build/lib/commands/mixins.js.map +1 -0
- package/build/lib/commands/screenshot.d.ts +2 -0
- package/build/lib/commands/screenshot.d.ts.map +1 -0
- package/build/lib/commands/screenshot.js +77 -62
- package/build/lib/commands/screenshot.js.map +1 -1
- package/build/lib/commands/touch.d.ts +2 -0
- package/build/lib/commands/touch.d.ts.map +1 -0
- package/build/lib/commands/touch.js +48 -38
- package/build/lib/commands/touch.js.map +1 -1
- package/build/lib/commands/types.d.ts +452 -0
- package/build/lib/commands/types.d.ts.map +1 -0
- package/build/lib/commands/types.js +3 -0
- package/build/lib/commands/types.js.map +1 -0
- package/build/lib/commands/viewport.d.ts +2 -0
- package/build/lib/commands/viewport.d.ts.map +1 -0
- package/build/lib/commands/viewport.js +37 -35
- package/build/lib/commands/viewport.js.map +1 -1
- package/build/lib/constraints.d.ts +334 -0
- package/build/lib/constraints.d.ts.map +1 -0
- package/build/lib/constraints.js +51 -0
- package/build/lib/constraints.js.map +1 -0
- package/build/lib/css-converter.d.ts +45 -0
- package/build/lib/css-converter.d.ts.map +1 -0
- package/build/lib/css-converter.js +272 -175
- package/build/lib/css-converter.js.map +1 -1
- package/build/lib/driver.d.ts +912 -0
- package/build/lib/driver.d.ts.map +1 -0
- package/build/lib/driver.js +738 -482
- package/build/lib/driver.js.map +1 -1
- package/build/lib/execute-method-map.d.ts +477 -0
- package/build/lib/execute-method-map.d.ts.map +1 -0
- package/build/lib/execute-method-map.js +542 -0
- package/build/lib/execute-method-map.js.map +1 -0
- package/build/lib/extensions.d.ts +3 -0
- package/build/lib/extensions.d.ts.map +1 -0
- package/build/lib/extensions.js +7 -9
- package/build/lib/extensions.js.map +1 -1
- package/build/lib/helpers.d.ts +7 -0
- package/build/lib/helpers.d.ts.map +1 -0
- package/build/lib/helpers.js +36 -29
- package/build/lib/helpers.js.map +1 -1
- package/build/lib/logger.d.ts +3 -0
- package/build/lib/logger.d.ts.map +1 -0
- package/build/lib/logger.js +5 -10
- package/build/lib/logger.js.map +1 -1
- package/build/lib/method-map.d.ts +389 -0
- package/build/lib/method-map.d.ts.map +1 -0
- package/build/lib/method-map.js +11 -17
- package/build/lib/method-map.js.map +1 -1
- package/build/lib/types.d.ts +45 -0
- package/build/lib/types.d.ts.map +1 -0
- package/build/lib/types.js +3 -0
- package/build/lib/types.js.map +1 -0
- package/build/lib/uiautomator2.d.ts +45 -0
- package/build/lib/uiautomator2.d.ts.map +1 -0
- package/build/lib/uiautomator2.js +340 -299
- package/build/lib/uiautomator2.js.map +1 -1
- package/build/lib/utils.d.ts +10 -0
- package/build/lib/utils.d.ts.map +1 -0
- package/build/lib/utils.js +23 -16
- package/build/lib/utils.js.map +1 -1
- package/build/tsconfig.tsbuildinfo +1 -0
- package/index.js +5 -3
- package/lib/commands/actions.js +115 -101
- package/lib/commands/alert.js +36 -44
- package/lib/commands/app-strings.js +79 -58
- package/lib/commands/battery.js +27 -28
- package/lib/commands/element.js +231 -134
- package/lib/commands/find.js +40 -21
- package/lib/commands/general.js +271 -336
- package/lib/commands/gestures.js +252 -366
- package/lib/commands/index.js +11 -31
- package/lib/commands/mixins.ts +167 -0
- package/lib/commands/screenshot.js +80 -76
- package/lib/commands/touch.js +64 -31
- package/lib/commands/types.ts +473 -0
- package/lib/commands/viewport.js +43 -31
- package/lib/constraints.ts +53 -0
- package/lib/css-converter.js +9 -1
- package/lib/{driver.js → driver.ts} +383 -225
- package/lib/execute-method-map.ts +573 -0
- package/lib/method-map.ts +11 -0
- package/lib/types.ts +59 -0
- package/lib/uiautomator2.js +21 -2
- package/lib/utils.js +2 -2
- package/npm-shrinkwrap.json +363 -492
- package/package.json +95 -69
- package/build/lib/desired-caps.js +0 -71
- package/build/lib/desired-caps.js.map +0 -1
- package/lib/desired-caps.js +0 -70
- package/lib/method-map.js +0 -11
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module
|
|
3
|
+
* @privateRemarks These mixins are kind of a mishmash of stuff from `appium-android-driver`, unique things, and stuff from `ExternalDriver`. Ideally, we should be pulling the method definitions right out of `ExternalDriver` whenever possible. Also note that the mixins contain _more stuff than just commands or execute methods_.
|
|
4
|
+
*/
|
|
5
|
+
import type { Element, ExternalDriver, StringRecord } from '@appium/types';
|
|
6
|
+
import type { ActionsMixin, AlertMixin, ElementMixin, ExecuteMixin, FindMixin, GeneralMixin, NetworkMixin, TouchMixin } from 'appium-android-driver';
|
|
7
|
+
import type { EmptyObject } from 'type-fest';
|
|
8
|
+
import { AndroidUiautomator2Driver } from '../driver';
|
|
9
|
+
import type * as types from './types';
|
|
10
|
+
type UIA2Mixin<T = EmptyObject> = ThisType<import('../driver').AndroidUiautomator2Driver> & T;
|
|
11
|
+
export type UIA2ActionsMixin = UIA2Mixin<Pick<ActionsMixin, 'pressKeyCode' | 'longPressKeyCode' | 'doSwipe' | 'doDrag' | 'getOrientation' | 'setOrientation'>> & {
|
|
12
|
+
mobilePressKey(opts: types.PressKeyOptions): Promise<void>;
|
|
13
|
+
mobileScheduleAction(opts?: StringRecord): Promise<unknown>;
|
|
14
|
+
mobileGetActionHistory(opts?: types.ActionArgs): Promise<types.ActionResult>;
|
|
15
|
+
mobileUnscheduleAction(opts?: types.ActionArgs): Promise<unknown>;
|
|
16
|
+
};
|
|
17
|
+
export type UIA2AlertMixin = UIA2Mixin<Pick<AlertMixin, 'getAlertText' | 'postAcceptAlert' | 'postDismissAlert'>> & {
|
|
18
|
+
mobileAcceptAlert(opts?: types.AcceptAlertOptions): Promise<void>;
|
|
19
|
+
mobileDismissAlert(opts?: types.DismissAlertOptions): Promise<void>;
|
|
20
|
+
};
|
|
21
|
+
export type UIA2AppStringsMixin = UIA2Mixin<Pick<GeneralMixin, 'getStrings'>> & {
|
|
22
|
+
mobileGetAppStrings(opts?: types.GetAppStringsOptions): Promise<StringRecord>;
|
|
23
|
+
};
|
|
24
|
+
export type UIA2BatteryMixin = UIA2Mixin & {
|
|
25
|
+
mobileGetBatteryInfo(): Promise<types.BatteryInfo>;
|
|
26
|
+
};
|
|
27
|
+
export type UIA2ElementMixin = UIA2Mixin<Pick<ElementMixin, 'getAttribute' | 'elementDisplayed' | 'elementEnabled' | 'elementSelected' | 'getName' | 'getLocation' | 'getSize' | 'touchLongClick' | 'touchDown' | 'touchUp' | 'touchMove' | 'doSetElementValue' | 'setValueImmediate' | 'getText' | 'click' | 'tap' | 'clear' | 'getElementRect'>> & {
|
|
28
|
+
active(): Promise<Element>;
|
|
29
|
+
mobileReplaceElementValue(opts: types.ReplaceValueOptions): Promise<void>;
|
|
30
|
+
getElementScreenshot(elementId: string): Promise<string>;
|
|
31
|
+
};
|
|
32
|
+
export type UIA2FindMixin = UIA2Mixin<Pick<FindMixin, 'doFindElementOrEls'>>;
|
|
33
|
+
export type UIA2GeneralMixin = UIA2Mixin<Pick<GeneralMixin & NetworkMixin & ActionsMixin & ExecuteMixin, 'getPageSource' | 'doSendKeys' | 'back' | 'getDisplayDensity' | 'getWindowSize' | 'getWindowRect' | 'setUrl' | 'wrapBootstrapDisconnect' | 'keyevent' | 'execute' | 'executeMobile'>> & {
|
|
34
|
+
getClipboard(): Promise<string>;
|
|
35
|
+
mobileViewportScreenshot(): Promise<string>;
|
|
36
|
+
mobileViewPortRect(): Promise<types.RelativeRect>;
|
|
37
|
+
mobileDeepLink(opts: types.DeepLinkOpts): Promise<void>;
|
|
38
|
+
openNotifications(): Promise<void>;
|
|
39
|
+
suspendChromedriverProxy(): void;
|
|
40
|
+
mobileGetDeviceInfo(): Promise<StringRecord>;
|
|
41
|
+
mobileType(opts: types.TypingOptions): Promise<boolean>;
|
|
42
|
+
mobileInstallMultipleApks(opts: types.InstallMultipleApksOptions): Promise<void>;
|
|
43
|
+
mobileBackgroundApp(opts?: types.BackgroundAppOptions): Promise<void>;
|
|
44
|
+
};
|
|
45
|
+
export type UIA2ViewportMixin = UIA2Mixin & {
|
|
46
|
+
getStatusBarHeight(): Promise<number>;
|
|
47
|
+
getDevicePixelRatio(): Promise<string>;
|
|
48
|
+
getViewportScreenshot(): Promise<string>;
|
|
49
|
+
getViewPortRect(): Promise<types.RelativeRect>;
|
|
50
|
+
};
|
|
51
|
+
export type UIA2GesturesMixin = UIA2Mixin & {
|
|
52
|
+
mobileClickGesture(opts?: types.ClickOptions): Promise<void>;
|
|
53
|
+
mobileDoubleClickGesture(opts?: types.ClickOptions): Promise<void>;
|
|
54
|
+
mobileDragGesture(opts: types.DragOptions): Promise<void>;
|
|
55
|
+
mobileFlingGesture(opts: types.FlingOptions): Promise<boolean>;
|
|
56
|
+
mobilePinchCloseGesture(opts: types.PinchOptions): Promise<void>;
|
|
57
|
+
mobilePinchOpenGesture(opts: types.PinchOptions): Promise<void>;
|
|
58
|
+
mobileSwipeGesture(opts: types.SwipeOptions): Promise<void>;
|
|
59
|
+
mobileScrollGesture(opts: types.ScrollGestureOptions): Promise<boolean>;
|
|
60
|
+
mobileScrollBackTo(opts: types.ScrollElementToElementOpts): Promise<void>;
|
|
61
|
+
mobileScroll(opts: types.ScrollOptions): Promise<void>;
|
|
62
|
+
mobileLongClickGesture(opts: types.LongClickOptions): Promise<void>;
|
|
63
|
+
};
|
|
64
|
+
export type UIA2ScreenshotMixin = UIA2Mixin<Pick<ActionsMixin, 'getScreenshot'>> & {
|
|
65
|
+
mobileScreenshots(opts: types.ScreenshotsOpts): Promise<StringRecord<types.Screenshot>>;
|
|
66
|
+
};
|
|
67
|
+
export type UIA2TouchMixin = UIA2Mixin<Required<Pick<ExternalDriver & TouchMixin, 'performActions' | 'releaseActions' | 'doPerformMultiAction'>>>;
|
|
68
|
+
declare module '../driver' {
|
|
69
|
+
interface AndroidUiautomator2Driver extends UIA2ActionsMixin, UIA2AlertMixin, UIA2AppStringsMixin, UIA2BatteryMixin, UIA2ElementMixin, UIA2FindMixin, UIA2GeneralMixin, UIA2GesturesMixin, UIA2ScreenshotMixin, UIA2TouchMixin, UIA2ViewportMixin {
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* This function assigns a mixin `T` to the `AndroidUiautomator2Driver` class' prototype.
|
|
74
|
+
*
|
|
75
|
+
* While each mixin has its own interface which is (in isolation) unrelated to
|
|
76
|
+
* `AndroidUiautomator2Driver`, the constraint on this generic type `T` is that it must be a
|
|
77
|
+
* partial of `AndroidUiautomator2Driver`'s interface. This enforces that it does not
|
|
78
|
+
* conflict with the existing interface of `AndroidUiautomator2Driver`. In that way, you
|
|
79
|
+
* can think of it as a type guard.
|
|
80
|
+
* @param mixin Mixin implementation
|
|
81
|
+
*/
|
|
82
|
+
export declare function mixin<T extends Partial<AndroidUiautomator2Driver>>(mixin: T): void;
|
|
83
|
+
export {};
|
|
84
|
+
//# sourceMappingURL=mixins.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mixins.d.ts","sourceRoot":"","sources":["../../../lib/commands/mixins.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAC,OAAO,EAAE,cAAc,EAAE,YAAY,EAAC,MAAM,eAAe,CAAC;AACzE,OAAO,KAAK,EACV,YAAY,EACZ,UAAU,EACV,YAAY,EACZ,YAAY,EACZ,SAAS,EACT,YAAY,EACZ,YAAY,EACZ,UAAU,EACX,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,WAAW,CAAC;AAC3C,OAAO,EAAC,yBAAyB,EAAC,MAAM,WAAW,CAAC;AACpD,OAAO,KAAK,KAAK,KAAK,MAAM,SAAS,CAAC;AAEtC,KAAK,SAAS,CAAC,CAAC,GAAG,WAAW,IAAI,QAAQ,CAAC,OAAO,WAAW,EAAE,yBAAyB,CAAC,GAAG,CAAC,CAAC;AAE9F,MAAM,MAAM,gBAAgB,GAAG,SAAS,CACtC,IAAI,CACF,YAAY,EACZ,cAAc,GAAG,kBAAkB,GAAG,SAAS,GAAG,QAAQ,GAAG,gBAA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1E,YAAY,CAAC,IAAI,EAAE,KAAK,CAAC,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACvD,sBAAsB,CAAC,IAAI,EAAE,KAAK,CAAC,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACrE,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG,SAAS,CAAC,IAAI,CAAC,YAAY,EAAE,eAAe,CAAC,CAAC,GAAG;IACjF,iBAAiB,CAAC,IAAI,EAAE,KAAK,CAAC,eAAe,GAAG,OAAO,CAAC,YAAY,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC;CACzF,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG,SAAS,CAEpC,QAAQ,CACN,IAAI,CAAC,cAAc,GAAG,UAAU,EAAE,gBAAgB,GAAG,gBAAgB,GAAG,sBAAsB,CAAC,CAChG,CACF,CAAC;AAEF,OAAO,QAAQ,WAAW,CAAC;IACzB,UAAU,yBACR,SAAQ,gBAAgB,EACtB,cAAc,EACd,mBAAmB,EACnB,gBAAgB,EAChB,gBAAgB,EAChB,aAAa,EACb,gBAAgB,EAChB,iBAAiB,EACjB,mBAAmB,EACnB,cAAc,EACd,iBAAiB;KAAG;CACzB;AAED;;;;;;;;;GASG;AACH,wBAAgB,KAAK,CAAC,CAAC,SAAS,OAAO,CAAC,yBAAyB,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,IAAI,CAElF"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @module
|
|
4
|
+
* @privateRemarks These mixins are kind of a mishmash of stuff from `appium-android-driver`, unique things, and stuff from `ExternalDriver`. Ideally, we should be pulling the method definitions right out of `ExternalDriver` whenever possible. Also note that the mixins contain _more stuff than just commands or execute methods_.
|
|
5
|
+
*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.mixin = void 0;
|
|
8
|
+
const driver_1 = require("../driver");
|
|
9
|
+
/**
|
|
10
|
+
* This function assigns a mixin `T` to the `AndroidUiautomator2Driver` class' prototype.
|
|
11
|
+
*
|
|
12
|
+
* While each mixin has its own interface which is (in isolation) unrelated to
|
|
13
|
+
* `AndroidUiautomator2Driver`, the constraint on this generic type `T` is that it must be a
|
|
14
|
+
* partial of `AndroidUiautomator2Driver`'s interface. This enforces that it does not
|
|
15
|
+
* conflict with the existing interface of `AndroidUiautomator2Driver`. In that way, you
|
|
16
|
+
* can think of it as a type guard.
|
|
17
|
+
* @param mixin Mixin implementation
|
|
18
|
+
*/
|
|
19
|
+
function mixin(mixin) {
|
|
20
|
+
Object.assign(driver_1.AndroidUiautomator2Driver.prototype, mixin);
|
|
21
|
+
}
|
|
22
|
+
exports.mixin = mixin;
|
|
23
|
+
//# sourceMappingURL=mixins.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mixins.js","sourceRoot":"","sources":["../../../lib/commands/mixins.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAcH,sCAAoD;AAyIpD;;;;;;;;;GASG;AACH,SAAgB,KAAK,CAA+C,KAAQ;IAC1E,MAAM,CAAC,MAAM,CAAC,kCAAyB,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC;AAC5D,CAAC;AAFD,sBAEC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"screenshot.d.ts","sourceRoot":"","sources":["../../../lib/commands/screenshot.js"],"names":[],"mappings":""}
|
|
@@ -1,65 +1,80 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
var
|
|
4
|
-
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.default = void 0;
|
|
8
|
-
require("source-map-support/register");
|
|
9
|
-
var _lodash = _interopRequireDefault(require("lodash"));
|
|
10
|
-
var _bluebird = _interopRequireDefault(require("bluebird"));
|
|
11
|
-
const commands = {};
|
|
12
|
-
const DISPLAY_PATTERN = /^Display\s+(\d+)\s+\(.+display\s+(\d+)\).+displayName="([^"]*)/gm;
|
|
13
|
-
commands.getScreenshot = async function () {
|
|
14
|
-
if (this.mjpegStream) {
|
|
15
|
-
const data = await this.mjpegStream.lastChunkPNGBase64();
|
|
16
|
-
if (data) {
|
|
17
|
-
return data;
|
|
18
|
-
}
|
|
19
|
-
this.log.warn('Tried to get screenshot from active MJPEG stream, but there ' + 'was no data yet. Falling back to regular screenshot methods.');
|
|
20
|
-
}
|
|
21
|
-
return await this.uiautomator2.jwproxy.command('/screenshot', 'GET');
|
|
2
|
+
// @ts-check
|
|
3
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
4
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
22
5
|
};
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
const mixins_1 = require("./mixins");
|
|
8
|
+
const lodash_1 = __importDefault(require("lodash"));
|
|
9
|
+
const bluebird_1 = __importDefault(require("bluebird"));
|
|
10
|
+
// Display 4619827259835644672 (HWC display 0): port=0 pnpId=GGL displayName="EMU_display_0"
|
|
11
|
+
const DISPLAY_PATTERN = /^Display\s+(\d+)\s+\(.+display\s+(\d+)\).+displayName="([^"]*)/gm;
|
|
12
|
+
/**
|
|
13
|
+
* @type {import('./mixins').UIA2ScreenshotMixin}
|
|
14
|
+
* @satisfies {import('@appium/types').ExternalDriver}
|
|
15
|
+
*/
|
|
16
|
+
const ScreenshotMixin = {
|
|
17
|
+
async getScreenshot() {
|
|
18
|
+
if (this.mjpegStream) {
|
|
19
|
+
const data = await this.mjpegStream.lastChunkPNGBase64();
|
|
20
|
+
if (data) {
|
|
21
|
+
return data;
|
|
22
|
+
}
|
|
23
|
+
this.log.warn('Tried to get screenshot from active MJPEG stream, but there ' +
|
|
24
|
+
'was no data yet. Falling back to regular screenshot methods.');
|
|
25
|
+
}
|
|
26
|
+
return String(await /** @type {import('../uiautomator2').UiAutomator2Server} */ (this.uiautomator2).jwproxy.command('/screenshot', 'GET'));
|
|
27
|
+
},
|
|
28
|
+
/**
|
|
29
|
+
* Retrieves screenshots of each display available to Android.
|
|
30
|
+
* This functionality is only supported since Android 10.
|
|
31
|
+
*/
|
|
32
|
+
async mobileScreenshots(opts = {}) {
|
|
33
|
+
const displaysInfo = await /** @type {import('appium-adb').ADB} */ (this.adb).shell([
|
|
34
|
+
'dumpsys',
|
|
35
|
+
'SurfaceFlinger',
|
|
36
|
+
'--display-id',
|
|
37
|
+
]);
|
|
38
|
+
/** @type {import('@appium/types').StringRecord<import('./types').Screenshot>} */
|
|
39
|
+
const infos = {};
|
|
40
|
+
let match;
|
|
41
|
+
while ((match = DISPLAY_PATTERN.exec(displaysInfo))) {
|
|
42
|
+
infos[match[1]] = /** @type {any} */ ({
|
|
43
|
+
id: match[1],
|
|
44
|
+
isDefault: match[2] === '0',
|
|
45
|
+
name: match[3],
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
if (lodash_1.default.isEmpty(infos)) {
|
|
49
|
+
this.log.debug(displaysInfo);
|
|
50
|
+
throw new Error('Cannot determine the information about connected Android displays');
|
|
51
|
+
}
|
|
52
|
+
this.log.info(`Parsed Android display infos: ${JSON.stringify(infos)}`);
|
|
53
|
+
/**
|
|
54
|
+
* @param {string} dispId
|
|
55
|
+
*/
|
|
56
|
+
const toB64Screenshot = async (dispId) => (await /** @type {import('appium-adb').ADB} */ (this.adb).takeScreenshot(dispId)).toString('base64');
|
|
57
|
+
const { displayId } = opts;
|
|
58
|
+
const displayIdStr = lodash_1.default.isNaN(displayId) ? null : `${displayId}`;
|
|
59
|
+
if (displayIdStr) {
|
|
60
|
+
if (!infos[displayIdStr]) {
|
|
61
|
+
throw new Error(`The provided display identifier '${displayId}' is not known. ` +
|
|
62
|
+
`Only the following displays have been detected: ${JSON.stringify(infos)}`);
|
|
63
|
+
}
|
|
64
|
+
return {
|
|
65
|
+
[displayIdStr]: {
|
|
66
|
+
...infos[displayIdStr],
|
|
67
|
+
payload: await toB64Screenshot(displayIdStr),
|
|
68
|
+
},
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
const allInfos = lodash_1.default.values(infos);
|
|
72
|
+
const screenshots = await bluebird_1.default.all(allInfos.map(({ id }) => toB64Screenshot(id)));
|
|
73
|
+
for (const [info, payload] of /** @type {[import('./types').Screenshot, string][]} */ (lodash_1.default.zip(allInfos, screenshots))) {
|
|
74
|
+
info.payload = payload;
|
|
75
|
+
}
|
|
76
|
+
return infos;
|
|
77
|
+
},
|
|
63
78
|
};
|
|
64
|
-
|
|
65
|
-
//# sourceMappingURL=
|
|
79
|
+
(0, mixins_1.mixin)(ScreenshotMixin);
|
|
80
|
+
//# sourceMappingURL=screenshot.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"screenshot.js","
|
|
1
|
+
{"version":3,"file":"screenshot.js","sourceRoot":"","sources":["../../../lib/commands/screenshot.js"],"names":[],"mappings":";AAAA,YAAY;;;;;AAEZ,qCAA+B;AAC/B,oDAAuB;AACvB,wDAAyB;AAEzB,4FAA4F;AAC5F,MAAM,eAAe,GAAG,kEAAkE,CAAC;AAE3F;;;GAGG;AACH,MAAM,eAAe,GAAG;IACtB,KAAK,CAAC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CACF,CAAC;AAEF,IAAA,cAAK,EAAC,eAAe,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"touch.d.ts","sourceRoot":"","sources":["../../../lib/commands/touch.js"],"names":[],"mappings":"iCAqEa,OAAO,iBAAiB,EAAE,kBAAkB"}
|
|
@@ -1,40 +1,50 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
2
|
+
// @ts-check
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
const mixins_1 = require("./mixins");
|
|
5
|
+
/**
|
|
6
|
+
* @type {import('./mixins').UIA2TouchMixin}
|
|
7
|
+
* @satisfies {import('@appium/types').ExternalDriver}
|
|
8
|
+
*/
|
|
9
|
+
const TouchMixin = {
|
|
10
|
+
async doPerformMultiAction(elementId, states) {
|
|
11
|
+
let opts;
|
|
12
|
+
if (elementId) {
|
|
13
|
+
opts = {
|
|
14
|
+
elementId,
|
|
15
|
+
actions: states,
|
|
16
|
+
};
|
|
17
|
+
await /** @type {UiAutomator2Server} */ (this.uiautomator2).jwproxy.command('/touch/multi/perform', 'POST', opts);
|
|
18
|
+
}
|
|
19
|
+
else {
|
|
20
|
+
opts = {
|
|
21
|
+
actions: states,
|
|
22
|
+
};
|
|
23
|
+
await /** @type {UiAutomator2Server} */ (this.uiautomator2).jwproxy.command('/touch/multi/perform', 'POST', opts);
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
async performActions(actions) {
|
|
27
|
+
this.log.debug(`Received the following W3C actions: ${JSON.stringify(actions, null, ' ')}`);
|
|
28
|
+
// This is mandatory, since Selenium API uses MOUSE as the default pointer type
|
|
29
|
+
const preprocessedActions = actions.map((action) => Object.assign({}, action, action.type === 'pointer'
|
|
30
|
+
? {
|
|
31
|
+
parameters: {
|
|
32
|
+
pointerType: 'touch',
|
|
33
|
+
},
|
|
34
|
+
}
|
|
35
|
+
: {}));
|
|
36
|
+
this.log.debug(`Preprocessed actions: ${JSON.stringify(preprocessedActions, null, ' ')}`);
|
|
37
|
+
await /** @type {UiAutomator2Server} */ (this.uiautomator2).jwproxy.command('/actions', 'POST', {
|
|
38
|
+
actions: preprocessedActions,
|
|
39
|
+
});
|
|
40
|
+
},
|
|
41
|
+
// eslint-disable-next-line require-await
|
|
42
|
+
async releaseActions() {
|
|
43
|
+
this.log.info('On this platform, releaseActions is a no-op');
|
|
44
|
+
},
|
|
23
45
|
};
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
}
|
|
30
|
-
} : {}));
|
|
31
|
-
this.log.debug(`Preprocessed actions: ${JSON.stringify(preprocessedActions, null, ' ')}`);
|
|
32
|
-
return await this.uiautomator2.jwproxy.command('/actions', 'POST', {
|
|
33
|
-
actions: preprocessedActions
|
|
34
|
-
});
|
|
35
|
-
};
|
|
36
|
-
commands.releaseActions = async function releaseActions() {
|
|
37
|
-
this.log.info('On this platform, releaseActions is a no-op');
|
|
38
|
-
};
|
|
39
|
-
var _default = exports.default = commands;
|
|
40
|
-
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6WyJjb21tYW5kcyIsImRvUGVyZm9ybU11bHRpQWN0aW9uIiwiZWxlbWVudElkIiwic3RhdGVzIiwib3B0cyIsImFjdGlvbnMiLCJ1aWF1dG9tYXRvcjIiLCJqd3Byb3h5IiwiY29tbWFuZCIsInBlcmZvcm1BY3Rpb25zIiwibG9nIiwiZGVidWciLCJKU09OIiwic3RyaW5naWZ5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FtQixFQUFFLElBQUksRUFBRSxJQUFJLENBQUUsRUFBQyxDQUFDO0VBQzFGLE9BQU8sTUFBTSxJQUFJLENBQUNSLFlBQVksQ0FBQ0MsT0FBTyxDQUFDQyxPQUFPLENBQUMsVUFBVSxFQUFFLE1BQU0sRUFBRTtJQUFDSCxPQUFPLEVBQUVTO0VBQW1CLENBQUMsQ0FBQztBQUNwRyxDQUFDO0FBR0RkLFFBQVEsQ0FBQ3NCLGNBQWMsR0FBRyxlQUFlQSxjQUFjQSxDQUFBLEVBQUk7RUFDekQsSUFBSSxDQUFDWixHQUFHLENBQUNhLElBQUksQ0FBQyw2Q0FBNkMsQ0FBQztBQUM5RCxDQUFDO0FBQUMsSUFBQUMsUUFBQSxHQUFBQyxPQUFBLENBQUFDLE9BQUEsR0FFYTFCLFFBQVEifQ==
|
|
46
|
+
(0, mixins_1.mixin)(TouchMixin);
|
|
47
|
+
/**
|
|
48
|
+
* @typedef {import('../uiautomator2').UiAutomator2Server} UiAutomator2Server
|
|
49
|
+
*/
|
|
50
|
+
//# sourceMappingURL=touch.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"touch.js","
|
|
1
|
+
{"version":3,"file":"touch.js","sourceRoot":"","sources":["../../../lib/commands/touch.js"],"names":[],"mappings":";AAAA,YAAY;;AAEZ,qCAA+B;AAE/B;;;GAGG;AACH,MAAM,UAAU,GAAG;IACjB,KAAK,CAAC,oBAAoB,CAAC,SAAS,EAAE,MAAM;QAC1C,IAAI,IAAI,CAAC;QACT,IAAI,SAAS,EAAE;YACb,IAAI,GAAG;gBACL,SAAS;gBACT,OAAO,EAAE,MAAM;aAChB,CAAC;YAEF,MAAM,iCAAiC,CAAC,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,OAAO,CAAC,OAAO,CACzE,sBAAsB,EACtB,MAAM,EACN,IAAI,CACL,CAAC;SACH;aAAM;YACL,IAAI,GAAG;gBACL,OAAO,EAAE,MAAM;aAChB,CAAC;YACF,MA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