appium-uiautomator2-driver 2.32.3 → 2.33.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/lib/driver.ts CHANGED
@@ -183,6 +183,8 @@ class AndroidUiautomator2Driver
183
183
 
184
184
  _hasSystemPortInCaps: boolean | undefined;
185
185
 
186
+ _originalIme: string | null;
187
+
186
188
  mjpegStream?: mjpeg.MJpegStream;
187
189
 
188
190
  override caps: Uiautomator2DriverCaps;
@@ -210,6 +212,7 @@ class AndroidUiautomator2Driver
210
212
  this.jwpProxyActive = false;
211
213
  this.jwpProxyAvoid = NO_PROXY;
212
214
  this.apkStrings = {}; // map of language -> strings obj
215
+ this._originalIme = null;
213
216
 
214
217
  this.settings = new DeviceSettings(
215
218
  {ignoreUnimportantViews: false, allowInvisibleElements: false},
@@ -485,7 +488,9 @@ class AndroidUiautomator2Driver
485
488
  };
486
489
 
487
490
  // start an avd, set the language/locale, pick an emulator, etc...
488
- // TODO with multiple devices we'll need to parameterize this
491
+ if (this.opts.hideKeyboard) {
492
+ this._originalIme = await this.adb.defaultIME();
493
+ }
489
494
  await helpers.initDevice(this.adb, this.opts);
490
495
 
491
496
  // Prepare the device by forwarding the UiAutomator2 port
@@ -791,6 +796,13 @@ class AndroidUiautomator2Driver
791
796
  this.log.info('Restoring window animation state');
792
797
  await this.adb.setAnimationState(true);
793
798
  }
799
+ if (this._originalIme) {
800
+ try {
801
+ await this.adb.setIME(this._originalIme);
802
+ } catch (e) {
803
+ this.log.warn(`Cannot restore the original IME: ${e.message}`);
804
+ }
805
+ }
794
806
  await this.adb.stopLogcat();
795
807
  try {
796
808
  await this.releaseSystemPort();
@@ -1,16 +1,16 @@
1
1
  {
2
2
  "name": "appium-uiautomator2-driver",
3
- "version": "2.32.3",
3
+ "version": "2.33.0",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "appium-uiautomator2-driver",
9
- "version": "2.32.3",
9
+ "version": "2.33.0",
10
10
  "license": "Apache-2.0",
11
11
  "dependencies": {
12
- "appium-adb": "^10.0.0",
13
- "appium-android-driver": "^7.1.3",
12
+ "appium-adb": "^11.0.1",
13
+ "appium-android-driver": "^7.2.1",
14
14
  "appium-chromedriver": "^5.6.5",
15
15
  "appium-uiautomator2-server": "^5.12.2",
16
16
  "asyncbox": "^2.3.1",
@@ -31,8 +31,8 @@
31
31
  "@appium/test-support": "^3.0.0",
32
32
  "@appium/tsconfig": "^0.x",
33
33
  "@appium/types": "^0.x",
34
- "@commitlint/cli": "^17.6.3",
35
- "@commitlint/config-conventional": "^17.6.3",
34
+ "@commitlint/cli": "^18.0.0",
35
+ "@commitlint/config-conventional": "^18.0.0",
36
36
  "@semantic-release/changelog": "^6.0.1",
37
37
  "@semantic-release/git": "^10.0.1",
38
38
  "@types/bluebird": "^3.5.38",
@@ -45,11 +45,11 @@
45
45
  "@types/semver": "^7.5.0",
46
46
  "@types/sinon": "^10.0.15",
47
47
  "@types/sinon-chai": "^3.2.9",
48
- "@types/source-map-support": "^0.5.6",
48
+ "@types/source-map-support": "^0.x",
49
49
  "@types/teen_process": "^2.0.0",
50
50
  "@types/ws": "^8.5.4",
51
- "@typescript-eslint/eslint-plugin": "^5.59.5",
52
- "@typescript-eslint/parser": "^5.59.5",
51
+ "@typescript-eslint/eslint-plugin": "^6.9.0",
52
+ "@typescript-eslint/parser": "^6.9.0",
53
53
  "@xmldom/xmldom": "^0.x",
54
54
  "android-apidemos": "^4.1.1",
55
55
  "appium": "^2.0.0-rc.3",
@@ -57,7 +57,7 @@
57
57
  "chai-as-promised": "^7.1.1",
58
58
  "conventional-changelog-conventionalcommits": "^7.0.1",
59
59
  "eslint": "^8.40.0",
60
- "eslint-config-prettier": "^8.8.0",
60
+ "eslint-config-prettier": "^9.0.0",
61
61
  "eslint-import-resolver-typescript": "^3.5.5",
62
62
  "eslint-plugin-import": "^2.27.5",
63
63
  "eslint-plugin-mocha": "^10.1.0",
@@ -70,7 +70,7 @@
70
70
  "rimraf": "^5.0.0",
71
71
  "semantic-release": "^22.0.5",
72
72
  "sharp": "^0.x",
73
- "sinon": "^16.1.0",
73
+ "sinon": "^17.0.0",
74
74
  "sinon-chai": "^3.7.0",
75
75
  "ts-node": "^10.9.1",
76
76
  "typescript": "~5.2",
@@ -125,6 +125,15 @@
125
125
  "spdy": "4.0.2"
126
126
  }
127
127
  },
128
+ "node_modules/@appium/base-driver/node_modules/axios": {
129
+ "version": "1.5.1",
130
+ "license": "MIT",
131
+ "dependencies": {
132
+ "follow-redirects": "^1.15.0",
133
+ "form-data": "^4.0.0",
134
+ "proxy-from-env": "^1.1.0"
135
+ }
136
+ },
128
137
  "node_modules/@appium/base-driver/node_modules/type-fest": {
129
138
  "version": "3.13.1",
130
139
  "license": "(MIT OR CC0-1.0)",
@@ -413,6 +422,15 @@
413
422
  "@types/node": "*"
414
423
  }
415
424
  },
425
+ "node_modules/@appium/support/node_modules/axios": {
426
+ "version": "1.5.1",
427
+ "license": "MIT",
428
+ "dependencies": {
429
+ "follow-redirects": "^1.15.0",
430
+ "form-data": "^4.0.0",
431
+ "proxy-from-env": "^1.1.0"
432
+ }
433
+ },
416
434
  "node_modules/@appium/support/node_modules/teen_process": {
417
435
  "version": "2.0.50",
418
436
  "license": "Apache-2.0",
@@ -909,10 +927,10 @@
909
927
  }
910
928
  },
911
929
  "node_modules/@types/node": {
912
- "version": "20.8.7",
930
+ "version": "20.8.9",
913
931
  "license": "MIT",
914
932
  "dependencies": {
915
- "undici-types": "~5.25.1"
933
+ "undici-types": "~5.26.4"
916
934
  }
917
935
  },
918
936
  "node_modules/@types/normalize-package-data": {
@@ -1110,7 +1128,7 @@
1110
1128
  }
1111
1129
  },
1112
1130
  "node_modules/appium-adb": {
1113
- "version": "10.0.0",
1131
+ "version": "11.0.4",
1114
1132
  "license": "Apache-2.0",
1115
1133
  "dependencies": {
1116
1134
  "@appium/support": "^4.0.0",
@@ -1131,15 +1149,15 @@
1131
1149
  }
1132
1150
  },
1133
1151
  "node_modules/appium-android-driver": {
1134
- "version": "7.1.4",
1152
+ "version": "7.2.1",
1135
1153
  "license": "Apache-2.0",
1136
1154
  "dependencies": {
1137
- "appium-adb": "^10.0.0",
1155
+ "appium-adb": "^11.0.1",
1138
1156
  "appium-chromedriver": "^5.5.1",
1139
1157
  "asyncbox": "^2.8.0",
1140
1158
  "axios": "^1.x",
1141
1159
  "bluebird": "^3.4.7",
1142
- "io.appium.settings": "^5.0.0",
1160
+ "io.appium.settings": "^5.2.0",
1143
1161
  "lodash": "^4.17.4",
1144
1162
  "lru-cache": "^10.0.1",
1145
1163
  "moment": "^2.24.0",
@@ -1160,7 +1178,7 @@
1160
1178
  }
1161
1179
  },
1162
1180
  "node_modules/appium-chromedriver": {
1163
- "version": "5.6.18",
1181
+ "version": "5.6.20",
1164
1182
  "hasInstallScript": true,
1165
1183
  "license": "Apache-2.0",
1166
1184
  "dependencies": {
@@ -1184,29 +1202,8 @@
1184
1202
  "npm": ">=8"
1185
1203
  }
1186
1204
  },
1187
- "node_modules/appium-chromedriver/node_modules/appium-adb": {
1188
- "version": "11.0.1",
1189
- "license": "Apache-2.0",
1190
- "dependencies": {
1191
- "@appium/support": "^4.0.0",
1192
- "adbkit-apkreader": "^3.1.2",
1193
- "async-lock": "^1.0.0",
1194
- "asyncbox": "^2.6.0",
1195
- "bluebird": "^3.4.7",
1196
- "ini": "^4.1.1",
1197
- "lodash": "^4.0.0",
1198
- "lru-cache": "^10.0.0",
1199
- "semver": "^7.0.0",
1200
- "source-map-support": "^0.x",
1201
- "teen_process": "^2.0.1"
1202
- },
1203
- "engines": {
1204
- "node": ">=14",
1205
- "npm": ">=8"
1206
- }
1207
- },
1208
1205
  "node_modules/appium-uiautomator2-server": {
1209
- "version": "5.12.7",
1206
+ "version": "5.12.15",
1210
1207
  "license": "Apache-2.0",
1211
1208
  "engines": {
1212
1209
  "node": ">=14",
@@ -1370,7 +1367,7 @@
1370
1367
  "license": "MIT"
1371
1368
  },
1372
1369
  "node_modules/axios": {
1373
- "version": "1.5.1",
1370
+ "version": "1.6.0",
1374
1371
  "license": "MIT",
1375
1372
  "dependencies": {
1376
1373
  "follow-redirects": "^1.15.0",
@@ -1543,11 +1540,12 @@
1543
1540
  }
1544
1541
  },
1545
1542
  "node_modules/call-bind": {
1546
- "version": "1.0.2",
1543
+ "version": "1.0.5",
1547
1544
  "license": "MIT",
1548
1545
  "dependencies": {
1549
- "function-bind": "^1.1.1",
1550
- "get-intrinsic": "^1.0.2"
1546
+ "function-bind": "^1.1.2",
1547
+ "get-intrinsic": "^1.2.1",
1548
+ "set-function-length": "^1.1.1"
1551
1549
  },
1552
1550
  "funding": {
1553
1551
  "url": "https://github.com/sponsors/ljharb"
@@ -1920,6 +1918,18 @@
1920
1918
  "url": "https://github.com/sponsors/sindresorhus"
1921
1919
  }
1922
1920
  },
1921
+ "node_modules/define-data-property": {
1922
+ "version": "1.1.1",
1923
+ "license": "MIT",
1924
+ "dependencies": {
1925
+ "get-intrinsic": "^1.2.1",
1926
+ "gopd": "^1.0.1",
1927
+ "has-property-descriptors": "^1.0.0"
1928
+ },
1929
+ "engines": {
1930
+ "node": ">= 0.4"
1931
+ }
1932
+ },
1923
1933
  "node_modules/delayed-stream": {
1924
1934
  "version": "1.0.0",
1925
1935
  "license": "MIT",
@@ -2414,13 +2424,13 @@
2414
2424
  }
2415
2425
  },
2416
2426
  "node_modules/get-intrinsic": {
2417
- "version": "1.2.1",
2427
+ "version": "1.2.2",
2418
2428
  "license": "MIT",
2419
2429
  "dependencies": {
2420
- "function-bind": "^1.1.1",
2421
- "has": "^1.0.3",
2430
+ "function-bind": "^1.1.2",
2422
2431
  "has-proto": "^1.0.1",
2423
- "has-symbols": "^1.0.3"
2432
+ "has-symbols": "^1.0.3",
2433
+ "hasown": "^2.0.0"
2424
2434
  },
2425
2435
  "funding": {
2426
2436
  "url": "https://github.com/sponsors/ljharb"
@@ -2481,6 +2491,16 @@
2481
2491
  "url": "https://github.com/sponsors/isaacs"
2482
2492
  }
2483
2493
  },
2494
+ "node_modules/gopd": {
2495
+ "version": "1.0.1",
2496
+ "license": "MIT",
2497
+ "dependencies": {
2498
+ "get-intrinsic": "^1.1.3"
2499
+ },
2500
+ "funding": {
2501
+ "url": "https://github.com/sponsors/ljharb"
2502
+ }
2503
+ },
2484
2504
  "node_modules/graceful-fs": {
2485
2505
  "version": "4.2.11",
2486
2506
  "license": "ISC"
@@ -2510,13 +2530,6 @@
2510
2530
  "uglify-js": "^3.1.4"
2511
2531
  }
2512
2532
  },
2513
- "node_modules/has": {
2514
- "version": "1.0.4",
2515
- "license": "MIT",
2516
- "engines": {
2517
- "node": ">= 0.4.0"
2518
- }
2519
- },
2520
2533
  "node_modules/has-flag": {
2521
2534
  "version": "4.0.0",
2522
2535
  "license": "MIT",
@@ -2524,6 +2537,16 @@
2524
2537
  "node": ">=8"
2525
2538
  }
2526
2539
  },
2540
+ "node_modules/has-property-descriptors": {
2541
+ "version": "1.0.1",
2542
+ "license": "MIT",
2543
+ "dependencies": {
2544
+ "get-intrinsic": "^1.2.2"
2545
+ },
2546
+ "funding": {
2547
+ "url": "https://github.com/sponsors/ljharb"
2548
+ }
2549
+ },
2527
2550
  "node_modules/has-proto": {
2528
2551
  "version": "1.0.1",
2529
2552
  "license": "MIT",
@@ -2548,6 +2571,20 @@
2548
2571
  "version": "2.0.1",
2549
2572
  "license": "ISC"
2550
2573
  },
2574
+ "node_modules/hasown": {
2575
+ "version": "2.0.0",
2576
+ "license": "MIT",
2577
+ "dependencies": {
2578
+ "function-bind": "^1.1.2"
2579
+ },
2580
+ "engines": {
2581
+ "node": ">= 0.4"
2582
+ }
2583
+ },
2584
+ "node_modules/hosted-git-info": {
2585
+ "version": "2.8.9",
2586
+ "license": "ISC"
2587
+ },
2551
2588
  "node_modules/hpack.js": {
2552
2589
  "version": "2.1.6",
2553
2590
  "license": "MIT",
@@ -2662,7 +2699,7 @@
2662
2699
  }
2663
2700
  },
2664
2701
  "node_modules/io.appium.settings": {
2665
- "version": "5.1.2",
2702
+ "version": "5.2.0",
2666
2703
  "license": "Apache-2.0",
2667
2704
  "engines": {
2668
2705
  "node": ">=14",
@@ -2681,10 +2718,10 @@
2681
2718
  "license": "MIT"
2682
2719
  },
2683
2720
  "node_modules/is-core-module": {
2684
- "version": "2.13.0",
2721
+ "version": "2.13.1",
2685
2722
  "license": "MIT",
2686
2723
  "dependencies": {
2687
- "has": "^1.0.3"
2724
+ "hasown": "^2.0.0"
2688
2725
  },
2689
2726
  "funding": {
2690
2727
  "url": "https://github.com/sponsors/ljharb"
@@ -3200,6 +3237,23 @@
3200
3237
  "devOptional": true,
3201
3238
  "license": "MIT"
3202
3239
  },
3240
+ "node_modules/normalize-package-data": {
3241
+ "version": "2.5.0",
3242
+ "license": "BSD-2-Clause",
3243
+ "dependencies": {
3244
+ "hosted-git-info": "^2.1.4",
3245
+ "resolve": "^1.10.0",
3246
+ "semver": "2 || 3 || 4 || 5",
3247
+ "validate-npm-package-license": "^3.0.1"
3248
+ }
3249
+ },
3250
+ "node_modules/normalize-package-data/node_modules/semver": {
3251
+ "version": "5.7.2",
3252
+ "license": "ISC",
3253
+ "bin": {
3254
+ "semver": "bin/semver"
3255
+ }
3256
+ },
3203
3257
  "node_modules/normalize-path": {
3204
3258
  "version": "3.0.0",
3205
3259
  "license": "MIT",
@@ -3221,7 +3275,7 @@
3221
3275
  }
3222
3276
  },
3223
3277
  "node_modules/object-inspect": {
3224
- "version": "1.13.0",
3278
+ "version": "1.13.1",
3225
3279
  "license": "MIT",
3226
3280
  "funding": {
3227
3281
  "url": "https://github.com/sponsors/ljharb"
@@ -3667,27 +3721,6 @@
3667
3721
  "node": ">=8"
3668
3722
  }
3669
3723
  },
3670
- "node_modules/read-pkg/node_modules/hosted-git-info": {
3671
- "version": "2.8.9",
3672
- "license": "ISC"
3673
- },
3674
- "node_modules/read-pkg/node_modules/normalize-package-data": {
3675
- "version": "2.5.0",
3676
- "license": "BSD-2-Clause",
3677
- "dependencies": {
3678
- "hosted-git-info": "^2.1.4",
3679
- "resolve": "^1.10.0",
3680
- "semver": "2 || 3 || 4 || 5",
3681
- "validate-npm-package-license": "^3.0.1"
3682
- }
3683
- },
3684
- "node_modules/read-pkg/node_modules/semver": {
3685
- "version": "5.7.2",
3686
- "license": "ISC",
3687
- "bin": {
3688
- "semver": "bin/semver"
3689
- }
3690
- },
3691
3724
  "node_modules/read-pkg/node_modules/type-fest": {
3692
3725
  "version": "0.6.0",
3693
3726
  "license": "(MIT OR CC0-1.0)",
@@ -3924,6 +3957,19 @@
3924
3957
  "version": "2.0.0",
3925
3958
  "license": "ISC"
3926
3959
  },
3960
+ "node_modules/set-function-length": {
3961
+ "version": "1.1.1",
3962
+ "license": "MIT",
3963
+ "dependencies": {
3964
+ "define-data-property": "^1.1.1",
3965
+ "get-intrinsic": "^1.2.1",
3966
+ "gopd": "^1.0.1",
3967
+ "has-property-descriptors": "^1.0.0"
3968
+ },
3969
+ "engines": {
3970
+ "node": ">= 0.4"
3971
+ }
3972
+ },
3927
3973
  "node_modules/setprototypeof": {
3928
3974
  "version": "1.2.0",
3929
3975
  "license": "ISC"
@@ -4155,7 +4201,7 @@
4155
4201
  }
4156
4202
  },
4157
4203
  "node_modules/streamx": {
4158
- "version": "2.15.1",
4204
+ "version": "2.15.2",
4159
4205
  "license": "MIT",
4160
4206
  "dependencies": {
4161
4207
  "fast-fifo": "^1.1.0",
@@ -4295,7 +4341,7 @@
4295
4341
  }
4296
4342
  },
4297
4343
  "node_modules/teen_process": {
4298
- "version": "2.0.54",
4344
+ "version": "2.0.68",
4299
4345
  "license": "Apache-2.0",
4300
4346
  "dependencies": {
4301
4347
  "bluebird": "3.7.2",
@@ -4356,7 +4402,7 @@
4356
4402
  }
4357
4403
  },
4358
4404
  "node_modules/type-fest": {
4359
- "version": "4.5.0",
4405
+ "version": "4.6.0",
4360
4406
  "license": "(MIT OR CC0-1.0)",
4361
4407
  "engines": {
4362
4408
  "node": ">=16"
@@ -4401,7 +4447,7 @@
4401
4447
  }
4402
4448
  },
4403
4449
  "node_modules/undici-types": {
4404
- "version": "5.25.3",
4450
+ "version": "5.26.5",
4405
4451
  "license": "MIT"
4406
4452
  },
4407
4453
  "node_modules/unorm": {
package/package.json CHANGED
@@ -7,7 +7,7 @@
7
7
  "automated testing",
8
8
  "android"
9
9
  ],
10
- "version": "2.32.3",
10
+ "version": "2.33.0",
11
11
  "bugs": {
12
12
  "url": "https://github.com/appium/appium-uiautomator2-driver/issues"
13
13
  },
@@ -62,8 +62,8 @@
62
62
  "singleQuote": true
63
63
  },
64
64
  "dependencies": {
65
- "appium-adb": "^10.0.0",
66
- "appium-android-driver": "^7.1.3",
65
+ "appium-adb": "^11.0.1",
66
+ "appium-android-driver": "^7.2.1",
67
67
  "appium-chromedriver": "^5.6.5",
68
68
  "appium-uiautomator2-server": "^5.12.2",
69
69
  "asyncbox": "^2.3.1",
@@ -84,8 +84,8 @@
84
84
  "@appium/test-support": "^3.0.0",
85
85
  "@appium/tsconfig": "^0.x",
86
86
  "@appium/types": "^0.x",
87
- "@commitlint/cli": "^17.6.3",
88
- "@commitlint/config-conventional": "^17.6.3",
87
+ "@commitlint/cli": "^18.0.0",
88
+ "@commitlint/config-conventional": "^18.0.0",
89
89
  "@semantic-release/changelog": "^6.0.1",
90
90
  "@semantic-release/git": "^10.0.1",
91
91
  "@types/bluebird": "^3.5.38",
@@ -98,11 +98,11 @@
98
98
  "@types/semver": "^7.5.0",
99
99
  "@types/sinon": "^10.0.15",
100
100
  "@types/sinon-chai": "^3.2.9",
101
- "@types/source-map-support": "^0.5.6",
101
+ "@types/source-map-support": "^0.x",
102
102
  "@types/teen_process": "^2.0.0",
103
103
  "@types/ws": "^8.5.4",
104
- "@typescript-eslint/eslint-plugin": "^5.59.5",
105
- "@typescript-eslint/parser": "^5.59.5",
104
+ "@typescript-eslint/eslint-plugin": "^6.9.0",
105
+ "@typescript-eslint/parser": "^6.9.0",
106
106
  "@xmldom/xmldom": "^0.x",
107
107
  "android-apidemos": "^4.1.1",
108
108
  "appium": "^2.0.0-rc.3",
@@ -110,7 +110,7 @@
110
110
  "chai-as-promised": "^7.1.1",
111
111
  "conventional-changelog-conventionalcommits": "^7.0.1",
112
112
  "eslint": "^8.40.0",
113
- "eslint-config-prettier": "^8.8.0",
113
+ "eslint-config-prettier": "^9.0.0",
114
114
  "eslint-import-resolver-typescript": "^3.5.5",
115
115
  "eslint-plugin-import": "^2.27.5",
116
116
  "eslint-plugin-mocha": "^10.1.0",
@@ -123,7 +123,7 @@
123
123
  "rimraf": "^5.0.0",
124
124
  "semantic-release": "^22.0.5",
125
125
  "sharp": "^0.x",
126
- "sinon": "^16.1.0",
126
+ "sinon": "^17.0.0",
127
127
  "sinon-chai": "^3.7.0",
128
128
  "ts-node": "^10.9.1",
129
129
  "typescript": "~5.2",