appium-uiautomator2-driver 3.5.6 → 3.6.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 +12 -0
- package/README.md +32 -6
- package/build/lib/commands/actions.d.ts +3 -3
- package/build/lib/commands/actions.d.ts.map +1 -1
- package/build/lib/commands/actions.js +5 -6
- package/build/lib/commands/actions.js.map +1 -1
- package/build/lib/commands/alert.d.ts +1 -1
- package/build/lib/commands/alert.d.ts.map +1 -1
- package/build/lib/commands/alert.js +5 -6
- package/build/lib/commands/alert.js.map +1 -1
- package/build/lib/commands/app-management.d.ts +3 -3
- package/build/lib/commands/app-management.d.ts.map +1 -1
- package/build/lib/commands/app-management.js +2 -3
- package/build/lib/commands/app-management.js.map +1 -1
- package/build/lib/commands/app-strings.d.ts +3 -3
- package/build/lib/commands/app-strings.d.ts.map +1 -1
- package/build/lib/commands/app-strings.js +1 -2
- package/build/lib/commands/app-strings.js.map +1 -1
- package/build/lib/commands/battery.d.ts +3 -3
- package/build/lib/commands/battery.d.ts.map +1 -1
- package/build/lib/commands/battery.js +1 -2
- package/build/lib/commands/battery.js.map +1 -1
- package/build/lib/commands/element.d.ts +7 -7
- package/build/lib/commands/element.d.ts.map +1 -1
- package/build/lib/commands/element.js +16 -17
- package/build/lib/commands/element.js.map +1 -1
- package/build/lib/commands/execute.d.ts +2 -2
- package/build/lib/commands/execute.d.ts.map +1 -1
- package/build/lib/commands/execute.js +2 -3
- package/build/lib/commands/execute.js.map +1 -1
- package/build/lib/commands/find.d.ts +3 -3
- package/build/lib/commands/find.d.ts.map +1 -1
- package/build/lib/commands/find.js +1 -2
- package/build/lib/commands/find.js.map +1 -1
- package/build/lib/commands/gestures.d.ts +9 -9
- package/build/lib/commands/gestures.d.ts.map +1 -1
- package/build/lib/commands/gestures.js +11 -12
- package/build/lib/commands/gestures.js.map +1 -1
- package/build/lib/commands/keyboard.d.ts +4 -4
- package/build/lib/commands/keyboard.d.ts.map +1 -1
- package/build/lib/commands/keyboard.js +6 -7
- package/build/lib/commands/keyboard.js.map +1 -1
- package/build/lib/commands/misc.d.ts +5 -5
- package/build/lib/commands/misc.d.ts.map +1 -1
- package/build/lib/commands/misc.js +7 -8
- package/build/lib/commands/misc.js.map +1 -1
- package/build/lib/commands/navigation.d.ts +2 -2
- package/build/lib/commands/navigation.d.ts.map +1 -1
- package/build/lib/commands/navigation.js +3 -4
- package/build/lib/commands/navigation.js.map +1 -1
- package/build/lib/commands/screenshot.d.ts +2 -2
- package/build/lib/commands/screenshot.d.ts.map +1 -1
- package/build/lib/commands/screenshot.js +4 -5
- package/build/lib/commands/screenshot.js.map +1 -1
- package/build/lib/commands/viewport.d.ts +5 -5
- package/build/lib/commands/viewport.d.ts.map +1 -1
- package/build/lib/commands/viewport.js +7 -8
- package/build/lib/commands/viewport.js.map +1 -1
- package/build/lib/constraints.d.ts +3 -0
- package/build/lib/constraints.d.ts.map +1 -1
- package/build/lib/css-converter.d.ts +4 -4
- package/build/lib/driver.d.ts.map +1 -1
- package/build/lib/helpers.d.ts +1 -1
- package/build/lib/helpers.d.ts.map +1 -1
- package/build/lib/helpers.js +2 -3
- package/build/lib/helpers.js.map +1 -1
- package/build/lib/uiautomator2.d.ts +39 -2
- package/build/lib/uiautomator2.d.ts.map +1 -1
- package/build/lib/uiautomator2.js +43 -7
- package/build/lib/uiautomator2.js.map +1 -1
- package/build/tsconfig.tsbuildinfo +1 -1
- package/lib/uiautomator2.js +47 -7
- package/npm-shrinkwrap.json +49 -31
- package/package.json +2 -2
package/lib/uiautomator2.js
CHANGED
|
@@ -97,6 +97,51 @@ class UiAutomator2Server {
|
|
|
97
97
|
return resultInfo;
|
|
98
98
|
}
|
|
99
99
|
|
|
100
|
+
/**
|
|
101
|
+
* @typedef {Object} PackageInfo
|
|
102
|
+
* @property {import('appium-adb/build/lib/tools/apk-utils').InstallState} installState
|
|
103
|
+
* @property {string} appPath
|
|
104
|
+
* @property {string} appId
|
|
105
|
+
*/
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* Checks if server components must be installed from the device under test
|
|
109
|
+
* in scope of the current driver session.
|
|
110
|
+
*
|
|
111
|
+
* For example, if one of servers on the device under test was newer than servers current UIA2 driver wants to
|
|
112
|
+
* use for the session, the UIA2 driver should uninstall the installed ones in order to avoid
|
|
113
|
+
* version mismatch between the UIA2 drier and servers on the device under test.
|
|
114
|
+
* Also, if the device under test has missing servers, current UIA2 driver should uninstall all
|
|
115
|
+
* servers once in order to install proper servers freshly.
|
|
116
|
+
*
|
|
117
|
+
* @param {PackageInfo[]} packagesInfo
|
|
118
|
+
* @returns {boolean} true if any of components is already installed and the other is not installed
|
|
119
|
+
* or the installed one has a newer version.
|
|
120
|
+
*/
|
|
121
|
+
shouldUninstallServerPackages(packagesInfo = []) {
|
|
122
|
+
const isAnyComponentInstalled = packagesInfo.some(
|
|
123
|
+
({installState}) => installState !== this.adb.APP_INSTALL_STATE.NOT_INSTALLED);
|
|
124
|
+
const isAnyComponentNotInstalledOrNewer = packagesInfo.some(({installState}) => [
|
|
125
|
+
this.adb.APP_INSTALL_STATE.NOT_INSTALLED,
|
|
126
|
+
this.adb.APP_INSTALL_STATE.NEWER_VERSION_INSTALLED,
|
|
127
|
+
].includes(installState));
|
|
128
|
+
return isAnyComponentInstalled && isAnyComponentNotInstalledOrNewer;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
/**
|
|
132
|
+
* Checks if server components should be installed on the device under test in scope of the current driver session.
|
|
133
|
+
*
|
|
134
|
+
* @param {PackageInfo[]} packagesInfo
|
|
135
|
+
* @returns {boolean} true if any of components is not installed or older than currently installed in order to
|
|
136
|
+
* install or upgrade the servers on the device under test.
|
|
137
|
+
*/
|
|
138
|
+
shouldInstallServerPackages(packagesInfo = []) {
|
|
139
|
+
return packagesInfo.some(({installState}) => [
|
|
140
|
+
this.adb.APP_INSTALL_STATE.NOT_INSTALLED,
|
|
141
|
+
this.adb.APP_INSTALL_STATE.OLDER_VERSION_INSTALLED,
|
|
142
|
+
].includes(installState));
|
|
143
|
+
}
|
|
144
|
+
|
|
100
145
|
/**
|
|
101
146
|
* Installs the apks on to the device or emulator.
|
|
102
147
|
*
|
|
@@ -116,15 +161,10 @@ class UiAutomator2Server {
|
|
|
116
161
|
);
|
|
117
162
|
|
|
118
163
|
this.log.debug(`Server packages status: ${JSON.stringify(packagesInfo)}`);
|
|
119
|
-
|
|
120
|
-
const shouldUninstallServerPackages = (packagesInfo.some(({installState}) => installState === this.adb.APP_INSTALL_STATE.NOT_INSTALLED)
|
|
121
|
-
&& !packagesInfo.every(({installState}) => installState === this.adb.APP_INSTALL_STATE.NOT_INSTALLED));
|
|
164
|
+
const shouldUninstallServerPackages = this.shouldUninstallServerPackages(packagesInfo);
|
|
122
165
|
// Install must always follow uninstall. Also, perform the install if
|
|
123
166
|
// any of server packages is not installed or is outdated
|
|
124
|
-
const shouldInstallServerPackages = shouldUninstallServerPackages ||
|
|
125
|
-
this.adb.APP_INSTALL_STATE.NOT_INSTALLED,
|
|
126
|
-
this.adb.APP_INSTALL_STATE.OLDER_VERSION_INSTALLED,
|
|
127
|
-
].includes(installState));
|
|
167
|
+
const shouldInstallServerPackages = shouldUninstallServerPackages || this.shouldInstallServerPackages(packagesInfo);
|
|
128
168
|
this.log.info(`Server packages are ${shouldInstallServerPackages ? '' : 'not '}going to be (re)installed`);
|
|
129
169
|
if (shouldInstallServerPackages && shouldUninstallServerPackages) {
|
|
130
170
|
this.log.info('Full packages reinstall is going to be performed');
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "appium-uiautomator2-driver",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.6.0",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "appium-uiautomator2-driver",
|
|
9
|
-
"version": "3.
|
|
9
|
+
"version": "3.6.0",
|
|
10
10
|
"license": "Apache-2.0",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"appium-adb": "^12.2.0",
|
|
13
|
-
"appium-android-driver": "^9.
|
|
13
|
+
"appium-android-driver": "^9.7.0",
|
|
14
14
|
"appium-chromedriver": "^5.6.28",
|
|
15
15
|
"appium-uiautomator2-server": "^7.0.14",
|
|
16
16
|
"asyncbox": "^3.0.0",
|
|
@@ -198,6 +198,18 @@
|
|
|
198
198
|
"url": "https://github.com/sponsors/sindresorhus"
|
|
199
199
|
}
|
|
200
200
|
},
|
|
201
|
+
"node_modules/@appium/docutils/node_modules/typescript": {
|
|
202
|
+
"version": "5.4.5",
|
|
203
|
+
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.4.5.tgz",
|
|
204
|
+
"integrity": "sha512-vcI4UpRgg81oIRUFwR0WSIHKt11nJ7SAVlYNIu+QpqeyXP+gpQJy/Z4+F0aGxSE4MqwjyXvW/TzgkLAx2AGHwQ==",
|
|
205
|
+
"bin": {
|
|
206
|
+
"tsc": "bin/tsc",
|
|
207
|
+
"tsserver": "bin/tsserver"
|
|
208
|
+
},
|
|
209
|
+
"engines": {
|
|
210
|
+
"node": ">=14.17"
|
|
211
|
+
}
|
|
212
|
+
},
|
|
201
213
|
"node_modules/@appium/logger": {
|
|
202
214
|
"version": "1.4.2",
|
|
203
215
|
"resolved": "https://registry.npmjs.org/@appium/logger/-/logger-1.4.2.tgz",
|
|
@@ -711,9 +723,9 @@
|
|
|
711
723
|
}
|
|
712
724
|
},
|
|
713
725
|
"node_modules/@types/express-serve-static-core": {
|
|
714
|
-
"version": "4.19.
|
|
715
|
-
"resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.19.
|
|
716
|
-
"integrity": "sha512-
|
|
726
|
+
"version": "4.19.5",
|
|
727
|
+
"resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.19.5.tgz",
|
|
728
|
+
"integrity": "sha512-y6W03tvrACO72aijJ5uF02FRq5cgDR9lUxddQ8vyF+GvmjJQqbzDcJngEjURc+ZsG31VI3hODNZJ2URj86pzmg==",
|
|
717
729
|
"dependencies": {
|
|
718
730
|
"@types/node": "*",
|
|
719
731
|
"@types/qs": "*",
|
|
@@ -794,9 +806,9 @@
|
|
|
794
806
|
}
|
|
795
807
|
},
|
|
796
808
|
"node_modules/@types/node": {
|
|
797
|
-
"version": "20.14.
|
|
798
|
-
"resolved": "https://registry.npmjs.org/@types/node/-/node-20.14.
|
|
799
|
-
"integrity": "sha512-
|
|
809
|
+
"version": "20.14.8",
|
|
810
|
+
"resolved": "https://registry.npmjs.org/@types/node/-/node-20.14.8.tgz",
|
|
811
|
+
"integrity": "sha512-DO+2/jZinXfROG7j7WKFn/3C6nFwxy2lLpgLjEXJz+0XKphZlTLJ14mo8Vfg8X5BWN6XjyESXq+LcYdT7tR3bA==",
|
|
800
812
|
"dependencies": {
|
|
801
813
|
"undici-types": "~5.26.4"
|
|
802
814
|
}
|
|
@@ -1043,9 +1055,9 @@
|
|
|
1043
1055
|
}
|
|
1044
1056
|
},
|
|
1045
1057
|
"node_modules/appium-adb": {
|
|
1046
|
-
"version": "12.4.
|
|
1047
|
-
"resolved": "https://registry.npmjs.org/appium-adb/-/appium-adb-12.4.
|
|
1048
|
-
"integrity": "sha512-
|
|
1058
|
+
"version": "12.4.4",
|
|
1059
|
+
"resolved": "https://registry.npmjs.org/appium-adb/-/appium-adb-12.4.4.tgz",
|
|
1060
|
+
"integrity": "sha512-q+vN6NgnUlcWT6FV12ryc1d8bFZSQOtcXpJJuUtgWYwVhebJB8hJE+6mcqUG5LOrcEWLOQXkx1oVQSx+VQosTQ==",
|
|
1049
1061
|
"dependencies": {
|
|
1050
1062
|
"@appium/support": "^5.0.3",
|
|
1051
1063
|
"@devicefarmer/adbkit-apkreader": "^3.2.4",
|
|
@@ -1065,9 +1077,9 @@
|
|
|
1065
1077
|
}
|
|
1066
1078
|
},
|
|
1067
1079
|
"node_modules/appium-android-driver": {
|
|
1068
|
-
"version": "9.
|
|
1069
|
-
"resolved": "https://registry.npmjs.org/appium-android-driver/-/appium-android-driver-9.
|
|
1070
|
-
"integrity": "sha512-
|
|
1080
|
+
"version": "9.7.0",
|
|
1081
|
+
"resolved": "https://registry.npmjs.org/appium-android-driver/-/appium-android-driver-9.7.0.tgz",
|
|
1082
|
+
"integrity": "sha512-0XWMOuuA8uzMcHturqYwfECnY6imfPzXuPxs75/XfUuyDCkVE7zHoAQaYJes3Q3A6tE9MEMTvmY3GKyjJR6koQ==",
|
|
1071
1083
|
"dependencies": {
|
|
1072
1084
|
"@appium/support": "^4.2.0",
|
|
1073
1085
|
"@colors/colors": "^1.6.0",
|
|
@@ -1220,9 +1232,9 @@
|
|
|
1220
1232
|
}
|
|
1221
1233
|
},
|
|
1222
1234
|
"node_modules/appium-chromedriver": {
|
|
1223
|
-
"version": "5.6.
|
|
1224
|
-
"resolved": "https://registry.npmjs.org/appium-chromedriver/-/appium-chromedriver-5.6.
|
|
1225
|
-
"integrity": "sha512-
|
|
1235
|
+
"version": "5.6.61",
|
|
1236
|
+
"resolved": "https://registry.npmjs.org/appium-chromedriver/-/appium-chromedriver-5.6.61.tgz",
|
|
1237
|
+
"integrity": "sha512-PO2HioadxOE+yijz+YgPbWxAbPJn0H0mW1tTvpWz45x9kTWMgXY5lXAv9jSZsSF2iTx8DOxInUltEBr9dPIjLw==",
|
|
1226
1238
|
"hasInstallScript": true,
|
|
1227
1239
|
"dependencies": {
|
|
1228
1240
|
"@appium/base-driver": "^9.1.0",
|
|
@@ -2767,9 +2779,9 @@
|
|
|
2767
2779
|
}
|
|
2768
2780
|
},
|
|
2769
2781
|
"node_modules/io.appium.settings": {
|
|
2770
|
-
"version": "5.12.
|
|
2771
|
-
"resolved": "https://registry.npmjs.org/io.appium.settings/-/io.appium.settings-5.12.
|
|
2772
|
-
"integrity": "sha512-
|
|
2782
|
+
"version": "5.12.4",
|
|
2783
|
+
"resolved": "https://registry.npmjs.org/io.appium.settings/-/io.appium.settings-5.12.4.tgz",
|
|
2784
|
+
"integrity": "sha512-L/x6a2cM/lPZyTJgshAaMN9G8FsIJYqON7/MJwAUl268oDN/igwxuc8k5RrhK5lYgEbqNEqXktosQIeeOTKozA==",
|
|
2773
2785
|
"dependencies": {
|
|
2774
2786
|
"@appium/logger": "^1.3.0",
|
|
2775
2787
|
"asyncbox": "^3.0.0",
|
|
@@ -2798,11 +2810,14 @@
|
|
|
2798
2810
|
"integrity": "sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg=="
|
|
2799
2811
|
},
|
|
2800
2812
|
"node_modules/is-core-module": {
|
|
2801
|
-
"version": "2.
|
|
2802
|
-
"resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.
|
|
2803
|
-
"integrity": "sha512-
|
|
2813
|
+
"version": "2.14.0",
|
|
2814
|
+
"resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.14.0.tgz",
|
|
2815
|
+
"integrity": "sha512-a5dFJih5ZLYlRtDc0dZWP7RiKr6xIKzmn/oAYCDvdLThadVgyJwlaoQPmRtMSpz+rk0OGAgIu+TcM9HUF0fk1A==",
|
|
2804
2816
|
"dependencies": {
|
|
2805
|
-
"hasown": "^2.0.
|
|
2817
|
+
"hasown": "^2.0.2"
|
|
2818
|
+
},
|
|
2819
|
+
"engines": {
|
|
2820
|
+
"node": ">= 0.4"
|
|
2806
2821
|
},
|
|
2807
2822
|
"funding": {
|
|
2808
2823
|
"url": "https://github.com/sponsors/ljharb"
|
|
@@ -3377,9 +3392,12 @@
|
|
|
3377
3392
|
}
|
|
3378
3393
|
},
|
|
3379
3394
|
"node_modules/object-inspect": {
|
|
3380
|
-
"version": "1.13.
|
|
3381
|
-
"resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.
|
|
3382
|
-
"integrity": "sha512-
|
|
3395
|
+
"version": "1.13.2",
|
|
3396
|
+
"resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.2.tgz",
|
|
3397
|
+
"integrity": "sha512-IRZSRuzJiynemAXPYtPe5BoI/RESNYR7TYm50MC5Mqbd3Jmw5y790sErYw3V6SryFJD64b74qQQs9wn5Bg/k3g==",
|
|
3398
|
+
"engines": {
|
|
3399
|
+
"node": ">= 0.4"
|
|
3400
|
+
},
|
|
3383
3401
|
"funding": {
|
|
3384
3402
|
"url": "https://github.com/sponsors/ljharb"
|
|
3385
3403
|
}
|
|
@@ -4483,9 +4501,9 @@
|
|
|
4483
4501
|
}
|
|
4484
4502
|
},
|
|
4485
4503
|
"node_modules/typescript": {
|
|
4486
|
-
"version": "5.
|
|
4487
|
-
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.
|
|
4488
|
-
"integrity": "sha512-
|
|
4504
|
+
"version": "5.5.2",
|
|
4505
|
+
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.5.2.tgz",
|
|
4506
|
+
"integrity": "sha512-NcRtPEOsPFFWjobJEtfihkLCZCXZt/os3zf8nTxjVH3RvTSxjrCamJpbExGvYOF+tFHc3pA65qpdwPbzjohhew==",
|
|
4489
4507
|
"bin": {
|
|
4490
4508
|
"tsc": "bin/tsc",
|
|
4491
4509
|
"tsserver": "bin/tsserver"
|
package/package.json
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
"automated testing",
|
|
8
8
|
"android"
|
|
9
9
|
],
|
|
10
|
-
"version": "3.
|
|
10
|
+
"version": "3.6.0",
|
|
11
11
|
"bugs": {
|
|
12
12
|
"url": "https://github.com/appium/appium-uiautomator2-driver/issues"
|
|
13
13
|
},
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
},
|
|
58
58
|
"dependencies": {
|
|
59
59
|
"appium-adb": "^12.2.0",
|
|
60
|
-
"appium-android-driver": "^9.
|
|
60
|
+
"appium-android-driver": "^9.7.0",
|
|
61
61
|
"appium-chromedriver": "^5.6.28",
|
|
62
62
|
"appium-uiautomator2-server": "^7.0.14",
|
|
63
63
|
"asyncbox": "^3.0.0",
|