appium-android-driver 5.13.1 → 5.13.2

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 (151) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/build/index.js +43 -40
  3. package/build/lib/android-helpers.d.ts +136 -0
  4. package/build/lib/android-helpers.d.ts.map +1 -0
  5. package/build/lib/android-helpers.js +760 -679
  6. package/build/lib/android-helpers.js.map +1 -1
  7. package/build/lib/bootstrap.d.ts +29 -0
  8. package/build/lib/bootstrap.d.ts.map +1 -0
  9. package/build/lib/bootstrap.js +192 -179
  10. package/build/lib/bootstrap.js.map +1 -1
  11. package/build/lib/commands/actions.d.ts +209 -0
  12. package/build/lib/commands/actions.d.ts.map +1 -0
  13. package/build/lib/commands/actions.js +327 -265
  14. package/build/lib/commands/actions.js.map +1 -1
  15. package/build/lib/commands/alert.d.ts +10 -0
  16. package/build/lib/commands/alert.d.ts.map +1 -0
  17. package/build/lib/commands/alert.js +12 -18
  18. package/build/lib/commands/alert.js.map +1 -1
  19. package/build/lib/commands/app-management.d.ts +314 -0
  20. package/build/lib/commands/app-management.d.ts.map +1 -0
  21. package/build/lib/commands/app-management.js +278 -110
  22. package/build/lib/commands/app-management.js.map +1 -1
  23. package/build/lib/commands/context.d.ts +94 -0
  24. package/build/lib/commands/context.d.ts.map +1 -0
  25. package/build/lib/commands/context.js +412 -260
  26. package/build/lib/commands/context.js.map +1 -1
  27. package/build/lib/commands/coverage.d.ts +5 -0
  28. package/build/lib/commands/coverage.d.ts.map +1 -0
  29. package/build/lib/commands/coverage.js +14 -17
  30. package/build/lib/commands/coverage.js.map +1 -1
  31. package/build/lib/commands/element.d.ts +36 -0
  32. package/build/lib/commands/element.d.ts.map +1 -0
  33. package/build/lib/commands/element.js +97 -127
  34. package/build/lib/commands/element.js.map +1 -1
  35. package/build/lib/commands/emu-console.d.ts +49 -0
  36. package/build/lib/commands/emu-console.d.ts.map +1 -0
  37. package/build/lib/commands/emu-console.js +36 -25
  38. package/build/lib/commands/emu-console.js.map +1 -1
  39. package/build/lib/commands/execute.d.ts +6 -0
  40. package/build/lib/commands/execute.d.ts.map +1 -0
  41. package/build/lib/commands/execute.js +68 -69
  42. package/build/lib/commands/execute.js.map +1 -1
  43. package/build/lib/commands/file-actions.d.ts +129 -0
  44. package/build/lib/commands/file-actions.d.ts.map +1 -0
  45. package/build/lib/commands/file-actions.js +321 -178
  46. package/build/lib/commands/file-actions.js.map +1 -1
  47. package/build/lib/commands/find.d.ts +13 -0
  48. package/build/lib/commands/find.d.ts.map +1 -0
  49. package/build/lib/commands/find.js +69 -51
  50. package/build/lib/commands/find.js.map +1 -1
  51. package/build/lib/commands/general.d.ts +133 -0
  52. package/build/lib/commands/general.d.ts.map +1 -0
  53. package/build/lib/commands/general.js +275 -216
  54. package/build/lib/commands/general.js.map +1 -1
  55. package/build/lib/commands/ime.d.ts +11 -0
  56. package/build/lib/commands/ime.d.ts.map +1 -0
  57. package/build/lib/commands/ime.js +27 -33
  58. package/build/lib/commands/ime.js.map +1 -1
  59. package/build/lib/commands/index.d.ts +3 -0
  60. package/build/lib/commands/index.d.ts.map +1 -0
  61. package/build/lib/commands/index.js +32 -35
  62. package/build/lib/commands/index.js.map +1 -1
  63. package/build/lib/commands/intent.d.ts +418 -0
  64. package/build/lib/commands/intent.d.ts.map +1 -0
  65. package/build/lib/commands/intent.js +281 -151
  66. package/build/lib/commands/intent.js.map +1 -1
  67. package/build/lib/commands/keyboard.d.ts +6 -0
  68. package/build/lib/commands/keyboard.d.ts.map +1 -0
  69. package/build/lib/commands/keyboard.js +6 -14
  70. package/build/lib/commands/keyboard.js.map +1 -1
  71. package/build/lib/commands/log.d.ts +45 -0
  72. package/build/lib/commands/log.d.ts.map +1 -0
  73. package/build/lib/commands/log.js +117 -103
  74. package/build/lib/commands/log.js.map +1 -1
  75. package/build/lib/commands/media-projection.d.ts +144 -0
  76. package/build/lib/commands/media-projection.d.ts.map +1 -0
  77. package/build/lib/commands/media-projection.js +228 -171
  78. package/build/lib/commands/media-projection.js.map +1 -1
  79. package/build/lib/commands/network.d.ts +139 -0
  80. package/build/lib/commands/network.d.ts.map +1 -0
  81. package/build/lib/commands/network.js +249 -181
  82. package/build/lib/commands/network.js.map +1 -1
  83. package/build/lib/commands/performance.d.ts +101 -0
  84. package/build/lib/commands/performance.d.ts.map +1 -0
  85. package/build/lib/commands/performance.js +390 -236
  86. package/build/lib/commands/performance.js.map +1 -1
  87. package/build/lib/commands/permissions.d.ts +93 -0
  88. package/build/lib/commands/permissions.d.ts.map +1 -0
  89. package/build/lib/commands/permissions.js +133 -93
  90. package/build/lib/commands/permissions.js.map +1 -1
  91. package/build/lib/commands/recordscreen.d.ts +194 -0
  92. package/build/lib/commands/recordscreen.d.ts.map +1 -0
  93. package/build/lib/commands/recordscreen.js +293 -224
  94. package/build/lib/commands/recordscreen.js.map +1 -1
  95. package/build/lib/commands/shell.d.ts +8 -0
  96. package/build/lib/commands/shell.d.ts.map +1 -0
  97. package/build/lib/commands/shell.js +38 -43
  98. package/build/lib/commands/shell.js.map +1 -1
  99. package/build/lib/commands/streamscreen.d.ts +104 -0
  100. package/build/lib/commands/streamscreen.d.ts.map +1 -0
  101. package/build/lib/commands/streamscreen.js +364 -305
  102. package/build/lib/commands/streamscreen.js.map +1 -1
  103. package/build/lib/commands/system-bars.d.ts +100 -0
  104. package/build/lib/commands/system-bars.d.ts.map +1 -0
  105. package/build/lib/commands/system-bars.js +148 -90
  106. package/build/lib/commands/system-bars.js.map +1 -1
  107. package/build/lib/commands/touch.d.ts +30 -0
  108. package/build/lib/commands/touch.d.ts.map +1 -0
  109. package/build/lib/commands/touch.js +311 -287
  110. package/build/lib/commands/touch.js.map +1 -1
  111. package/build/lib/desired-caps.d.ts +353 -0
  112. package/build/lib/desired-caps.d.ts.map +1 -0
  113. package/build/lib/desired-caps.js +291 -292
  114. package/build/lib/desired-caps.js.map +1 -1
  115. package/build/lib/driver.d.ts +430 -0
  116. package/build/lib/driver.d.ts.map +1 -0
  117. package/build/lib/driver.js +449 -384
  118. package/build/lib/driver.js.map +1 -1
  119. package/build/lib/logger.d.ts +3 -0
  120. package/build/lib/logger.d.ts.map +1 -0
  121. package/build/lib/logger.js +5 -11
  122. package/build/lib/logger.js.map +1 -1
  123. package/build/lib/method-map.d.ts +389 -0
  124. package/build/lib/method-map.d.ts.map +1 -0
  125. package/build/lib/method-map.js +220 -394
  126. package/build/lib/method-map.js.map +1 -1
  127. package/build/lib/stubs.d.ts +8 -0
  128. package/build/lib/stubs.d.ts.map +1 -0
  129. package/build/lib/stubs.js +5 -0
  130. package/build/lib/stubs.js.map +1 -0
  131. package/build/lib/uiautomator.d.ts +24 -0
  132. package/build/lib/uiautomator.d.ts.map +1 -0
  133. package/build/lib/uiautomator.js +86 -82
  134. package/build/lib/uiautomator.js.map +1 -1
  135. package/build/lib/unlock-helpers.d.ts +38 -0
  136. package/build/lib/unlock-helpers.d.ts.map +1 -0
  137. package/build/lib/unlock-helpers.js +228 -204
  138. package/build/lib/unlock-helpers.js.map +1 -1
  139. package/build/lib/utils.d.ts +11 -0
  140. package/build/lib/utils.d.ts.map +1 -0
  141. package/build/lib/utils.js +23 -18
  142. package/build/lib/utils.js.map +1 -1
  143. package/build/lib/webview-helpers.d.ts +223 -0
  144. package/build/lib/webview-helpers.d.ts.map +1 -0
  145. package/build/lib/webview-helpers.js +476 -298
  146. package/build/lib/webview-helpers.js.map +1 -1
  147. package/index.js +3 -1
  148. package/lib/android-helpers.js +2 -1
  149. package/lib/stubs.ts +8 -0
  150. package/lib/unlock-helpers.js +2 -2
  151. package/package.json +23 -14
@@ -1,22 +1,27 @@
1
1
  "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.ADB_SHELL_FEATURE = void 0;
8
- exports.requireArgs = requireArgs;
9
- require("source-map-support/register");
10
- var _lodash = _interopRequireDefault(require("lodash"));
11
- var _driver = require("appium/driver");
12
- const ADB_SHELL_FEATURE = 'adb_shell';
13
- exports.ADB_SHELL_FEATURE = ADB_SHELL_FEATURE;
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.requireArgs = exports.ADB_SHELL_FEATURE = void 0;
7
+ const lodash_1 = __importDefault(require("lodash"));
8
+ const driver_1 = require("appium/driver");
9
+ exports.ADB_SHELL_FEATURE = 'adb_shell';
10
+ /**
11
+ * Assert the presence of particular keys in the given object
12
+ *
13
+ * @template {Object} T
14
+ * @param {string|string[]} argNames one or more key names
15
+ * @param {T} opts the object to check
16
+ * @returns {T} the same given object
17
+ */
14
18
  function requireArgs(argNames, opts = {}) {
15
- for (const argName of _lodash.default.isArray(argNames) ? argNames : [argNames]) {
16
- if (!_lodash.default.has(opts, argName)) {
17
- throw new _driver.errors.InvalidArgumentError(`'${argName}' argument must be provided`);
19
+ for (const argName of (lodash_1.default.isArray(argNames) ? argNames : [argNames])) {
20
+ if (!lodash_1.default.has(opts, argName)) {
21
+ throw new driver_1.errors.InvalidArgumentError(`'${argName}' argument must be provided`);
22
+ }
18
23
  }
19
- }
20
- return opts;
24
+ return opts;
21
25
  }
22
- //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6WyJfbG9kYXNoIiwiX2ludGVyb3BSZXF1aXJlRGVmYXVsdCIsInJlcXVpcmUiLCJfZHJpdmVyIiwiQURCX1NIRUxMX0ZFQVRVUkUiLCJleHBvcnRzIiwicmVxdWlyZUFyZ3MiLCJhcmdOYW1lcyIsIm9wdHMiLCJhcmdOYW1lIiwiXyIsImlzQXJyYXkiLCJoYXMiLCJlcnJvcnMiLCJJbnZhbGlkQXJndW1lbnRFcnJvciJdLCJzb3VyY2VzIjpbIi4uLy4uL2xpYi91dGlscy5qcyJdLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgXyBmcm9tICdsb2Rhc2gnO1xuaW1wb3J0IHsgZXJyb3JzIH0gZnJvbSAnYXBwaXVtL2RyaXZlcic7XG5cbmV4cG9ydCBjb25zdCBBREJfU0hFTExfRkVBVFVSRSA9ICdhZGJfc2hlbGwnO1xuXG4vKipcbiAqIEFzc2VydCB0aGUgcHJlc2VuY2Ugb2YgcGFydGljdWxhciBrZXlzIGluIHRoZSBnaXZlbiBvYmplY3RcbiAqXG4gKiBAdGVtcGxhdGUge09iamVjdH0gVFxuICogQHBhcmFtIHtzdHJpbmd8c3RyaW5nW119IGFyZ05hbWVzIG9uZSBvciBtb3JlIGtleSBuYW1lc1xuICogQHBhcmFtIHtUfSBvcHRzIHRoZSBvYmplY3QgdG8gY2hlY2tcbiAqIEByZXR1cm5zIHtUfSB0aGUgc2FtZSBnaXZlbiBvYmplY3RcbiAqL1xuZXhwb3J0IGZ1bmN0aW9uIHJlcXVpcmVBcmdzIChhcmdOYW1lcywgb3B0cyA9IHt9KSB7XG4gIGZvciAoY29uc3QgYXJnTmFtZSBvZiAoXy5pc0FycmF5KGFyZ05hbWVzKSA/IGFyZ05hbWVzIDogW2FyZ05hbWVzXSkpIHtcbiAgICBpZiAoIV8uaGFzKG9wdHMsIGFyZ05hbWUpKSB7XG4gICAgICB0aHJvdyBuZXcgZXJyb3JzLkludmFsaWRBcmd1bWVudEVycm9yKGAnJHthcmdOYW1lfScgYXJndW1lbnQgbXVzdCBiZSBwcm92aWRlZGApO1xuICAgIH1cbiAgfVxuICByZXR1cm4gb3B0cztcbn0iXSwibWFwcGluZ3MiOiI7Ozs7Ozs7OztBQUFBLElBQUFBLE9BQUEsR0FBQUMsc0JBQUEsQ0FBQUMsT0FBQTtBQUNBLElBQUFDLE9BQUEsR0FBQUQsT0FBQTtBQUVPLE1BQU1FLGlCQUFpQixHQUFHLFdBQVc7QUFBQ0MsT0FBQSxDQUFBRCxpQkFBQSxHQUFBQSxpQkFBQTtBQVV0QyxTQUFTRSxXQUFXQSxDQUFFQyxRQUFRLEVBQUVDLElBQUksR0FBRyxDQUFDLENBQUMsRUFBRTtFQUNoRCxLQUFLLE1BQU1DLE9BQU8sSUFBS0MsZUFBQyxDQUFDQyxPQUFPLENBQUNKLFFBQVEsQ0FBQyxHQUFHQSxRQUFRLEdBQUcsQ0FBQ0EsUUFBUSxDQUFDLEVBQUc7SUFDbkUsSUFBSSxDQUFDRyxlQUFDLENBQUNFLEdBQUcsQ0FBQ0osSUFBSSxFQUFFQyxPQUFPLENBQUMsRUFBRTtNQUN6QixNQUFNLElBQUlJLGNBQU0sQ0FBQ0Msb0JBQW9CLENBQUUsSUFBR0wsT0FBUSw2QkFBNEIsQ0FBQztJQUNqRjtFQUNGO0VBQ0EsT0FBT0QsSUFBSTtBQUNiIn0=
26
+ exports.requireArgs = requireArgs;
27
+ //# sourceMappingURL=utils.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","names":["_lodash","_interopRequireDefault","require","_driver","ADB_SHELL_FEATURE","exports","requireArgs","argNames","opts","argName","_","isArray","has","errors","InvalidArgumentError"],"sources":["../../lib/utils.js"],"sourcesContent":["import _ from 'lodash';\nimport { errors } from 'appium/driver';\n\nexport const ADB_SHELL_FEATURE = 'adb_shell';\n\n/**\n * Assert the presence of particular keys in the given object\n *\n * @template {Object} T\n * @param {string|string[]} argNames one or more key names\n * @param {T} opts the object to check\n * @returns {T} the same given object\n */\nexport function requireArgs (argNames, opts = {}) {\n for (const argName of (_.isArray(argNames) ? argNames : [argNames])) {\n if (!_.has(opts, argName)) {\n throw new errors.InvalidArgumentError(`'${argName}' argument must be provided`);\n }\n }\n return opts;\n}"],"mappings":";;;;;;;;;AAAA,IAAAA,OAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AAEO,MAAME,iBAAiB,GAAG,WAAW;AAACC,OAAA,CAAAD,iBAAA,GAAAA,iBAAA;AAUtC,SAASE,WAAWA,CAAEC,QAAQ,EAAEC,IAAI,GAAG,CAAC,CAAC,EAAE;EAChD,KAAK,MAAMC,OAAO,IAAKC,eAAC,CAACC,OAAO,CAACJ,QAAQ,CAAC,GAAGA,QAAQ,GAAG,CAACA,QAAQ,CAAC,EAAG;IACnE,IAAI,CAACG,eAAC,CAACE,GAAG,CAACJ,IAAI,EAAEC,OAAO,CAAC,EAAE;MACzB,MAAM,IAAII,cAAM,CAACC,oBAAoB,CAAE,IAAGL,OAAQ,6BAA4B,CAAC;IACjF;EACF;EACA,OAAOD,IAAI;AACb"}
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../lib/utils.js"],"names":[],"mappings":";;;;;;AAAA,oDAAuB;AACvB,0CAAuC;AAE1B,QAAA,iBAAiB,GAAG,WAAW,CAAC;AAE7C;;;;;;;GAOG;AACH,SAAgB,WAAW,CAAE,QAAQ,EAAE,IAAI,GAAG,EAAE;IAC9C,KAAK,MAAM,OAAO,IAAI,CAAC,gBAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE;QACnE,IAAI,CAAC,gBAAC,CAAC,GAAG,CAAC,IAAI,EAAE,OAAO,CAAC,EAAE;YACzB,MAAM,IAAI,eAAM,CAAC,oBAAoB,CAAC,IAAI,OAAO,6BAA6B,CAAC,CAAC;SACjF;KACF;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAPD,kCAOC"}
@@ -0,0 +1,223 @@
1
+ export default helpers;
2
+ export type WebviewProc = {
3
+ /**
4
+ * - The webview process name (as returned by
5
+ * getPotentialWebviewProcs
6
+ */
7
+ proc: string;
8
+ /**
9
+ * - The actual webview context name
10
+ */
11
+ webview: string;
12
+ };
13
+ export type WebviewProps = {
14
+ /**
15
+ * The name of the Devtools Unix socket
16
+ */
17
+ proc: string;
18
+ /**
19
+ * The web view alias. Looks like `WEBVIEW_`
20
+ * prefix plus PID or package name
21
+ */
22
+ webview: string;
23
+ /**
24
+ * Webview information as it is retrieved by
25
+ * /json/version CDP endpoint
26
+ */
27
+ info: any | null;
28
+ /**
29
+ * Webview pages list as it is retrieved by
30
+ * /json/list CDP endpoint
31
+ */
32
+ pages: Array<any> | null;
33
+ };
34
+ export type DetailCollectionOptions = {
35
+ /**
36
+ * The starting port to use for webview page
37
+ * presence check (if not the default of 9222).
38
+ */
39
+ webviewDevtoolsPort: (string | number) | null;
40
+ /**
41
+ * Whether to check for webview
42
+ * pages presence
43
+ */
44
+ ensureWebviewsHavePages: boolean | null;
45
+ /**
46
+ * Whether to collect
47
+ * web view details and send them to Chromedriver constructor, so it could
48
+ * select a binary more precisely based on this info.
49
+ */
50
+ enableWebviewDetailsCollection: boolean;
51
+ };
52
+ export type GetWebviewsOpts = {
53
+ /**
54
+ * [null] - device socket name
55
+ */
56
+ androidDeviceSocket: string;
57
+ /**
58
+ * [true] - whether to check for webview
59
+ * page presence
60
+ */
61
+ ensureWebviewsHavePages: boolean;
62
+ /**
63
+ * [9222] - port to use for webview page
64
+ * presence check.
65
+ */
66
+ webviewDevtoolsPort: number;
67
+ /**
68
+ * [true] - whether to collect
69
+ * web view details and send them to Chromedriver constructor, so it could
70
+ * select a binary more precisely based on this info.
71
+ */
72
+ enableWebviewDetailsCollection: boolean;
73
+ };
74
+ export type WebviewsMapping = {
75
+ /**
76
+ * See note on WebviewProps
77
+ */
78
+ proc: string;
79
+ /**
80
+ * See note on WebviewProps
81
+ */
82
+ webview: string;
83
+ /**
84
+ * See note on WebviewProps
85
+ */
86
+ info: any | null;
87
+ /**
88
+ * See note on WebviewProps
89
+ */
90
+ pages: Array<any> | null;
91
+ };
92
+ export type ProcessInfo = {
93
+ /**
94
+ * The process name
95
+ */
96
+ name: string;
97
+ /**
98
+ * The process id (if could be retrieved)
99
+ */
100
+ id: string | null;
101
+ };
102
+ export type WebViewDetails = {
103
+ /**
104
+ * - Web view process details
105
+ */
106
+ process: ProcessInfo | null;
107
+ /**
108
+ * - Web view details as returned by /json/version CDP endpoint, for example:
109
+ * {
110
+ * "Browser": "Chrome/72.0.3601.0",
111
+ * "Protocol-Version": "1.3",
112
+ * "User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3601.0 Safari/537.36",
113
+ * "V8-Version": "7.2.233",
114
+ * "WebKit-Version": "537.36 (@cfede9db1d154de0468cb0538479f34c0755a0f4)",
115
+ * "webSocketDebuggerUrl": "ws://localhost:9222/devtools/browser/b0b8a4fb-bb17-4359-9533-a8d9f3908bd8"
116
+ * }
117
+ */
118
+ info: any;
119
+ };
120
+ export namespace helpers {
121
+ /**
122
+ * Take a webview name like WEBVIEW_4296 and use 'adb shell ps' to figure out
123
+ * which app package is associated with that webview. One of the reasons we
124
+ * want to do this is to make sure we're listing webviews for the actual AUT,
125
+ * not some other running app
126
+ *
127
+ * @param {object} adb - an ADB instance
128
+ * @param {string} webview - a webview process name
129
+ *
130
+ * @returns {string} - the package name of the app running the webview
131
+ * @throws {Error} If there was a failure while retrieving the process name
132
+ */
133
+ function procFromWebview(adb: any, webview: string): string;
134
+ /**
135
+ * Parse webview names for getContexts
136
+ *
137
+ * @param {Array<WebviewsMapping>} webviewsMapping See note on getWebViewsMapping
138
+ * @param {GetWebviewsOpts} opts See note on getWebViewsMapping
139
+ * @return {Array.<string>} - a list of webview names
140
+ */
141
+ function parseWebviewNames(webviewsMapping: WebviewsMapping[], { ensureWebviewsHavePages, isChromeSession }?: GetWebviewsOpts): string[];
142
+ /**
143
+ * @typedef {Object} GetWebviewsOpts
144
+ * @property {string} androidDeviceSocket [null] - device socket name
145
+ * @property {boolean} ensureWebviewsHavePages [true] - whether to check for webview
146
+ * page presence
147
+ * @property {number} webviewDevtoolsPort [9222] - port to use for webview page
148
+ * presence check.
149
+ * @property {boolean} enableWebviewDetailsCollection [true] - whether to collect
150
+ * web view details and send them to Chromedriver constructor, so it could
151
+ * select a binary more precisely based on this info.
152
+ */
153
+ /**
154
+ * @typedef {Object} WebviewsMapping
155
+ * @property {string} proc See note on WebviewProps
156
+ * @property {string} webview See note on WebviewProps
157
+ * @property {?Object} info See note on WebviewProps
158
+ * @property {?Array<Object>} pages See note on WebviewProps
159
+ * @propery {?string} webviewName An actual webview name for switching context
160
+ */
161
+ /**
162
+ * Get a list of available webviews mapping by introspecting processes with adb,
163
+ * where webviews are listed. It's possible to pass in a 'deviceSocket' arg, which
164
+ * limits the webview possibilities to the one running on the Chromium devtools
165
+ * socket we're interested in (see note on webviewsFromProcs). We can also
166
+ * direct this method to verify whether a particular webview process actually
167
+ * has any pages (if a process exists but no pages are found, Chromedriver will
168
+ * not actually be able to connect to it, so this serves as a guard for that
169
+ * strange failure mode). The strategy for checking whether any pages are
170
+ * active involves sending a request to the remote debug server on the device,
171
+ * hence it is also possible to specify the port on the host machine which
172
+ * should be used for this communication.
173
+ *
174
+ * @param {object} adb - an ADB instance
175
+ * @param {GetWebviewsOpts} opts
176
+ *
177
+ * @return {Array<WebviewsMapping>} webviewsMapping
178
+ */
179
+ function getWebViewsMapping(adb: any, { androidDeviceSocket, ensureWebviewsHavePages, webviewDevtoolsPort, enableWebviewDetailsCollection }?: GetWebviewsOpts): WebviewsMapping[];
180
+ /**
181
+ * @typedef {Object} ProcessInfo
182
+ * @property {string} name The process name
183
+ * @property {?string} id The process id (if could be retrieved)
184
+ */
185
+ /**
186
+ * @typedef {Object} WebViewDetails
187
+ * @property {?ProcessInfo} process - Web view process details
188
+ * @property {Object} info - Web view details as returned by /json/version CDP endpoint, for example:
189
+ * {
190
+ * "Browser": "Chrome/72.0.3601.0",
191
+ * "Protocol-Version": "1.3",
192
+ * "User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3601.0 Safari/537.36",
193
+ * "V8-Version": "7.2.233",
194
+ * "WebKit-Version": "537.36 (@cfede9db1d154de0468cb0538479f34c0755a0f4)",
195
+ * "webSocketDebuggerUrl": "ws://localhost:9222/devtools/browser/b0b8a4fb-bb17-4359-9533-a8d9f3908bd8"
196
+ * }
197
+ */
198
+ /**
199
+ * Retrieves web view details previously cached by `getWebviews` call
200
+ *
201
+ * @param {ADB} adb ADB instance
202
+ * @param {string} webview The name of the web view
203
+ * @returns {?WebViewDetails} Either `undefined` or the recent web view details
204
+ */
205
+ function getWebviewDetails(adb: ADB, webview: string): WebViewDetails | null;
206
+ /**
207
+ * Create Chrome driver capabilities based on the provided
208
+ * Appium capabilities
209
+ *
210
+ * @param {Object} opts User-provided capabilities object
211
+ * @param {string} deviceId The identifier of the Android device under test
212
+ * @param {?WebViewDetails} webViewDetails
213
+ * @returns {Object} The capabilities object.
214
+ * See https://chromedriver.chromium.org/capabilities for more details.
215
+ */
216
+ function createChromedriverCaps(opts: any, deviceId: string, webViewDetails: WebViewDetails | null): any;
217
+ }
218
+ export const NATIVE_WIN: "NATIVE_APP";
219
+ export const WEBVIEW_WIN: "WEBVIEW";
220
+ export const WEBVIEW_BASE: string;
221
+ export const CHROMIUM_WIN: "CHROMIUM";
222
+ export const KNOWN_CHROME_PACKAGE_NAMES: string[];
223
+ //# sourceMappingURL=webview-helpers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"webview-helpers.d.ts","sourceRoot":"","sources":["../../lib/webview-helpers.js"],"names":[],"mappings":";;;;;;UA0Fc,MAAM;;;;aAEN,MAAM;;;;;;UAyFN,MAAM;;;;;aACN,MAAM;;;;;;;;;;WAIL,UAAa;;;;;;;0BAMb,MAAM,GAAC,MAAM;;;;;6BAEb,OAAO;;;;;;oCAER,OAAO;;;;;;yBAsJP,MAAM;;;;;6BACN,OAAO;;;;;yBAEP,MAAM;;;;;;oCAEN,OAAO;;;;;;UAOP,MAAM;;;;aACN,MAAM;;;;;;;;WAEL,UAAa;;;;;;UA0Ed,MAAM;;;;QACL,MAAM;;;;;;aAKN,WAAW;;;;;;;;;;;;;;;IAzJ1B;;;;;;;;;;;OAWG;IACH,4DAYC;IAED;;;;;;OAMG;IACH,yIAqBC;IAED;;;;;;;;;;OAUG;IAEH;;;;;;;OAOG;IAEH;;;;;;;;;;;;;;;;;OAiBG;IACH,kLAgDC;IAED;;;;OAIG;IAEH;;;;;;;;;;;;OAYG;IAEH;;;;;;OAMG;IACH,6EAGC;IAED;;;;;;;;;OASG;IACH,yGAsFC;;AAviBD,sCAAgC;AAChC,oCAA8B;AAE9B,kCAAuC;AADvC,sCAAgC;AAQhC,kDAKE"}