appium-uiautomator2-driver 7.4.0 → 7.5.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 +12 -0
- package/build/lib/commands/aut.d.ts +10 -0
- package/build/lib/commands/aut.d.ts.map +1 -0
- package/build/lib/commands/aut.js +122 -0
- package/build/lib/commands/aut.js.map +1 -0
- package/build/lib/driver.d.ts +20 -16
- package/build/lib/driver.d.ts.map +1 -1
- package/build/lib/driver.js +17 -382
- package/build/lib/driver.js.map +1 -1
- package/build/lib/{uiautomator2.d.ts → uiautomator2-server/core.d.ts} +1 -3
- package/build/lib/uiautomator2-server/core.d.ts.map +1 -0
- package/build/lib/{uiautomator2.js → uiautomator2-server/core.js} +13 -14
- package/build/lib/uiautomator2-server/core.js.map +1 -0
- package/build/lib/uiautomator2-server/index.d.ts +4 -0
- package/build/lib/uiautomator2-server/index.d.ts.map +1 -0
- package/build/lib/uiautomator2-server/index.js +18 -0
- package/build/lib/uiautomator2-server/index.js.map +1 -0
- package/build/lib/uiautomator2-server/packages.d.ts +3 -0
- package/build/lib/uiautomator2-server/packages.d.ts.map +1 -0
- package/build/lib/uiautomator2-server/packages.js +6 -0
- package/build/lib/uiautomator2-server/packages.js.map +1 -0
- package/build/lib/uiautomator2-server/session.d.ts +25 -0
- package/build/lib/uiautomator2-server/session.d.ts.map +1 -0
- package/build/lib/uiautomator2-server/session.js +303 -0
- package/build/lib/uiautomator2-server/session.js.map +1 -0
- package/lib/commands/aut.ts +132 -0
- package/lib/driver.ts +35 -466
- package/lib/{uiautomator2.ts → uiautomator2-server/core.ts} +1 -2
- package/lib/uiautomator2-server/index.ts +14 -0
- package/lib/uiautomator2-server/packages.ts +2 -0
- package/lib/uiautomator2-server/session.ts +354 -0
- package/npm-shrinkwrap.json +24 -24
- package/package.json +4 -4
- package/build/lib/uiautomator2.d.ts.map +0 -1
- package/build/lib/uiautomator2.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
## [7.5.1](https://github.com/appium/appium-uiautomator2-driver/compare/v7.5.0...v7.5.1) (2026-05-21)
|
|
2
|
+
|
|
3
|
+
### Miscellaneous Chores
|
|
4
|
+
|
|
5
|
+
* Bump appium-adb to version 15 ([#1003](https://github.com/appium/appium-uiautomator2-driver/issues/1003)) ([64c39df](https://github.com/appium/appium-uiautomator2-driver/commit/64c39df963f7e0339b8445c5af3cc28a4643d647))
|
|
6
|
+
|
|
7
|
+
## [7.5.0](https://github.com/appium/appium-uiautomator2-driver/compare/v7.4.0...v7.5.0) (2026-05-19)
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* Refactor driver helpers to mixins ([#1002](https://github.com/appium/appium-uiautomator2-driver/issues/1002)) ([32de026](https://github.com/appium/appium-uiautomator2-driver/commit/32de0263706566a47d10870a97080186a87ffdcd))
|
|
12
|
+
|
|
1
13
|
## [7.4.0](https://github.com/appium/appium-uiautomator2-driver/compare/v7.3.0...v7.4.0) (2026-05-14)
|
|
2
14
|
|
|
3
15
|
### Features
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { AndroidUiautomator2Driver } from '../driver';
|
|
2
|
+
/** Configures the app capability and validates the APK path before session start. */
|
|
3
|
+
export declare function prepareSessionApp(this: AndroidUiautomator2Driver): Promise<void>;
|
|
4
|
+
/** Verifies that the app APK path from capabilities exists on the host. */
|
|
5
|
+
export declare function checkAppPresent(this: AndroidUiautomator2Driver): Promise<void>;
|
|
6
|
+
/** Installs and prepares the application under test on the device. */
|
|
7
|
+
export declare function initAUT(this: AndroidUiautomator2Driver): Promise<void>;
|
|
8
|
+
/** Launches the application under test according to session capabilities. */
|
|
9
|
+
export declare function ensureAppStarts(this: AndroidUiautomator2Driver): Promise<void>;
|
|
10
|
+
//# sourceMappingURL=aut.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"aut.d.ts","sourceRoot":"","sources":["../../../lib/commands/aut.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAC,yBAAyB,EAAC,MAAM,WAAW,CAAC;AAKzD,qFAAqF;AACrF,wBAAsB,iBAAiB,CAAC,IAAI,EAAE,yBAAyB,GAAG,OAAO,CAAC,IAAI,CAAC,CAetF;AAED,2EAA2E;AAC3E,wBAAsB,eAAe,CAAC,IAAI,EAAE,yBAAyB,GAAG,OAAO,CAAC,IAAI,CAAC,CAKpF;AAED,sEAAsE;AACtE,wBAAsB,OAAO,CAAC,IAAI,EAAE,yBAAyB,GAAG,OAAO,CAAC,IAAI,CAAC,CAwD5E;AAED,6EAA6E;AAC7E,wBAAsB,eAAe,CAAC,IAAI,EAAE,yBAAyB,GAAG,OAAO,CAAC,IAAI,CAAC,CAqCpF"}
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.prepareSessionApp = prepareSessionApp;
|
|
4
|
+
exports.checkAppPresent = checkAppPresent;
|
|
5
|
+
exports.initAUT = initAUT;
|
|
6
|
+
exports.ensureAppStarts = ensureAppStarts;
|
|
7
|
+
const appium_android_driver_1 = require("appium-android-driver");
|
|
8
|
+
const support_1 = require("appium/support");
|
|
9
|
+
const io_appium_settings_1 = require("io.appium.settings");
|
|
10
|
+
const extensions_1 = require("../extensions");
|
|
11
|
+
const uiautomator2_server_1 = require("../uiautomator2-server");
|
|
12
|
+
const utils_1 = require("../utils");
|
|
13
|
+
/** Configures the app capability and validates the APK path before session start. */
|
|
14
|
+
async function prepareSessionApp() {
|
|
15
|
+
if (this.opts.app) {
|
|
16
|
+
// find and copy, or download and unzip an app url or path
|
|
17
|
+
this.opts.app = await this.helpers.configureApp(this.opts.app, [extensions_1.APK_EXTENSION, extensions_1.APKS_EXTENSION]);
|
|
18
|
+
await this.checkAppPresent();
|
|
19
|
+
}
|
|
20
|
+
else if (this.opts.appPackage) {
|
|
21
|
+
// the app isn't an actual app file but rather something we want to
|
|
22
|
+
// assume is on the device and just launch via the appPackage
|
|
23
|
+
this.log.info(`Starting '${this.opts.appPackage}' directly on the device`);
|
|
24
|
+
}
|
|
25
|
+
else {
|
|
26
|
+
this.log.info(`Neither 'app' nor 'appPackage' was set. Starting UiAutomator2 ` +
|
|
27
|
+
'without the target application');
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
/** Verifies that the app APK path from capabilities exists on the host. */
|
|
31
|
+
async function checkAppPresent() {
|
|
32
|
+
this.log.debug('Checking whether app is actually present');
|
|
33
|
+
if (!this.opts.app || !(await support_1.fs.exists(this.opts.app))) {
|
|
34
|
+
throw this.log.errorWithException(`Could not find app apk at '${this.opts.app}'`);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
/** Installs and prepares the application under test on the device. */
|
|
38
|
+
async function initAUT() {
|
|
39
|
+
// Uninstall any uninstallOtherPackages which were specified in caps
|
|
40
|
+
if (this.opts.uninstallOtherPackages) {
|
|
41
|
+
await this.uninstallOtherPackages(appium_android_driver_1.utils.parseArray(this.opts.uninstallOtherPackages), [
|
|
42
|
+
io_appium_settings_1.SETTINGS_HELPER_ID,
|
|
43
|
+
uiautomator2_server_1.SERVER_PACKAGE_ID,
|
|
44
|
+
uiautomator2_server_1.SERVER_TEST_PACKAGE_ID,
|
|
45
|
+
]);
|
|
46
|
+
}
|
|
47
|
+
// Install any "otherApps" that were specified in caps
|
|
48
|
+
if (this.opts.otherApps) {
|
|
49
|
+
let otherApps;
|
|
50
|
+
try {
|
|
51
|
+
otherApps = appium_android_driver_1.utils.parseArray(this.opts.otherApps);
|
|
52
|
+
}
|
|
53
|
+
catch (e) {
|
|
54
|
+
throw this.log.errorWithException(`Could not parse "otherApps" capability: ${e.message}`);
|
|
55
|
+
}
|
|
56
|
+
otherApps = await Promise.all(otherApps.map((app) => this.helpers.configureApp(app, [extensions_1.APK_EXTENSION, extensions_1.APKS_EXTENSION])));
|
|
57
|
+
await this.installOtherApks(otherApps);
|
|
58
|
+
}
|
|
59
|
+
if (this.opts.app && this.opts.appPackage) {
|
|
60
|
+
const adb = this.requireAdb();
|
|
61
|
+
const appPackage = this.opts.appPackage;
|
|
62
|
+
if ((this.opts.noReset && !(await adb.isAppInstalled(appPackage))) || !this.opts.noReset) {
|
|
63
|
+
if (!this.opts.noSign &&
|
|
64
|
+
!(await adb.checkApkCert(this.opts.app, {
|
|
65
|
+
requireDefaultCert: false,
|
|
66
|
+
}))) {
|
|
67
|
+
await (0, utils_1.signApp)(adb, this.opts.app);
|
|
68
|
+
}
|
|
69
|
+
if (!this.opts.skipUninstall) {
|
|
70
|
+
await adb.uninstallApk(appPackage);
|
|
71
|
+
}
|
|
72
|
+
await this.installAUT();
|
|
73
|
+
}
|
|
74
|
+
else {
|
|
75
|
+
this.log.debug('noReset has been requested and the app is already installed. Doing nothing');
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
else {
|
|
79
|
+
if (this.opts.fullReset) {
|
|
80
|
+
throw this.log.errorWithException('Full reset requires an app capability, use fastReset if app is not provided');
|
|
81
|
+
}
|
|
82
|
+
this.log.debug('No app capability. Assuming it is already on the device');
|
|
83
|
+
if (this.opts.fastReset && this.opts.appPackage) {
|
|
84
|
+
await this.resetAUT();
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
/** Launches the application under test according to session capabilities. */
|
|
89
|
+
async function ensureAppStarts() {
|
|
90
|
+
const adb = this.requireAdb();
|
|
91
|
+
const appPackage = this.opts.appPackage;
|
|
92
|
+
const appActivity = this.opts.appActivity;
|
|
93
|
+
if (!appPackage) {
|
|
94
|
+
throw this.log.errorWithException('appPackage capability is required to start the application');
|
|
95
|
+
}
|
|
96
|
+
// make sure we have an activity and package to wait for
|
|
97
|
+
const appWaitPackage = this.opts.appWaitPackage || appPackage;
|
|
98
|
+
const appWaitActivity = this.opts.appWaitActivity || appActivity;
|
|
99
|
+
this.log.info(`Starting '${appPackage}${appActivity ? '/' + appActivity : ''}` +
|
|
100
|
+
`and waiting for '${appWaitPackage}${appWaitActivity ? '/' + appWaitActivity : ''}'`);
|
|
101
|
+
if (this.opts.noReset && !this.opts.forceAppLaunch && (await adb.processExists(appPackage))) {
|
|
102
|
+
this.log.info(`'${appPackage}' is already running and noReset is enabled. ` +
|
|
103
|
+
`Set forceAppLaunch capability to true if the app must be forcefully restarted on session startup.`);
|
|
104
|
+
return;
|
|
105
|
+
}
|
|
106
|
+
await adb.startApp({
|
|
107
|
+
pkg: appPackage,
|
|
108
|
+
activity: appActivity,
|
|
109
|
+
action: this.opts.intentAction || 'android.intent.action.MAIN',
|
|
110
|
+
category: this.opts.intentCategory || 'android.intent.category.LAUNCHER',
|
|
111
|
+
flags: this.opts.intentFlags || '0x10200000', // FLAG_ACTIVITY_NEW_TASK | FLAG_ACTIVITY_RESET_TASK_IF_NEEDED
|
|
112
|
+
waitPkg: this.opts.appWaitPackage,
|
|
113
|
+
waitActivity: this.opts.appWaitActivity,
|
|
114
|
+
waitForLaunch: this.opts.appWaitForLaunch,
|
|
115
|
+
waitDuration: this.opts.appWaitDuration,
|
|
116
|
+
optionalIntentArguments: this.opts.optionalIntentArguments,
|
|
117
|
+
stopApp: this.opts.forceAppLaunch || !this.opts.dontStopAppOnReset,
|
|
118
|
+
retry: true,
|
|
119
|
+
user: this.opts.userProfile,
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
//# sourceMappingURL=aut.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"aut.js","sourceRoot":"","sources":["../../../lib/commands/aut.ts"],"names":[],"mappings":";;AASA,8CAeC;AAGD,0CAKC;AAGD,0BAwDC;AAGD,0CAqCC;AAnID,iEAA4C;AAC5C,4CAAkC;AAClC,2DAAsD;AAEtD,8CAA4D;AAC5D,gEAAiF;AACjF,oCAAiC;AAEjC,qFAAqF;AAC9E,KAAK,UAAU,iBAAiB;IACrC,IAAI,IAAI,CAAC,IAAI,CAAC,GA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ts
CHANGED
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
import type { DriverData, ExternalDriver, InitialOpts, RouteMatcher, SingularSessionData, StringRecord, SessionCapabilities } from '@appium/types';
|
|
2
|
+
import { type ADB } from 'appium-adb';
|
|
2
3
|
import { AndroidDriver } from 'appium-android-driver';
|
|
3
4
|
import { mjpeg } from 'appium/support';
|
|
4
5
|
import { type Uiautomator2Constraints } from './constraints';
|
|
5
|
-
import type { Uiautomator2Settings, Uiautomator2DeviceDetails, Uiautomator2DriverCaps, Uiautomator2DriverOpts,
|
|
6
|
-
import { UiAutomator2Server } from './uiautomator2';
|
|
6
|
+
import type { Uiautomator2Settings, Uiautomator2DeviceDetails, Uiautomator2DriverCaps, Uiautomator2DriverOpts, W3CUiautomator2DriverCaps } from './types';
|
|
7
|
+
import type { UiAutomator2Server } from './uiautomator2-server';
|
|
8
|
+
import { allocateMjpegServerPort, allocateSystemPort, initServer, performExecution, performPostExecSetup, performPreExecSetup, releaseMjpegServerPort, releaseSystemPort, requireServer, startSession } from './uiautomator2-server';
|
|
7
9
|
import { mobileGetActionHistory, mobileScheduleAction, mobileUnscheduleAction, releaseActions } from './commands/actions';
|
|
8
10
|
import { getAlertText, mobileAcceptAlert, mobileDismissAlert, postAcceptAlert, postDismissAlert } from './commands/alert';
|
|
9
11
|
import { mobileInstallMultipleApks } from './commands/app-management';
|
|
12
|
+
import { checkAppPresent, ensureAppStarts, initAUT, prepareSessionApp } from './commands/aut';
|
|
10
13
|
import { mobileGetBatteryInfo } from './commands/battery';
|
|
11
14
|
import { getClipboard, setClipboard } from './commands/clipboard';
|
|
12
15
|
import { active, getElementRect, getElementScreenshot, clear, mobileReplaceElementValue } from './commands/element';
|
|
@@ -1047,25 +1050,27 @@ declare class AndroidUiautomator2Driver extends AndroidDriver implements Externa
|
|
|
1047
1050
|
getWindowRect: AndroidDriver["getWindowRect"];
|
|
1048
1051
|
getWindowSize: AndroidDriver["getWindowSize"];
|
|
1049
1052
|
mobileViewPortRect: typeof mobileViewPortRect;
|
|
1053
|
+
prepareSessionApp: typeof prepareSessionApp;
|
|
1054
|
+
checkAppPresent: typeof checkAppPresent;
|
|
1055
|
+
initAUT: typeof initAUT;
|
|
1056
|
+
ensureAppStarts: typeof ensureAppStarts;
|
|
1057
|
+
allocateSystemPort: typeof allocateSystemPort;
|
|
1058
|
+
releaseSystemPort: typeof releaseSystemPort;
|
|
1059
|
+
allocateMjpegServerPort: typeof allocateMjpegServerPort;
|
|
1060
|
+
releaseMjpegServerPort: typeof releaseMjpegServerPort;
|
|
1061
|
+
performSessionPreExecSetup: typeof performPreExecSetup;
|
|
1062
|
+
performSessionExecution: typeof performExecution;
|
|
1063
|
+
performSessionPostExecSetup: typeof performPostExecSetup;
|
|
1064
|
+
startUiAutomator2Session: typeof startSession;
|
|
1065
|
+
initUiAutomator2Server: typeof initServer;
|
|
1066
|
+
requireUiautomator2: typeof requireServer;
|
|
1050
1067
|
constructor(opts?: InitialOpts, shouldValidateCaps?: boolean);
|
|
1051
1068
|
get driverData(): {};
|
|
1052
1069
|
validateDesiredCaps(caps: any): caps is Uiautomator2DriverCaps;
|
|
1053
1070
|
createSession(w3cCaps1: W3CUiautomator2DriverCaps, w3cCaps2?: W3CUiautomator2DriverCaps, w3cCaps3?: W3CUiautomator2DriverCaps, driverData?: DriverData[]): Promise<any>;
|
|
1054
1071
|
getDeviceDetails(): Promise<Uiautomator2DeviceDetails>;
|
|
1055
1072
|
getSession(): Promise<SingularSessionData<Uiautomator2Constraints>>;
|
|
1056
|
-
allocateSystemPort(): Promise<void>;
|
|
1057
|
-
releaseSystemPort(): Promise<void>;
|
|
1058
|
-
allocateMjpegServerPort(): Promise<void>;
|
|
1059
|
-
releaseMjpegServerPort(): Promise<void>;
|
|
1060
|
-
performSessionPreExecSetup(): Promise<StringRecord | undefined>;
|
|
1061
|
-
performSessionExecution(capsWithSessionInfo: StringRecord): Promise<void>;
|
|
1062
|
-
performSessionPostExecSetup(): Promise<void>;
|
|
1063
|
-
startUiAutomator2Session(caps: Uiautomator2StartSessionOpts): Promise<Uiautomator2SessionCaps>;
|
|
1064
|
-
initUiAutomator2Server(): Promise<UiAutomator2Server>;
|
|
1065
|
-
initAUT(): Promise<void>;
|
|
1066
|
-
ensureAppStarts(): Promise<void>;
|
|
1067
1073
|
deleteSession(): Promise<void>;
|
|
1068
|
-
checkAppPresent(): Promise<void>;
|
|
1069
1074
|
onSettingsUpdate(): Promise<void>;
|
|
1070
1075
|
proxyActive(sessionId: string): boolean;
|
|
1071
1076
|
canProxy(sessionId: string): boolean;
|
|
@@ -1073,8 +1078,7 @@ declare class AndroidUiautomator2Driver extends AndroidDriver implements Externa
|
|
|
1073
1078
|
updateSettings(settings: Uiautomator2Settings): Promise<void>;
|
|
1074
1079
|
getSettings(): Promise<StringRecord>;
|
|
1075
1080
|
getAppiumSessionCapabilities(): Promise<SessionCapabilities<Uiautomator2Constraints>>;
|
|
1076
|
-
|
|
1077
|
-
private requireUiautomator2;
|
|
1081
|
+
requireAdb(): ADB;
|
|
1078
1082
|
}
|
|
1079
1083
|
export { AndroidUiautomator2Driver };
|
|
1080
1084
|
//# sourceMappingURL=driver.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"driver.d.ts","sourceRoot":"","sources":["../../lib/driver.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,UAAU,EACV,cAAc,EACd,WAAW,
|
|
1
|
+
{"version":3,"file":"driver.d.ts","sourceRoot":"","sources":["../../lib/driver.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,UAAU,EACV,cAAc,EACd,WAAW,EACX,YAAY,EACZ,mBAAmB,EACnB,YAAY,EACZ,mBAAmB,EACpB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAmB,KAAK,GAAG,EAAC,MAAM,YAAY,CAAC;AACtD,OAAO,EAAC,aAAa,EAAQ,MAAM,uBAAuB,CAAC;AAE3D,OAAO,EAAC,KAAK,EAAO,MAAM,gBAAgB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