appium-android-driver 7.8.3 → 8.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.
Files changed (261) hide show
  1. package/CHANGELOG.md +32 -0
  2. package/build/lib/commands/app-management.d.ts +129 -5
  3. package/build/lib/commands/app-management.d.ts.map +1 -1
  4. package/build/lib/commands/app-management.js +433 -128
  5. package/build/lib/commands/app-management.js.map +1 -1
  6. package/build/lib/commands/appearance.d.ts +17 -4
  7. package/build/lib/commands/appearance.d.ts.map +1 -1
  8. package/build/lib/commands/appearance.js +32 -33
  9. package/build/lib/commands/appearance.js.map +1 -1
  10. package/build/lib/commands/context/cache.d.ts +19 -0
  11. package/build/lib/commands/context/cache.d.ts.map +1 -0
  12. package/build/lib/commands/context/cache.js +32 -0
  13. package/build/lib/commands/context/cache.js.map +1 -0
  14. package/build/lib/commands/context/exports.d.ts +141 -0
  15. package/build/lib/commands/context/exports.d.ts.map +1 -0
  16. package/build/lib/commands/context/exports.js +351 -0
  17. package/build/lib/commands/context/exports.js.map +1 -0
  18. package/build/lib/commands/context/helpers.d.ts +98 -0
  19. package/build/lib/commands/context/helpers.d.ts.map +1 -0
  20. package/build/lib/commands/context/helpers.js +715 -0
  21. package/build/lib/commands/context/helpers.js.map +1 -0
  22. package/build/lib/commands/device/common.d.ts +23 -0
  23. package/build/lib/commands/device/common.d.ts.map +1 -0
  24. package/build/lib/commands/device/common.js +230 -0
  25. package/build/lib/commands/device/common.js.map +1 -0
  26. package/build/lib/commands/device/emulator-actions.d.ts +114 -0
  27. package/build/lib/commands/device/emulator-actions.d.ts.map +1 -0
  28. package/build/lib/commands/device/emulator-actions.js +197 -0
  29. package/build/lib/commands/device/emulator-actions.js.map +1 -0
  30. package/build/lib/commands/device/emulator-console.d.ts +7 -0
  31. package/build/lib/commands/device/emulator-console.d.ts.map +1 -0
  32. package/build/lib/commands/device/emulator-console.js +24 -0
  33. package/build/lib/commands/device/emulator-console.js.map +1 -0
  34. package/build/lib/commands/device/utils.d.ts +50 -0
  35. package/build/lib/commands/device/utils.d.ts.map +1 -0
  36. package/build/lib/commands/device/utils.js +238 -0
  37. package/build/lib/commands/device/utils.js.map +1 -0
  38. package/build/lib/commands/deviceidle.d.ts +8 -5
  39. package/build/lib/commands/deviceidle.d.ts.map +1 -1
  40. package/build/lib/commands/deviceidle.js +31 -37
  41. package/build/lib/commands/deviceidle.js.map +1 -1
  42. package/build/lib/commands/element.d.ts +99 -5
  43. package/build/lib/commands/element.d.ts.map +1 -1
  44. package/build/lib/commands/element.js +152 -116
  45. package/build/lib/commands/element.js.map +1 -1
  46. package/build/lib/commands/execute.d.ts +12 -4
  47. package/build/lib/commands/execute.d.ts.map +1 -1
  48. package/build/lib/commands/execute.js +83 -78
  49. package/build/lib/commands/execute.js.map +1 -1
  50. package/build/lib/commands/file-actions.d.ts +42 -5
  51. package/build/lib/commands/file-actions.d.ts.map +1 -1
  52. package/build/lib/commands/file-actions.js +230 -194
  53. package/build/lib/commands/file-actions.js.map +1 -1
  54. package/build/lib/commands/find.d.ts +5 -4
  55. package/build/lib/commands/find.d.ts.map +1 -1
  56. package/build/lib/commands/find.js +7 -10
  57. package/build/lib/commands/find.js.map +1 -1
  58. package/build/lib/commands/geolocation.d.ts +45 -0
  59. package/build/lib/commands/geolocation.d.ts.map +1 -0
  60. package/build/lib/commands/geolocation.js +182 -0
  61. package/build/lib/commands/geolocation.js.map +1 -0
  62. package/build/lib/commands/ime.d.ts +25 -5
  63. package/build/lib/commands/ime.d.ts.map +1 -1
  64. package/build/lib/commands/ime.js +59 -42
  65. package/build/lib/commands/ime.js.map +1 -1
  66. package/build/lib/commands/intent.d.ts +56 -5
  67. package/build/lib/commands/intent.d.ts.map +1 -1
  68. package/build/lib/commands/intent.js +135 -83
  69. package/build/lib/commands/intent.js.map +1 -1
  70. package/build/lib/commands/keyboard.d.ts +58 -4
  71. package/build/lib/commands/keyboard.d.ts.map +1 -1
  72. package/build/lib/commands/keyboard.js +119 -17
  73. package/build/lib/commands/keyboard.js.map +1 -1
  74. package/build/lib/commands/lock/exports.d.ts +301 -0
  75. package/build/lib/commands/lock/exports.d.ts.map +1 -0
  76. package/build/lib/commands/lock/exports.js +121 -0
  77. package/build/lib/commands/lock/exports.js.map +1 -0
  78. package/build/lib/commands/lock/helpers.d.ts +349 -0
  79. package/build/lib/commands/lock/helpers.d.ts.map +1 -0
  80. package/build/lib/commands/lock/helpers.js +375 -0
  81. package/build/lib/commands/lock/helpers.js.map +1 -0
  82. package/build/lib/commands/log.d.ts +59 -5
  83. package/build/lib/commands/log.d.ts.map +1 -1
  84. package/build/lib/commands/log.js +150 -140
  85. package/build/lib/commands/log.js.map +1 -1
  86. package/build/lib/commands/media-projection.d.ts +16 -5
  87. package/build/lib/commands/media-projection.d.ts.map +1 -1
  88. package/build/lib/commands/media-projection.js +69 -58
  89. package/build/lib/commands/media-projection.js.map +1 -1
  90. package/build/lib/commands/memory.d.ts +9 -5
  91. package/build/lib/commands/memory.d.ts.map +1 -1
  92. package/build/lib/commands/memory.js +19 -24
  93. package/build/lib/commands/memory.js.map +1 -1
  94. package/build/lib/commands/misc.d.ts +42 -0
  95. package/build/lib/commands/misc.d.ts.map +1 -0
  96. package/build/lib/commands/misc.js +100 -0
  97. package/build/lib/commands/misc.js.map +1 -0
  98. package/build/lib/commands/network.d.ts +61 -5
  99. package/build/lib/commands/network.d.ts.map +1 -1
  100. package/build/lib/commands/network.js +196 -189
  101. package/build/lib/commands/network.js.map +1 -1
  102. package/build/lib/commands/performance.d.ts +67 -27
  103. package/build/lib/commands/performance.d.ts.map +1 -1
  104. package/build/lib/commands/performance.js +105 -80
  105. package/build/lib/commands/performance.js.map +1 -1
  106. package/build/lib/commands/permissions.d.ts +12 -6
  107. package/build/lib/commands/permissions.d.ts.map +1 -1
  108. package/build/lib/commands/permissions.js +65 -62
  109. package/build/lib/commands/permissions.js.map +1 -1
  110. package/build/lib/commands/recordscreen.d.ts +44 -5
  111. package/build/lib/commands/recordscreen.d.ts.map +1 -1
  112. package/build/lib/commands/recordscreen.js +131 -126
  113. package/build/lib/commands/recordscreen.js.map +1 -1
  114. package/build/lib/commands/resources.d.ts +16 -0
  115. package/build/lib/commands/resources.d.ts.map +1 -0
  116. package/build/lib/commands/resources.js +91 -0
  117. package/build/lib/commands/resources.js.map +1 -0
  118. package/build/lib/commands/shell.d.ts +8 -5
  119. package/build/lib/commands/shell.d.ts.map +1 -1
  120. package/build/lib/commands/shell.js +29 -33
  121. package/build/lib/commands/shell.js.map +1 -1
  122. package/build/lib/commands/streamscreen.d.ts +34 -6
  123. package/build/lib/commands/streamscreen.d.ts.map +1 -1
  124. package/build/lib/commands/streamscreen.js +166 -162
  125. package/build/lib/commands/streamscreen.js.map +1 -1
  126. package/build/lib/commands/system-bars.d.ts +18 -13
  127. package/build/lib/commands/system-bars.d.ts.map +1 -1
  128. package/build/lib/commands/system-bars.js +68 -64
  129. package/build/lib/commands/system-bars.js.map +1 -1
  130. package/build/lib/commands/time.d.ts +14 -0
  131. package/build/lib/commands/time.d.ts.map +1 -0
  132. package/build/lib/commands/time.js +39 -0
  133. package/build/lib/commands/time.js.map +1 -0
  134. package/build/lib/commands/touch.d.ts +99 -6
  135. package/build/lib/commands/touch.d.ts.map +1 -1
  136. package/build/lib/commands/touch.js +399 -280
  137. package/build/lib/commands/touch.js.map +1 -1
  138. package/build/lib/commands/types.d.ts +110 -2
  139. package/build/lib/commands/types.d.ts.map +1 -1
  140. package/build/lib/doctor/checks.d.ts.map +1 -1
  141. package/build/lib/doctor/checks.js +4 -4
  142. package/build/lib/doctor/checks.js.map +1 -1
  143. package/build/lib/driver.d.ts +224 -27
  144. package/build/lib/driver.d.ts.map +1 -1
  145. package/build/lib/driver.js +232 -7
  146. package/build/lib/driver.js.map +1 -1
  147. package/build/lib/index.d.ts +1 -4
  148. package/build/lib/index.d.ts.map +1 -1
  149. package/build/lib/index.js +1 -13
  150. package/build/lib/index.js.map +1 -1
  151. package/build/lib/logger.js.map +1 -1
  152. package/build/lib/method-map.d.ts +0 -23
  153. package/build/lib/method-map.d.ts.map +1 -1
  154. package/build/lib/method-map.js +0 -11
  155. package/build/lib/method-map.js.map +1 -1
  156. package/build/lib/utils.d.ts +12 -0
  157. package/build/lib/utils.d.ts.map +1 -1
  158. package/build/lib/utils.js +38 -2
  159. package/build/lib/utils.js.map +1 -1
  160. package/lib/commands/app-management.js +470 -145
  161. package/lib/commands/appearance.js +29 -36
  162. package/lib/commands/context/cache.js +29 -0
  163. package/lib/commands/context/exports.js +379 -0
  164. package/lib/commands/context/helpers.js +802 -0
  165. package/lib/commands/device/common.js +264 -0
  166. package/lib/commands/device/emulator-actions.js +194 -0
  167. package/lib/commands/device/emulator-console.js +24 -0
  168. package/lib/commands/device/utils.js +285 -0
  169. package/lib/commands/deviceidle.js +31 -44
  170. package/lib/commands/element.js +149 -142
  171. package/lib/commands/execute.js +86 -87
  172. package/lib/commands/file-actions.js +249 -222
  173. package/lib/commands/find.ts +13 -19
  174. package/lib/commands/geolocation.js +179 -0
  175. package/lib/commands/ime.js +53 -45
  176. package/lib/commands/intent.js +149 -91
  177. package/lib/commands/keyboard.js +114 -17
  178. package/lib/commands/lock/exports.js +139 -0
  179. package/lib/commands/lock/helpers.js +379 -0
  180. package/lib/commands/log.js +170 -166
  181. package/lib/commands/media-projection.js +75 -70
  182. package/lib/commands/memory.js +17 -29
  183. package/lib/commands/misc.js +94 -0
  184. package/lib/commands/network.js +209 -223
  185. package/lib/commands/performance.js +88 -73
  186. package/lib/commands/permissions.js +83 -84
  187. package/lib/commands/recordscreen.js +171 -170
  188. package/lib/commands/resources.js +96 -0
  189. package/lib/commands/shell.js +28 -42
  190. package/lib/commands/streamscreen.js +207 -206
  191. package/lib/commands/system-bars.js +76 -77
  192. package/lib/commands/time.js +36 -0
  193. package/lib/commands/touch.js +442 -346
  194. package/lib/commands/types.ts +123 -2
  195. package/lib/doctor/checks.js +24 -16
  196. package/lib/driver.ts +454 -12
  197. package/lib/index.ts +1 -13
  198. package/lib/logger.js +1 -1
  199. package/lib/method-map.js +0 -11
  200. package/lib/utils.js +40 -3
  201. package/package.json +2 -2
  202. package/build/lib/commands/actions.d.ts +0 -8
  203. package/build/lib/commands/actions.d.ts.map +0 -1
  204. package/build/lib/commands/actions.js +0 -207
  205. package/build/lib/commands/actions.js.map +0 -1
  206. package/build/lib/commands/alert.d.ts +0 -8
  207. package/build/lib/commands/alert.d.ts.map +0 -1
  208. package/build/lib/commands/alert.js +0 -29
  209. package/build/lib/commands/alert.js.map +0 -1
  210. package/build/lib/commands/context.d.ts +0 -10
  211. package/build/lib/commands/context.d.ts.map +0 -1
  212. package/build/lib/commands/context.js +0 -431
  213. package/build/lib/commands/context.js.map +0 -1
  214. package/build/lib/commands/emu-console.d.ts +0 -7
  215. package/build/lib/commands/emu-console.d.ts.map +0 -1
  216. package/build/lib/commands/emu-console.js +0 -27
  217. package/build/lib/commands/emu-console.js.map +0 -1
  218. package/build/lib/commands/general.d.ts +0 -9
  219. package/build/lib/commands/general.d.ts.map +0 -1
  220. package/build/lib/commands/general.js +0 -293
  221. package/build/lib/commands/general.js.map +0 -1
  222. package/build/lib/commands/index.d.ts +0 -28
  223. package/build/lib/commands/index.d.ts.map +0 -1
  224. package/build/lib/commands/index.js +0 -57
  225. package/build/lib/commands/index.js.map +0 -1
  226. package/build/lib/commands/mixins.d.ts +0 -747
  227. package/build/lib/commands/mixins.d.ts.map +0 -1
  228. package/build/lib/commands/mixins.js +0 -19
  229. package/build/lib/commands/mixins.js.map +0 -1
  230. package/build/lib/helpers/android.d.ts +0 -163
  231. package/build/lib/helpers/android.d.ts.map +0 -1
  232. package/build/lib/helpers/android.js +0 -818
  233. package/build/lib/helpers/android.js.map +0 -1
  234. package/build/lib/helpers/index.d.ts +0 -7
  235. package/build/lib/helpers/index.d.ts.map +0 -1
  236. package/build/lib/helpers/index.js +0 -29
  237. package/build/lib/helpers/index.js.map +0 -1
  238. package/build/lib/helpers/types.d.ts +0 -122
  239. package/build/lib/helpers/types.d.ts.map +0 -1
  240. package/build/lib/helpers/types.js +0 -3
  241. package/build/lib/helpers/types.js.map +0 -1
  242. package/build/lib/helpers/unlock.d.ts +0 -32
  243. package/build/lib/helpers/unlock.d.ts.map +0 -1
  244. package/build/lib/helpers/unlock.js +0 -273
  245. package/build/lib/helpers/unlock.js.map +0 -1
  246. package/build/lib/helpers/webview.d.ts +0 -74
  247. package/build/lib/helpers/webview.d.ts.map +0 -1
  248. package/build/lib/helpers/webview.js +0 -448
  249. package/build/lib/helpers/webview.js.map +0 -1
  250. package/lib/commands/actions.js +0 -244
  251. package/lib/commands/alert.js +0 -34
  252. package/lib/commands/context.js +0 -507
  253. package/lib/commands/emu-console.js +0 -31
  254. package/lib/commands/general.js +0 -343
  255. package/lib/commands/index.ts +0 -54
  256. package/lib/commands/mixins.ts +0 -976
  257. package/lib/helpers/android.ts +0 -1153
  258. package/lib/helpers/index.ts +0 -6
  259. package/lib/helpers/types.ts +0 -136
  260. package/lib/helpers/unlock.ts +0 -329
  261. package/lib/helpers/webview.ts +0 -610
@@ -1,40 +1,39 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const mixins_1 = require("./mixins");
3
+ exports.mobileGetUiMode = exports.mobileSetUiMode = void 0;
4
4
  const utils_1 = require("../utils");
5
5
  const RESPONSE_PATTERN = /:\s+(\w+)/;
6
6
  /**
7
- * @type {import('./mixins').AppearanceMixin & ThisType<import('../driver').AndroidDriver>}
8
- * @satisfies {import('@appium/types').ExternalDriver}
7
+ * Set the Ui appearance.
8
+ *
9
+ * @since Android 10
10
+ * @this {import('../driver').AndroidDriver}
11
+ * @property {import('./types').SetUiModeOpts}
12
+ * @returns {Promise<void>}
9
13
  */
10
- const AppearanceMixin = {
11
- /**
12
- * Set the Ui appearance.
13
- *
14
- * @since Android 10
15
- */
16
- async mobileSetUiMode(opts) {
17
- const { mode, value } = (0, utils_1.requireArgs)(['mode', 'value'], opts);
18
- await this.adb.shell(['cmd', 'uimode', mode, value]);
19
- },
20
- /**
21
- * Get the Ui appearance.
22
- *
23
- * @since Android 10
24
- * @returns {Promise<string>} The actual state for the queried UI mode,
25
- * for example 'yes' or 'no'
26
- */
27
- async mobileGetUiMode(opts) {
28
- const { mode } = (0, utils_1.requireArgs)(['mode'], opts);
29
- const response = await this.adb.shell(['cmd', 'uimode', mode]);
30
- // response looks like 'Night mode: no'
31
- const match = RESPONSE_PATTERN.exec(response);
32
- if (!match) {
33
- throw new Error(`Cannot parse the command response: ${response}`);
34
- }
35
- return match[1];
36
- },
37
- };
38
- exports.default = AppearanceMixin;
39
- (0, mixins_1.mixin)(AppearanceMixin);
14
+ async function mobileSetUiMode(opts) {
15
+ const { mode, value } = (0, utils_1.requireArgs)(['mode', 'value'], opts);
16
+ await this.adb.shell(['cmd', 'uimode', mode, value]);
17
+ }
18
+ exports.mobileSetUiMode = mobileSetUiMode;
19
+ /**
20
+ * Get the Ui appearance.
21
+ *
22
+ * @since Android 10
23
+ * @this {import('../driver').AndroidDriver}
24
+ * @property {import('./types').GetUiModeOpts}
25
+ * @returns {Promise<string>} The actual state for the queried UI mode,
26
+ * for example 'yes' or 'no'
27
+ */
28
+ async function mobileGetUiMode(opts) {
29
+ const { mode } = (0, utils_1.requireArgs)(['mode'], opts);
30
+ const response = await this.adb.shell(['cmd', 'uimode', mode]);
31
+ // response looks like 'Night mode: no'
32
+ const match = RESPONSE_PATTERN.exec(response);
33
+ if (!match) {
34
+ throw new Error(`Cannot parse the command response: ${response}`);
35
+ }
36
+ return match[1];
37
+ }
38
+ exports.mobileGetUiMode = mobileGetUiMode;
40
39
  //# sourceMappingURL=appearance.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"appearance.js","sourceRoot":"","sources":["../../../lib/commands/appearance.js"],"names":[],"mappings":";;AAAA,qCAA+B;AAC/B,oCAAqC;AAErC,MAAM,gBAAgB,GAAG,WAAW,CAAC;AAErC;;;GAGG;AACH,MAAM,eAAe,GAAG;IACtB;;;;OAIG;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CAAC,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC;AACvD,CAAC;AAHD,0CAGC;AAED;;;;;;;;GAQG;AACI,KAAK,UAAU,eAAe,CAAC,IAAI;IACxC,MAAM,EAAC,IAAI,EAAC,GAAG,IAAA,mBAAW,EAAC,CAAC,MAAM,CAAC,EAAE,IAAI,CAAC,CAAC;IAC3C,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,QAAQ,EAAE,IAAI,CAAC,CAAC,CAAC;IAC/D,uCAAuC;IACvC,MAAM,KAAK,GAAG,gBAAgB,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IAC9C,IAAI,CAAC,KAAK,EAAE;QACV,MAAM,IAAI,KAAK,CAAC,sCAAsC,QAAQ,EAAE,CAAC,CAAC;KACnE;IACD,OAAO,KAAK,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC;AATD,0CASC"}
@@ -0,0 +1,19 @@
1
+ /**
2
+ *
3
+ * @param {import('appium-adb').ADB} adb
4
+ * @param {string} webview
5
+ * @returns {string}
6
+ */
7
+ export function toDetailsCacheKey(adb: import('appium-adb').ADB, webview: string): string;
8
+ /**
9
+ * Retrieves web view details previously cached by `getWebviews` call
10
+ *
11
+ * @param {import('appium-adb').ADB} adb
12
+ * @param {string} webview
13
+ * @returns {import('../types').WebViewDetails | undefined}
14
+ */
15
+ export function getWebviewDetails(adb: import('appium-adb').ADB, webview: string): import('../types').WebViewDetails | undefined;
16
+ /** @type {LRUCache<string, import('../types').WebViewDetails>} */
17
+ export const WEBVIEWS_DETAILS_CACHE: LRUCache<string, import('../types').WebViewDetails>;
18
+ import { LRUCache } from 'lru-cache';
19
+ //# sourceMappingURL=cache.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cache.d.ts","sourceRoot":"","sources":["../../../../lib/commands/context/cache.js"],"names":[],"mappings":"AAQA;;;;;GAKG;AACH,uCAJW,OAAO,YAAY,EAAE,GAAG,WACxB,MAAM,GACJ,MAAM,CAIlB;AAED;;;;;;GAMG;AACH,uCAJW,OAAO,YAAY,EAAE,GAAG,WACxB,MAAM,GACJ,OAAO,UAAU,EAAE,cAAc,GAAG,SAAS,CAKzD;AA1BD,kEAAkE;AAClE,qCADW,SAAS,MAAM,EAAE,OAAO,UAAU,EAAE,cAAc,CAAC,CAI3D;yBANoB,WAAW"}
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getWebviewDetails = exports.toDetailsCacheKey = exports.WEBVIEWS_DETAILS_CACHE = void 0;
4
+ const lru_cache_1 = require("lru-cache");
5
+ /** @type {LRUCache<string, import('../types').WebViewDetails>} */
6
+ exports.WEBVIEWS_DETAILS_CACHE = new lru_cache_1.LRUCache({
7
+ max: 100,
8
+ updateAgeOnGet: true,
9
+ });
10
+ /**
11
+ *
12
+ * @param {import('appium-adb').ADB} adb
13
+ * @param {string} webview
14
+ * @returns {string}
15
+ */
16
+ function toDetailsCacheKey(adb, webview) {
17
+ return `${adb?.curDeviceId}:${webview}`;
18
+ }
19
+ exports.toDetailsCacheKey = toDetailsCacheKey;
20
+ /**
21
+ * Retrieves web view details previously cached by `getWebviews` call
22
+ *
23
+ * @param {import('appium-adb').ADB} adb
24
+ * @param {string} webview
25
+ * @returns {import('../types').WebViewDetails | undefined}
26
+ */
27
+ function getWebviewDetails(adb, webview) {
28
+ const key = toDetailsCacheKey(adb, webview);
29
+ return exports.WEBVIEWS_DETAILS_CACHE.get(key);
30
+ }
31
+ exports.getWebviewDetails = getWebviewDetails;
32
+ //# sourceMappingURL=cache.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cache.js","sourceRoot":"","sources":["../../../../lib/commands/context/cache.js"],"names":[],"mappings":";;;AAAA,yCAAmC;AAEnC,kEAAkE;AACrD,QAAA,sBAAsB,GAAG,IAAI,oBAAQ,CAAC;IACjD,GAAG,EAAE,GAAG;IACR,cAAc,EAAE,IAAI;CACrB,CAAC,CAAC;AAEH;;;;;GAKG;AACH,SAAgB,iBAAiB,CAAC,GAAG,EAAE,OAAO;IAC5C,OAAO,GAAG,GAAG,EAAE,WAAW,IAAI,OAAO,EAAE,CAAC;AAC1C,CAAC;AAFD,8CAEC;AAED;;;;;;GAMG;AACH,SAAgB,iBAAiB,CAAC,GAAG,EAAE,OAAO;IAC5C,MAAM,GAAG,GAAG,iBAAiB,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;IAC5C,OAAO,8BAAsB,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AACzC,CAAC;AAHD,8CAGC"}
@@ -0,0 +1,141 @@
1
+ /**
2
+ * @this {import('../../driver').AndroidDriver}
3
+ * @returns {Promise<string>}
4
+ */
5
+ export function getCurrentContext(this: import("../../driver").AndroidDriver): Promise<string>;
6
+ /**
7
+ * @this {import('../../driver').AndroidDriver}
8
+ * @returns {Promise<string[]>}
9
+ */
10
+ export function getContexts(this: import("../../driver").AndroidDriver): Promise<string[]>;
11
+ /**
12
+ * @this {import('../../driver').AndroidDriver}
13
+ * @param {string?} name
14
+ * @returns {Promise<void>}
15
+ */
16
+ export function setContext(this: import("../../driver").AndroidDriver, name: string | null): Promise<void>;
17
+ export class setContext {
18
+ /**
19
+ * @this {import('../../driver').AndroidDriver}
20
+ * @param {string?} name
21
+ * @returns {Promise<void>}
22
+ */
23
+ constructor(this: import("../../driver").AndroidDriver, name: string | null);
24
+ curContext: string;
25
+ }
26
+ /**
27
+ * @this {import('../../driver').AndroidDriver}
28
+ * @param {any} [opts={}]
29
+ * @returns {Promise<import('../types').WebviewsMapping[]>}
30
+ */
31
+ export function mobileGetContexts(this: import("../../driver").AndroidDriver, opts?: any): Promise<import('../types').WebviewsMapping[]>;
32
+ /**
33
+ * @this {import('../../driver').AndroidDriver}
34
+ * @param {import('../types').WebviewsMapping[]} webviewsMapping
35
+ * @returns {string[]}
36
+ */
37
+ export function assignContexts(this: import("../../driver").AndroidDriver, webviewsMapping: import('../types').WebviewsMapping[]): string[];
38
+ export class assignContexts {
39
+ /**
40
+ * @this {import('../../driver').AndroidDriver}
41
+ * @param {import('../types').WebviewsMapping[]} webviewsMapping
42
+ * @returns {string[]}
43
+ */
44
+ constructor(this: import("../../driver").AndroidDriver, webviewsMapping: import('../types').WebviewsMapping[]);
45
+ contexts: any[];
46
+ }
47
+ /**
48
+ * @this {import('../../driver').AndroidDriver}
49
+ * @param {string} name
50
+ * @param {import('../types').WebviewsMapping[]} webviewsMapping
51
+ * @returns {Promise<void>}
52
+ */
53
+ export function switchContext(this: import("../../driver").AndroidDriver, name: string, webviewsMapping: import('../types').WebviewsMapping[]): Promise<void>;
54
+ /**
55
+ * @this {import('../../driver').AndroidDriver}
56
+ * @returns {string}
57
+ */
58
+ export function defaultContextName(this: import("../../driver").AndroidDriver): string;
59
+ /**
60
+ * @this {import('../../driver').AndroidDriver}
61
+ * @returns {string}
62
+ */
63
+ export function defaultWebviewName(this: import("../../driver").AndroidDriver): string;
64
+ /**
65
+ * @this {import('../../driver').AndroidDriver}
66
+ * @returns {boolean}
67
+ */
68
+ export function isWebContext(this: import("../../driver").AndroidDriver): boolean;
69
+ /**
70
+ * Turn on proxying to an existing Chromedriver session or a new one
71
+ *
72
+ * @this {import('../../driver').AndroidDriver}
73
+ * @param {string} context
74
+ * @param {import('../types').WebviewsMapping[]} webviewsMapping
75
+ * @returns {Promise<void>}
76
+ */
77
+ export function startChromedriverProxy(this: import("../../driver").AndroidDriver, context: string, webviewsMapping: import('../types').WebviewsMapping[]): Promise<void>;
78
+ export class startChromedriverProxy {
79
+ /**
80
+ * Turn on proxying to an existing Chromedriver session or a new one
81
+ *
82
+ * @this {import('../../driver').AndroidDriver}
83
+ * @param {string} context
84
+ * @param {import('../types').WebviewsMapping[]} webviewsMapping
85
+ * @returns {Promise<void>}
86
+ */
87
+ constructor(this: import("../../driver").AndroidDriver, context: string, webviewsMapping: import('../types').WebviewsMapping[]);
88
+ chromedriver: any;
89
+ proxyReqRes: any;
90
+ proxyCommand: (<TReq = any, TRes = unknown>(url: string, method: import("@appium/types").HTTPMethod, body?: TReq | undefined) => Promise<TRes>) | undefined;
91
+ jwpProxyActive: boolean;
92
+ }
93
+ /**
94
+ * Stop proxying to any Chromedriver
95
+ *
96
+ * @this {import('../../driver').AndroidDriver}
97
+ * @returns {void}
98
+ */
99
+ export function suspendChromedriverProxy(this: import("../../driver").AndroidDriver): void;
100
+ export class suspendChromedriverProxy {
101
+ chromedriver: any;
102
+ proxyReqRes: any;
103
+ proxyCommand: any;
104
+ jwpProxyActive: boolean;
105
+ }
106
+ /**
107
+ * Handle an out-of-band Chromedriver stop event
108
+ *
109
+ * @this {import('../../driver').AndroidDriver}
110
+ * @param {string} context
111
+ * @returns {Promise<void>}
112
+ */
113
+ export function onChromedriverStop(this: import("../../driver").AndroidDriver, context: string): Promise<void>;
114
+ /**
115
+ * Intentionally stop all the chromedrivers currently active, and ignore
116
+ * their exit events
117
+ *
118
+ * @this {import('../../driver').AndroidDriver}
119
+ * @returns {Promise<void>}
120
+ */
121
+ export function stopChromedriverProxies(this: import("../../driver").AndroidDriver): Promise<void>;
122
+ /**
123
+ * @this {import('../../driver').AndroidDriver}
124
+ * @param {string} viewName
125
+ * @returns {boolean}
126
+ */
127
+ export function isChromedriverContext(this: import("../../driver").AndroidDriver, viewName: string): boolean;
128
+ /**
129
+ * @this {import('../../driver').AndroidDriver}
130
+ * @returns {Promise<void>}
131
+ */
132
+ export function startChromeSession(this: import("../../driver").AndroidDriver): Promise<void>;
133
+ export class startChromeSession {
134
+ chromedriver: any;
135
+ curContext: string;
136
+ proxyReqRes: any;
137
+ proxyCommand: (<TReq = any, TRes = unknown>(url: string, method: import("@appium/types").HTTPMethod, body?: TReq | undefined) => Promise<TRes>) | undefined;
138
+ jwpProxyActive: boolean;
139
+ }
140
+ export type ADB = import('appium-adb').ADB;
141
+ //# sourceMappingURL=exports.d.ts.map
@@ -0,0 +1 @@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ACH,qFAFa,QAAQ,IAAI,CAAC,CAgBzB;AAED;;;;GAIG;AACH,4FAHW,MAAM,GACJ,OAAO,CAInB;AAED;;;GAGG;AACH,gFAFa,QAAQ,IAAI,CAAC,CAiDzB;;IA7BC,kBAGC;IAWD,mBAA8B;IAI9B,iBAAqE;IACrE,4JAGC;IACD,wBAA0B;;kBASf,OAAO,YAAY,EAAE,GAAG"}
@@ -0,0 +1,351 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.startChromeSession = exports.isChromedriverContext = exports.stopChromedriverProxies = exports.onChromedriverStop = exports.suspendChromedriverProxy = exports.startChromedriverProxy = exports.isWebContext = exports.defaultWebviewName = exports.defaultContextName = exports.switchContext = exports.assignContexts = exports.mobileGetContexts = exports.setContext = exports.getContexts = exports.getCurrentContext = void 0;
7
+ /* eslint-disable require-await */
8
+ const support_1 = require("@appium/support");
9
+ const appium_chromedriver_1 = __importDefault(require("appium-chromedriver"));
10
+ const driver_1 = require("appium/driver");
11
+ const lodash_1 = __importDefault(require("lodash"));
12
+ const helpers_1 = require("./helpers");
13
+ const app_management_1 = require("../app-management");
14
+ /**
15
+ * @this {import('../../driver').AndroidDriver}
16
+ * @returns {Promise<string>}
17
+ */
18
+ async function getCurrentContext() {
19
+ // if the current context is `null`, indicating no context
20
+ // explicitly set, it is the default context
21
+ return this.curContext || this.defaultContextName();
22
+ }
23
+ exports.getCurrentContext = getCurrentContext;
24
+ /**
25
+ * @this {import('../../driver').AndroidDriver}
26
+ * @returns {Promise<string[]>}
27
+ */
28
+ async function getContexts() {
29
+ const webviewsMapping = await helpers_1.getWebViewsMapping.bind(this)(this.opts);
30
+ return this.assignContexts(webviewsMapping);
31
+ }
32
+ exports.getContexts = getContexts;
33
+ /**
34
+ * @this {import('../../driver').AndroidDriver}
35
+ * @param {string?} name
36
+ * @returns {Promise<void>}
37
+ */
38
+ async function setContext(name) {
39
+ if (!support_1.util.hasValue(name)) {
40
+ name = this.defaultContextName();
41
+ }
42
+ else if (name === helpers_1.WEBVIEW_WIN) {
43
+ // handle setContext "WEBVIEW"
44
+ name = this.defaultWebviewName();
45
+ }
46
+ // if we're already in the context we want, do nothing
47
+ if (name === this.curContext) {
48
+ return;
49
+ }
50
+ const webviewsMapping = await helpers_1.getWebViewsMapping.bind(this)(this.opts);
51
+ const contexts = this.assignContexts(webviewsMapping);
52
+ // if the context we want doesn't exist, fail
53
+ if (!lodash_1.default.includes(contexts, name)) {
54
+ throw new driver_1.errors.NoSuchContextError();
55
+ }
56
+ await this.switchContext(name, webviewsMapping);
57
+ this.curContext = name;
58
+ }
59
+ exports.setContext = setContext;
60
+ /**
61
+ * @this {import('../../driver').AndroidDriver}
62
+ * @param {any} [opts={}]
63
+ * @returns {Promise<import('../types').WebviewsMapping[]>}
64
+ */
65
+ async function mobileGetContexts(opts = {}) {
66
+ const _opts = {
67
+ androidDeviceSocket: this.opts.androidDeviceSocket,
68
+ ensureWebviewsHavePages: true,
69
+ webviewDevtoolsPort: this.opts.webviewDevtoolsPort,
70
+ enableWebviewDetailsCollection: true,
71
+ waitForWebviewMs: opts.waitForWebviewMs || 0,
72
+ };
73
+ return await helpers_1.getWebViewsMapping.bind(this)(_opts);
74
+ }
75
+ exports.mobileGetContexts = mobileGetContexts;
76
+ /**
77
+ * @this {import('../../driver').AndroidDriver}
78
+ * @param {import('../types').WebviewsMapping[]} webviewsMapping
79
+ * @returns {string[]}
80
+ */
81
+ function assignContexts(webviewsMapping) {
82
+ const opts = Object.assign({ isChromeSession: this.isChromeSession }, this.opts);
83
+ const webviews = helpers_1.parseWebviewNames.bind(this)(webviewsMapping, opts);
84
+ this.contexts = [helpers_1.NATIVE_WIN, ...webviews];
85
+ this.log.debug(`Available contexts: ${JSON.stringify(this.contexts)}`);
86
+ return this.contexts;
87
+ }
88
+ exports.assignContexts = assignContexts;
89
+ /**
90
+ * @this {import('../../driver').AndroidDriver}
91
+ * @param {string} name
92
+ * @param {import('../types').WebviewsMapping[]} webviewsMapping
93
+ * @returns {Promise<void>}
94
+ */
95
+ async function switchContext(name, webviewsMapping) {
96
+ // We have some options when it comes to webviews. If we want a
97
+ // Chromedriver webview, we can only control one at a time.
98
+ if (this.isChromedriverContext(name)) {
99
+ // start proxying commands directly to chromedriver
100
+ await this.startChromedriverProxy(name, webviewsMapping);
101
+ }
102
+ else if (this.isChromedriverContext(this.curContext)) {
103
+ // if we're moving to a non-chromedriver webview, and our current context
104
+ // _is_ a chromedriver webview, if caps recreateChromeDriverSessions is set
105
+ // to true then kill chromedriver session using stopChromedriverProxies or
106
+ // else simply suspend proxying to the latter
107
+ if (this.opts.recreateChromeDriverSessions) {
108
+ this.log.debug('recreateChromeDriverSessions set to true; killing existing chromedrivers');
109
+ await this.stopChromedriverProxies();
110
+ }
111
+ else {
112
+ this.suspendChromedriverProxy();
113
+ }
114
+ }
115
+ else {
116
+ throw new Error(`Didn't know how to handle switching to context '${name}'`);
117
+ }
118
+ }
119
+ exports.switchContext = switchContext;
120
+ /**
121
+ * @this {import('../../driver').AndroidDriver}
122
+ * @returns {string}
123
+ */
124
+ function defaultContextName() {
125
+ return helpers_1.NATIVE_WIN;
126
+ }
127
+ exports.defaultContextName = defaultContextName;
128
+ /**
129
+ * @this {import('../../driver').AndroidDriver}
130
+ * @returns {string}
131
+ */
132
+ function defaultWebviewName() {
133
+ return helpers_1.WEBVIEW_BASE + (this.opts.autoWebviewName || this.opts.appPackage);
134
+ }
135
+ exports.defaultWebviewName = defaultWebviewName;
136
+ /**
137
+ * @this {import('../../driver').AndroidDriver}
138
+ * @returns {boolean}
139
+ */
140
+ function isWebContext() {
141
+ return this.curContext !== null && this.curContext !== helpers_1.NATIVE_WIN;
142
+ }
143
+ exports.isWebContext = isWebContext;
144
+ /**
145
+ * Turn on proxying to an existing Chromedriver session or a new one
146
+ *
147
+ * @this {import('../../driver').AndroidDriver}
148
+ * @param {string} context
149
+ * @param {import('../types').WebviewsMapping[]} webviewsMapping
150
+ * @returns {Promise<void>}
151
+ */
152
+ async function startChromedriverProxy(context, webviewsMapping) {
153
+ this.log.debug(`Connecting to chrome-backed webview context '${context}'`);
154
+ let cd;
155
+ if (this.sessionChromedrivers[context]) {
156
+ // in the case where we've already set up a chromedriver for a context,
157
+ // we want to reconnect to it, not create a whole new one
158
+ this.log.debug(`Found existing Chromedriver for context '${context}'. Using it.`);
159
+ cd = this.sessionChromedrivers[context];
160
+ await helpers_1.setupExistingChromedriver.bind(this)(cd);
161
+ }
162
+ else {
163
+ // XXX: this suppresses errors about putting arbitrary stuff on opts
164
+ const opts = /** @type {any} */ (lodash_1.default.cloneDeep(this.opts));
165
+ opts.chromeUseRunningApp = true;
166
+ // if requested, tell chromedriver to attach to the android package we have
167
+ // associated with the context name, rather than the package of the AUT.
168
+ // And turn this on by default for chrome--if chrome pops up with a webview
169
+ // and someone wants to switch to it, we should let chromedriver connect to
170
+ // chrome rather than staying stuck on the AUT
171
+ if (opts.extractChromeAndroidPackageFromContextName || context === `${helpers_1.WEBVIEW_BASE}chrome`) {
172
+ let androidPackage = context.match(`${helpers_1.WEBVIEW_BASE}(.+)`);
173
+ if (androidPackage && androidPackage.length > 0) {
174
+ opts.chromeAndroidPackage = androidPackage[1];
175
+ }
176
+ if (!opts.extractChromeAndroidPackageFromContextName) {
177
+ if (lodash_1.default.has(this.opts, 'enableWebviewDetailsCollection') &&
178
+ !this.opts.enableWebviewDetailsCollection) {
179
+ // When enableWebviewDetailsCollection capability is explicitly disabled, try to identify
180
+ // chromeAndroidPackage based on contexts, known chrome variant packages and queryAppState result
181
+ // since webviewsMapping does not have info object
182
+ const contexts = webviewsMapping.map((wm) => wm.webviewName);
183
+ for (const knownPackage of helpers_1.KNOWN_CHROME_PACKAGE_NAMES) {
184
+ if (lodash_1.default.includes(contexts, `${helpers_1.WEBVIEW_BASE}${knownPackage}`)) {
185
+ continue;
186
+ }
187
+ const appState = await this.queryAppState(knownPackage);
188
+ if (lodash_1.default.includes([app_management_1.APP_STATE.RUNNING_IN_BACKGROUND, app_management_1.APP_STATE.RUNNING_IN_FOREGROUND], appState)) {
189
+ opts.chromeAndroidPackage = knownPackage;
190
+ this.log.debug(`Identified chromeAndroidPackage as '${opts.chromeAndroidPackage}' ` +
191
+ `for context '${context}' by querying states of Chrome app packages`);
192
+ break;
193
+ }
194
+ }
195
+ }
196
+ else {
197
+ for (const wm of webviewsMapping) {
198
+ if (wm.webviewName === context && lodash_1.default.has(wm?.info, 'Android-Package')) {
199
+ // XXX: should be a type guard here
200
+ opts.chromeAndroidPackage =
201
+ /** @type {NonNullable<import('../types').WebviewsMapping['info']>} */ (wm.info)['Android-Package'];
202
+ this.log.debug(`Identified chromeAndroidPackage as '${opts.chromeAndroidPackage}' ` +
203
+ `for context '${context}' by CDP`);
204
+ break;
205
+ }
206
+ }
207
+ }
208
+ }
209
+ }
210
+ cd = await helpers_1.setupNewChromedriver.bind(this)(opts,
211
+ /** @type {string} */ (this.adb.curDeviceId), context);
212
+ // bind our stop/exit handler, passing in context so we know which
213
+ // one stopped unexpectedly
214
+ cd.on(appium_chromedriver_1.default.EVENT_CHANGED, (msg) => {
215
+ if (msg.state === appium_chromedriver_1.default.STATE_STOPPED) {
216
+ this.onChromedriverStop(context);
217
+ }
218
+ });
219
+ // save the chromedriver object under the context
220
+ this.sessionChromedrivers[context] = cd;
221
+ }
222
+ // hook up the local variables so we can proxy this biz
223
+ this.chromedriver = cd;
224
+ // @ts-ignore chromedriver is defined
225
+ this.proxyReqRes = this.chromedriver.proxyReq.bind(this.chromedriver);
226
+ this.proxyCommand = /** @type {import('@appium/types').ExternalDriver['proxyCommand']} */ (
227
+ // @ts-ignore chromedriver is defined
228
+ this.chromedriver.jwproxy.command.bind(this.chromedriver.jwproxy));
229
+ this.jwpProxyActive = true;
230
+ }
231
+ exports.startChromedriverProxy = startChromedriverProxy;
232
+ /**
233
+ * Stop proxying to any Chromedriver
234
+ *
235
+ * @this {import('../../driver').AndroidDriver}
236
+ * @returns {void}
237
+ */
238
+ function suspendChromedriverProxy() {
239
+ this.chromedriver = undefined;
240
+ this.proxyReqRes = undefined;
241
+ this.proxyCommand = undefined;
242
+ this.jwpProxyActive = false;
243
+ }
244
+ exports.suspendChromedriverProxy = suspendChromedriverProxy;
245
+ /**
246
+ * Handle an out-of-band Chromedriver stop event
247
+ *
248
+ * @this {import('../../driver').AndroidDriver}
249
+ * @param {string} context
250
+ * @returns {Promise<void>}
251
+ */
252
+ async function onChromedriverStop(context) {
253
+ this.log.warn(`Chromedriver for context ${context} stopped unexpectedly`);
254
+ if (context === this.curContext) {
255
+ // we exited unexpectedly while automating the current context and so want
256
+ // to shut down the session and respond with an error
257
+ let err = new Error('Chromedriver quit unexpectedly during session');
258
+ await this.startUnexpectedShutdown(err);
259
+ }
260
+ else {
261
+ // if a Chromedriver in the non-active context barfs, we don't really
262
+ // care, we'll just make a new one next time we need the context.
263
+ this.log.warn("Chromedriver quit unexpectedly, but it wasn't the active " + 'context, ignoring');
264
+ delete this.sessionChromedrivers[context];
265
+ }
266
+ }
267
+ exports.onChromedriverStop = onChromedriverStop;
268
+ /**
269
+ * Intentionally stop all the chromedrivers currently active, and ignore
270
+ * their exit events
271
+ *
272
+ * @this {import('../../driver').AndroidDriver}
273
+ * @returns {Promise<void>}
274
+ */
275
+ async function stopChromedriverProxies() {
276
+ this.suspendChromedriverProxy(); // make sure we turn off the proxy flag
277
+ for (let context of lodash_1.default.keys(this.sessionChromedrivers)) {
278
+ let cd = this.sessionChromedrivers[context];
279
+ this.log.debug(`Stopping chromedriver for context ${context}`);
280
+ // stop listening for the stopped state event
281
+ cd.removeAllListeners(appium_chromedriver_1.default.EVENT_CHANGED);
282
+ try {
283
+ await cd.stop();
284
+ }
285
+ catch (err) {
286
+ this.log.warn(`Error stopping Chromedriver: ${ /** @type {Error} */(err).message}`);
287
+ }
288
+ delete this.sessionChromedrivers[context];
289
+ }
290
+ }
291
+ exports.stopChromedriverProxies = stopChromedriverProxies;
292
+ /**
293
+ * @this {import('../../driver').AndroidDriver}
294
+ * @param {string} viewName
295
+ * @returns {boolean}
296
+ */
297
+ function isChromedriverContext(viewName) {
298
+ return lodash_1.default.includes(viewName, helpers_1.WEBVIEW_WIN) || viewName === helpers_1.CHROMIUM_WIN;
299
+ }
300
+ exports.isChromedriverContext = isChromedriverContext;
301
+ /**
302
+ * @this {import('../../driver').AndroidDriver}
303
+ * @returns {Promise<void>}
304
+ */
305
+ async function startChromeSession() {
306
+ this.log.info('Starting a chrome-based browser session');
307
+ // XXX: this suppresses errors about putting arbitrary stuff on opts
308
+ const opts = /** @type {any} */ (lodash_1.default.cloneDeep(this.opts));
309
+ const knownPackages = [
310
+ 'org.chromium.chrome.shell',
311
+ 'com.android.chrome',
312
+ 'com.chrome.beta',
313
+ 'org.chromium.chrome',
314
+ 'org.chromium.webview_shell',
315
+ ];
316
+ if (lodash_1.default.includes(knownPackages, this.opts.appPackage)) {
317
+ opts.chromeBundleId = this.opts.appPackage;
318
+ }
319
+ else {
320
+ opts.chromeAndroidActivity = this.opts.appActivity;
321
+ }
322
+ this.chromedriver = await helpers_1.setupNewChromedriver.bind(this)(opts,
323
+ /** @type {string} */ (this.adb.curDeviceId));
324
+ // @ts-ignore chromedriver is defined
325
+ this.chromedriver.on(appium_chromedriver_1.default.EVENT_CHANGED, (msg) => {
326
+ if (msg.state === appium_chromedriver_1.default.STATE_STOPPED) {
327
+ this.onChromedriverStop(helpers_1.CHROMIUM_WIN);
328
+ }
329
+ });
330
+ // Now that we have a Chrome session, we ensure that the context is
331
+ // appropriately set and that this chromedriver is added to the list
332
+ // of session chromedrivers so we can switch back and forth
333
+ this.curContext = helpers_1.CHROMIUM_WIN;
334
+ // @ts-ignore chromedriver is defined
335
+ this.sessionChromedrivers[helpers_1.CHROMIUM_WIN] = this.chromedriver;
336
+ // @ts-ignore chromedriver should be defined
337
+ this.proxyReqRes = this.chromedriver.proxyReq.bind(this.chromedriver);
338
+ this.proxyCommand = /** @type {import('@appium/types').ExternalDriver['proxyCommand']} */ (
339
+ // @ts-ignore chromedriver is defined
340
+ this.chromedriver.jwproxy.command.bind(this.chromedriver.jwproxy));
341
+ this.jwpProxyActive = true;
342
+ if (helpers_1.shouldDismissChromeWelcome.bind(this)()) {
343
+ // dismiss Chrome welcome dialog
344
+ await helpers_1.dismissChromeWelcome.bind(this)();
345
+ }
346
+ }
347
+ exports.startChromeSession = startChromeSession;
348
+ /**
349
+ * @typedef {import('appium-adb').ADB} ADB
350
+ */
351
+ //# sourceMappingURL=exports.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"exports.js","sourceRoot":"","sources":["../../../../lib/commands/context/exports.js"],"names":[],"mappings":";;;;;;AAAA,kCAAkC;AAClC,6CAAqC;AACrC,8EAA+C;AAC/C,0CAAqC;AACrC,oDAAuB;AACvB,uCAYmB;AACnB,sDAA4C;AAE5C;;;GAGG;AACI,KAAK,UAAU,iBAAiB;IACrC,0DAA0D;IAC1D,4CAA4C;IAC5C,OAAO,IAAI,CAAC,UAAU,IAAI,IAAI,CAAC,kBAAkB,EAAE,CAAC;AACtD,CAAC;AAJD,8CAIC;AAED;;;GAGG;AACI,KAAK,UAAU,WAAW;IAC/B,MAAM,eAAe,GAAG,MAAM,4BAAkB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACvE,OAAO,IAAI,CAAC,cAAc,CAAC,eAAe,CAAC,CAAC;AAC9C,CAAC;AAHD,kCAGC;AAED;;;;GAIG;AACI,KAAK,UAAU,UAAU,CAAC,IAAI;IACnC,IAAI,CAAC,cAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE;QACxB,IAAI,GAAG,IAAI,CAAC,kBAAkB,EAAE,CAAC;KAClC;SAAM,IAAI,IAAI,KAAK,qBAAW,EAAE;QAC/B,8BAA8B;QAC9B,IAAI,GAAG,IAAI,CAAC,kBAAkB,EAAE,CAAC;KA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